aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/View
diff options
context:
space:
mode:
authorJoris2016-03-27 19:21:44 +0200
committerJoris2016-03-27 19:21:44 +0200
commit9b7546b99411a8364eccf6b0262a3c0c7d82380c (patch)
tree24f9186d9168e5422b202f77d64e3da6209a764f /src/client/elm/View
parent75505a85773d0620cc7216cf8583c447cae47891 (diff)
Add the user name in the header
Diffstat (limited to 'src/client/elm/View')
-rw-r--r--src/client/elm/View/Header.elm30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/client/elm/View/Header.elm b/src/client/elm/View/Header.elm
index b8a5bf1..b49cf74 100644
--- a/src/client/elm/View/Header.elm
+++ b/src/client/elm/View/Header.elm
@@ -3,6 +3,7 @@ module View.Header
) where
import Signal exposing (Address)
+import Dict
import Html exposing (..)
import Html.Attributes exposing (..)
@@ -19,16 +20,29 @@ renderHeader : Address Action -> Model -> Html
renderHeader address model =
header
[]
- [ h1
- []
- [ text (getMessage "SharedCost" model.translations) ]
+ [ button
+ [ class "title" ]
+ [ h1
+ []
+ [ text (getMessage "SharedCost" model.translations) ]
+ ]
, case model.view of
- LoggedInView _ ->
- button
- [ class "icon"
- , onClick address SignOut
+ LoggedInView { users, account } ->
+ div
+ [ class "signedPanel" ]
+ [ button
+ [ class "user" ]
+ [ Dict.get account.me users
+ |> Maybe.map .name
+ |> Maybe.withDefault ""
+ |> text
+ ]
+ , button
+ [ class "icon"
+ , onClick address SignOut
+ ]
+ [ renderIcon "power-off" ]
]
- [ renderIcon "power-off" ]
_ ->
text ""
]