stabilizes Header and Player bars

This commit is contained in:
2019-11-02 00:42:04 +01:00
parent 1a23eb4c31
commit b5a50bd039
2 changed files with 61 additions and 24 deletions

View File

@@ -292,7 +292,15 @@ viewHeaderBar model =
, div [ class "navbar-menu is-active" ]
[ div [class "navbar-end"]
[ a [class "navbar-item", href "/marchand"] [text "Marchand"]
, a [class "navbar-item", href "/coffre"] [text "Coffre de groupe"]
, a
[ class "navbar-item"
, href (if model.player.id == 0
then
"/nouveau-tresor"
else
"/coffre")
]
[text (if model.player.id == 0 then "Nouveau loot" else "Coffre de groupe")]
]
]
@@ -321,15 +329,18 @@ viewPlayerBar player route =
, div [class "level-right"] (viewPlayerAction player route)
]
actionButton t = button [ class "button" ] [ text t ]
actionButton t n c = button [ class ("button is-rounded is-" ++ c) ]
[ span [ class "icon" ] [ i [ class ("fas fa-" ++ n) ] [] ]
, span [] [ text t ]
]
viewPlayerAction : Player -> Route -> List (Html Msg)
viewPlayerAction player route =
case route of
PlayerChest -> [actionButton "Vendre" ]
GroupLoot -> [actionButton "Demander" ]
Merchant -> [actionButton "Acheter" ]
NewLoot -> [actionButton "Valider" ]
PlayerChest -> [actionButton "Vendre" "coins" "danger"]
GroupLoot -> [actionButton "Demander" "coins" "primary"]
Merchant -> [actionButton "Acheter" "coins" "success"]
NewLoot -> [actionButton "Valider" "coins" "primary", actionButton "Annuler" "coins" "danger"]
showWealth : Wealth -> List (Html Msg)