summaryrefslogtreecommitdiffstats
path: root/src/Header.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/Header.elm')
-rw-r--r--src/Header.elm34
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" ]
+ ]
+ ]