diff options
author | Joris | 2016-04-16 21:35:50 +0200 |
---|---|---|
committer | Joris | 2016-04-16 21:35:50 +0200 |
commit | 3a88115d118f8256f3ff034dc359df42a9e4051c (patch) | |
tree | 76bee981b0e2cbcf7501eb4afe2686ea7bc2710b /src/client/elm/View | |
parent | 06ccc38b65f0f4da2046ac97de447cd1ad061425 (diff) |
Responsive header
Diffstat (limited to 'src/client/elm/View')
-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" ] + ] + ] + _ -> + [] + ) |