1
0
Fork 0

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 "muting" Decode.bool
|> Pipe.required "requested" Decode.bool
|> Pipe.required "blocked_by" Decode.bool
tagDecoder : Decode.Decoder Tag

View File

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

View File

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