Files
lootalot-client/src/Page/Dashboard.elm
2019-11-29 16:20:07 +01:00

50 lines
929 B
Elm

module Page.Dashboard exposing (Model, Msg, init, update, view)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Page.Chest as Chest exposing (Chest)
import Session exposing (Session)
type alias Model =
{ session : Session
, chest : Mode
}
type Mode
= View Chest
init : Session -> ( Model, Cmd Msg )
init session =
( Model session (View Chest.init)
, Cmd.none
)
view : Model -> ( Html Msg, List (Html Msg) )
view model =
case Session.user model.session of
Session.Player player _ ->
( text ""
, [ if player.id == 0 then
p [] [ text "Groupe" ]
else
p [] [ text "Joueur" ]
]
)
Session.Admin ->
( text "", [ p [] [ text "Joueur" ] ] )
type Msg
= Msg
update msg model =
( model, Cmd.none )