From c6d55561bf8422301ea7a2d08b9a7c3e30a1440e Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sat, 30 Oct 2021 19:24:00 +0300 Subject: Implement authentication --- src/Header.elm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/Header.elm (limited to 'src/Header.elm') 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" ] + ] + ] -- cgit v1.3