many styling tweaks, adds sourceName field

This commit is contained in:
2019-12-07 16:28:40 +01:00
parent ff375b6052
commit 903fdd816d
11 changed files with 294 additions and 150 deletions

View File

@@ -1,6 +1,7 @@
module Wealth exposing (Model, Msg(..), editValue, init, update, view)
import Api.Player exposing (Wealth)
import Bulma as B
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
@@ -22,13 +23,22 @@ view wealth model =
:: (case model of
View ->
viewWealth wealth
++ [ div [ class "level-item button is-small is-dark" ]
[ span
[ class "icon is-small"
, onClick StartEdit
]
[ i [ class "fas fa-tools" ] [] ]
]
]
Edit amount ->
viewUpdateWealth amount
)
++ [ div [ class "level-item" ]
[ span [ class "icon", onClick StartEdit ] [ i [ class "fas fa-tools" ] [] ] ]
]
inBarButton =
class "button is-small is-outlined "
viewUpdateWealth amount =
@@ -40,12 +50,26 @@ viewUpdateWealth amount =
, ( "is-success", isValid amount )
]
, value amount
, placeholder "En pièces d'or..."
, style "width" "8em"
, onInput AmountChanged
]
[]
, button [ class "level-item button", onClick ConfirmEdit ] [ text "Ok" ]
, button
[ inBarButton
, class "level-item is-primary"
, onClick ConfirmEdit
]
[ B.icon
{ icon =
if isValid amount then
"fas fa-check"
else
"fas fa-times"
, ratio = Nothing
, size = Nothing
}
]
]