aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/View/Header.elm
blob: b8a5bf148270a99f3e7030f490dd819b37884891 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
module View.Header
  ( renderHeader
  ) where

import Signal exposing (Address)

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)

import Model exposing (Model)
import Model.Translations exposing (getMessage)
import Model.Action exposing (..)
import Model.View exposing (..)

import View.Icon exposing (renderIcon)

renderHeader : Address Action -> Model -> Html
renderHeader address model =
  header
    []
    [ h1
        []
        [ text (getMessage "SharedCost" model.translations) ]
    , case model.view of
        LoggedInView _ ->
          button
            [ class "icon"
            , onClick address SignOut
            ]
            [ renderIcon "power-off" ]
        _ ->
          text ""
    ]