diff options
author | Joris | 2016-06-03 20:27:16 +0200 |
---|---|---|
committer | Joris | 2016-06-03 20:27:16 +0200 |
commit | 8e3a7bf1cb83bbb6e3dcd54308eefa52a29cd679 (patch) | |
tree | d6ba0985a534a0e2e317b1edb0d4c999119d87ff /src/client/elm/View/Header.elm | |
parent | 3a88115d118f8256f3ff034dc359df42a9e4051c (diff) |
Migrate to elm 0.17
Diffstat (limited to 'src/client/elm/View/Header.elm')
-rw-r--r-- | src/client/elm/View/Header.elm | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/client/elm/View/Header.elm b/src/client/elm/View/Header.elm index 74fc2cc..5597429 100644 --- a/src/client/elm/View/Header.elm +++ b/src/client/elm/View/Header.elm @@ -1,13 +1,10 @@ -module View.Header +module View.Header exposing ( renderHeader - ) where + ) -import Signal exposing (Address) import Dict -import TransitRouter - -import Route exposing (..) +import Page exposing (..) import Html exposing (..) import Html.Attributes exposing (..) @@ -15,32 +12,31 @@ import Html.Events exposing (..) import Model exposing (Model) import Model.Translations exposing (getMessage) -import Action exposing (..) +import Msg exposing (..) import Model.View exposing (..) import View.Icon exposing (renderIcon) -import View.Click exposing (clickTo) -renderHeader : Address Action -> Model -> Html -renderHeader address model = +renderHeader : Model -> Html Msg +renderHeader model = header [] ( [ div [ class "title" ] [ text (getMessage "SharedCost" model.translations) ] ] - ++ let item route name = + ++ let item page name = a - ( [ classList - [ ("item", True) - , ("current", TransitRouter.getRoute model == route) - ] - ] ++ clickTo route - ) + [ href (Page.toHash page) + , classList + [ ("item", True) + , ("current", model.page == page) + ] + ] [ text (getMessage name model.translations) ] in case model.view of LoggedInView { me, users } -> [ item Home "PaymentsTitle" , item Income "Income" - , item Stat "Statistics" + , item Statistics "Statistics" , div [ class "nameSignOut" ] [ div @@ -52,7 +48,7 @@ renderHeader address model = ] , button [ class "signOut item" - , onClick address SignOut + , onClick SignOut ] [ renderIcon "power-off" ] ] |