From 323ca81c96e4186747f06b6178d71d49e98c6066 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Fri, 31 Jul 2020 13:35:17 +0200 Subject: Sync opponent proposals --- client/src/Client.elm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'client/src/Client.elm') diff --git a/client/src/Client.elm b/client/src/Client.elm index 94e33cf..178e406 100644 --- a/client/src/Client.elm +++ b/client/src/Client.elm @@ -45,6 +45,12 @@ parseRoomId url = case String.split "/" url.path of _ :: "rooms" :: roomId :: _ -> Ok roomId _ -> Err <| "Invalid path: " ++ url.path +viewOpponent : Messages.Opponent -> Html msg +viewOpponent opponent = Html.div [] <| + [ Html.text opponent.name + ] ++ + if opponent.ready then [Html.text " ✅"] else [] + view : Model -> List (Html Msg) view model = case model of Error str -> @@ -58,7 +64,7 @@ view model = case model of Game game -> [ Html.h1 [] [Html.text "Opponents"] , Html.ul [] <| List.map - (\p -> Html.li [] [Html.text p]) + (\o -> Html.li [] [viewOpponent o]) game.view.opponents , Html.h1 [] [Html.text "You"] , Html.form -- cgit v1.2.3