Update part3

This commit is contained in:
Richard Feldman
2018-08-13 05:49:56 -04:00
parent 50da3881b1
commit bd72768e6f
21 changed files with 954 additions and 593 deletions

View File

@@ -95,7 +95,7 @@ username : Author -> Username
username author =
case author of
IsViewer cred _ ->
cred.username
Cred.username cred
IsFollowing (FollowedAuthor val _) ->
val
@@ -169,19 +169,19 @@ requestHelp builderFromUrl uname cred =
|> HttpBuilder.toRequest
followButton : (UnfollowedAuthor -> msg) -> UnfollowedAuthor -> Html msg
followButton toMsg ((UnfollowedAuthor uname _) as author) =
followButton : (Cred -> UnfollowedAuthor -> msg) -> Cred -> UnfollowedAuthor -> Html msg
followButton toMsg cred ((UnfollowedAuthor uname _) as author) =
toggleFollowButton "Follow"
[ "btn-outline-secondary" ]
(toMsg author)
(toMsg cred author)
uname
unfollowButton : (FollowedAuthor -> msg) -> FollowedAuthor -> Html msg
unfollowButton toMsg ((FollowedAuthor uname _) as author) =
unfollowButton : (Cred -> FollowedAuthor -> msg) -> Cred -> FollowedAuthor -> Html msg
unfollowButton toMsg cred ((FollowedAuthor uname _) as author) =
toggleFollowButton "Unfollow"
[ "btn-secondary" ]
(toMsg author)
(toMsg cred author)
uname
@@ -220,7 +220,7 @@ decodeFromPair maybeCred ( prof, uname ) =
Decode.succeed (IsNotFollowing (UnfollowedAuthor uname prof))
Just cred ->
if uname == cred.username then
if uname == Cred.username cred then
Decode.succeed (IsViewer cred prof)
else