From 270123cc18ee8acff4b2819f4a609045bd5194f5 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 4 Nov 2021 18:06:11 +0200 Subject: Add navigation and profile --- src/Header.elm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/Header.elm') diff --git a/src/Header.elm b/src/Header.elm index 257b308..36469aa 100644 --- a/src/Header.elm +++ b/src/Header.elm @@ -1,8 +1,8 @@ module Header exposing (..) import Css exposing (..) -import Html.Styled exposing (Html, button, div, text) -import Html.Styled.Attributes exposing (css) +import Html.Styled exposing (..) +import Html.Styled.Attributes exposing (css, href) import Html.Styled.Events exposing (onClick) import Types exposing (Model, Msg(..)) import Utils exposing (templ) @@ -14,6 +14,7 @@ styles = [ displayFlex , flexFlow2 row wrap , justifyContent flexEnd + , alignItems center , width (pct 100) , marginBottom (px 10) ] @@ -22,13 +23,16 @@ styles = [ marginLeft (px 10) , cursor pointer ] + , flexPad = css [ flex (int 1) ] } headerView : Model -> List (Html Msg) headerView model = - [ div [ styles.container ] - [ div [] [ "Logged in as {0}" |> templ [ model.userData.name ] |> text ] + [ header [ styles.container ] + [ a [ href "/" ] [ h1 [] [ text "😎 SOMEBOOK" ] ] + , div [ styles.flexPad ] [] + , div [] [ "Logged in as {0}" |> templ [ model.userData.name ] |> text ] , button [ styles.logoutButton, onClick RequestLogout ] [ text "Logout" ] ] ] -- cgit v1.3