decided to internalize modes inside Chest.elm

This commit is contained in:
2019-12-04 19:16:16 +01:00
parent 976fbe6b4b
commit b97be8c321
9 changed files with 332 additions and 242 deletions

View File

@@ -7,10 +7,8 @@ import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Json.Encode as E
import Page exposing (Page)
import Page.Chest as Chest exposing (Msg)
import Route exposing (..)
import Session exposing (..)
import Set exposing (Set)
import Svg.Attributes
import Url
import Utils exposing (..)
@@ -100,7 +98,7 @@ navLink icon linkText url =
viewHeaderBar : String -> List (Html Msg) -> Navbar -> Html Msg
viewHeaderBar navbarTitle navbarLinks navbar =
nav [ class "navbar", class "is-transparent" ]
nav [ class "navbar container is-transparent is-spaced " ]
[ div [ class "navbar-brand" ]
[ a [ class "navbar-item", href "/" ]
[ renderIcon { icon = "fab fa-d-and-d", size = "medium", ratio = "2x" }
@@ -164,21 +162,21 @@ update msg model =
( UrlChanged url, from ) ->
-- Handle routing according to current page
case Route.fromUrl url of
Just (Route.Home Route.MerchantLoot) ->
Just Route.Merchant ->
let
( shopPage, cmd ) =
Page.gotoShop from
in
( model |> setPage shopPage, Cmd.map PageMsg cmd )
Just (Route.Home Route.PlayerLoot) ->
Just Route.Home ->
let
( shopPage, cmd ) =
Page.gotoHome from
in
( model |> setPage shopPage, Cmd.map PageMsg cmd )
Just (Route.Home Route.GroupLoot) ->
Just Route.GroupChest ->
let
( page, cmd ) =
Page.gotoGroupChest from