-
Notifications
You must be signed in to change notification settings - Fork 0
/
View.elm
45 lines (36 loc) · 1.22 KB
/
View.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
module View exposing (..)
import Html exposing (..)
import Html.Events exposing (..)
--import Html.Attributes exposing (..)
import Html.App as App
import Model exposing (..)
import Login.Login as Login
import LeaderBoard.View as LeaderBoard
view : Model -> Html Msg
view model =
let
page =
case model.page of
LeaderBoardPage ->
App.map LeaderBoardMsg (LeaderBoard.view model.leaderBoard)
LoginPage ->
App.map LoginMsg (Login.view model.login)
AddRunnerPage ->
h1 [] [ text "Add Runner" ]
NotFound ->
h1 [] [ text "Not Found" ]
in
div []
[ header []
[ a [ onClick (Navigate LeaderBoardPage) ] [ text "Leader Board" ]
, span [] [ text " | " ]
, a [ onClick (Navigate LoginPage) ] [ text "Login" ]
, span [] [ text " | " ]
, a [ onClick (Navigate AddRunnerPage) ] [ text "Add Runner" ]
]
, hr [] []
, page
, hr [] []
, h4 [] [ text "App Model: " ]
, p [] [ text <| toString model ]
]