aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/View/Header.elm
blob: 3a6241b36491390cd3c2ed826dad15982b3c7cc4 (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
35
36
37
38
39
module View.Header
  ( renderHeader
  ) where

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

import Persona exposing (operations)

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

import View.Icon exposing (renderIcon)

renderHeader : Model -> Html
renderHeader model =
  header
    []
    [ h1
        []
        [ text (getMessage "SharedCost" model.translations) ]
    , case model.view of
        LoadingView ->
          text ""
        SignInView _ ->
          button
            [ class "icon"
            , onClick operations.address Persona.SignIn
            ]
            [ renderIcon "sign-in" ]
        LoggedInView _ ->
          button
            [ class "icon"
            , onClick operations.address Persona.SignOut
            ]
            [ renderIcon "sign-out" ]
    ]