diff options
| author | Jan Tuomi <jan.tuomi@valuemotive.com> | 2021-10-30 19:24:00 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan.tuomi@valuemotive.com> | 2021-10-30 19:29:03 +0300 |
| commit | c6d55561bf8422301ea7a2d08b9a7c3e30a1440e (patch) | |
| tree | 33fd6b0c1150b67e2f8ba38806a984c3cecccc75 /src/Header.elm | |
| parent | e24ba80820bd49af72a9e1702ed635e9b63452d1 (diff) | |
Implement authentication
Diffstat (limited to 'src/Header.elm')
| -rw-r--r-- | src/Header.elm | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Header.elm b/src/Header.elm new file mode 100644 index 0000000..257b308 --- /dev/null +++ b/src/Header.elm @@ -0,0 +1,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" ] + ] + ] |
