Add follow requested indicator

This commit is contained in:
Ryan Fox 2022-03-26 19:48:25 -07:00
parent 5566d320f5
commit b30c66356a
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
3 changed files with 18 additions and 5 deletions

View File

@ -210,6 +210,7 @@ relationshipDecoder =
|> Pipe.required "following" Decode.bool |> Pipe.required "following" Decode.bool
|> Pipe.required "muting" Decode.bool |> Pipe.required "muting" Decode.bool
|> Pipe.required "requested" Decode.bool |> Pipe.required "requested" Decode.bool
|> Pipe.required "blocked_by" Decode.bool
tagDecoder : Decode.Decoder Tag tagDecoder : Decode.Decoder Tag

View File

@ -231,6 +231,7 @@ type alias Relationship =
, following : Bool , following : Bool
, muting : Bool , muting : Bool
, requested : Bool , requested : Bool
, blocked_by : Bool
} }

View File

@ -81,11 +81,18 @@ followButton currentUser relationship account =
, "Unfollow" , "Unfollow"
) )
else else
( FollowAccount account if relationship.requested then
, "btn btn-default btn-follow" ( UnfollowAccount account
, "eye-open" , "btn btn-default btn-follow btn-warning"
, "Follow" , "remove-sign"
) , "Cancel follow request"
)
else
( FollowAccount account
, "btn btn-default btn-follow"
, "eye-open"
, "Follow"
)
in in
button [ class btnClasses, title tooltip, onClick followEvent ] button [ class btnClasses, title tooltip, onClick followEvent ]
[ Common.icon iconName ] [ Common.icon iconName ]
@ -376,6 +383,10 @@ accountView subView currentUser accountInfo =
span [ class "badge blocking" ] [ text "Blocked" ] span [ class "badge blocking" ] [ text "Blocked" ]
else else
text "" text ""
, if relationship.blocked_by then
span [ class "badge blocking" ] [ text "Blocks you" ]
else
text ""
] ]
Nothing -> Nothing ->