diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/elm/View/Header.elm | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/src/client/elm/View/Header.elm b/src/client/elm/View/Header.elm index 2edde27..74fc2cc 100644 --- a/src/client/elm/View/Header.elm +++ b/src/client/elm/View/Header.elm @@ -23,39 +23,40 @@ import View.Click exposing (clickTo) renderHeader : Address Action -> Model -> Html renderHeader address model = - let item = specialItem True "" - specialItem showCurrent additionalClasses route name = - a - ( [ classList - [ ("item", True) - , (additionalClasses, True) - , ("current", showCurrent && TransitRouter.getRoute model == route) - ] - ] ++ clickTo route - ) - [ text (getMessage name model.translations) - ] - in - header - [] - ( case model.view of - LoggedInView { me, users } -> - [ specialItem True "title" Home "SharedCost" - , item Income "Income" - , item Stat "Statistics" - , button - [ class "signOut item" - , onClick address SignOut - ] - [ renderIcon "power-off" ] - , div - [ class "name" ] - [ Dict.get me users - |> Maybe.map .name - |> Maybe.withDefault "" - |> text - ] - ] - _ -> - [specialItem False "title" Home "SharedCost"] - ) + header + [] + ( [ div [ class "title" ] [ text (getMessage "SharedCost" model.translations) ] ] + ++ let item route name = + a + ( [ classList + [ ("item", True) + , ("current", TransitRouter.getRoute model == route) + ] + ] ++ clickTo route + ) + [ text (getMessage name model.translations) + ] + in case model.view of + LoggedInView { me, users } -> + [ item Home "PaymentsTitle" + , item Income "Income" + , item Stat "Statistics" + , div + [ class "nameSignOut" ] + [ div + [ class "name" ] + [ Dict.get me users + |> Maybe.map .name + |> Maybe.withDefault "" + |> text + ] + , button + [ class "signOut item" + , onClick address SignOut + ] + [ renderIcon "power-off" ] + ] + ] + _ -> + [] + ) |