diff options
Diffstat (limited to 'src/client/View/Payments/Add.elm')
-rw-r--r-- | src/client/View/Payments/Add.elm | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/client/View/Payments/Add.elm b/src/client/View/Payments/Add.elm new file mode 100644 index 0000000..f2230be --- /dev/null +++ b/src/client/View/Payments/Add.elm @@ -0,0 +1,34 @@ +module View.Payments.Add + ( addPayment + ) where + +import Html exposing (..) +import Html.Attributes exposing (..) +import Html.Events exposing (..) + +import ServerCommunication as SC +import ServerCommunication exposing (serverCommunications) + +import Update exposing (..) +import Update.Payment exposing (..) + +addPayment : String -> String -> Html +addPayment name cost = + div + [ class "add" ] + [ text "Name" + , input + [ value name + , on "input" targetValue (Signal.message actions.address << UpdatePayment << UpdateName) + ] + [] + , text "Cost" + , input + [ value cost + , on "input" targetValue (Signal.message actions.address << UpdatePayment << UpdateCost) + ] + [] + , button + [ onClick serverCommunications.address (SC.AddPayment name cost) ] + [ text "Add" ] + ] |