blob: 257b308ba44b72e4b1de557632172c72c31744a0 (
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 Header exposing (..)
import Css exposing (..)
import Html.Styled exposing (Html, button, div, text)
import Html.Styled.Attributes exposing (css)
import Html.Styled.Events exposing (onClick)
import Types exposing (Model, Msg(..))
import Utils exposing (templ)
styles =
{ container =
css
[ displayFlex
, flexFlow2 row wrap
, justifyContent flexEnd
, width (pct 100)
, marginBottom (px 10)
]
, logoutButton =
css
[ marginLeft (px 10)
, cursor pointer
]
}
headerView : Model -> List (Html Msg)
headerView model =
[ div [ styles.container ]
[ div [] [ "Logged in as {0}" |> templ [ model.userData.name ] |> text ]
, button [ styles.logoutButton, onClick RequestLogout ] [ text "Logout" ]
]
]
|