aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Dialog/AddPaymentButton
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/elm/Dialog/AddPaymentButton')
-rw-r--r--src/client/elm/Dialog/AddPaymentButton/View.elm22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/client/elm/Dialog/AddPaymentButton/View.elm b/src/client/elm/Dialog/AddPaymentButton/View.elm
index 5da380c..16616fe 100644
--- a/src/client/elm/Dialog/AddPaymentButton/View.elm
+++ b/src/client/elm/Dialog/AddPaymentButton/View.elm
@@ -13,6 +13,10 @@ import Form.Field as Field exposing (Field)
import Utils.Form as Form
import Dialog
+import Dialog.Model as DialogModel
+import Dialog.Msg as DialogMsg
+
+import Tooltip
import View.Form as Form
import View.Events exposing (onSubmitPrevDefault)
@@ -25,14 +29,11 @@ import Model.Translations exposing (getMessage)
import Model.Payment as Payment exposing (Frequency(..))
import Model.View exposing (View(LoggedInView))
-import Dialog.Model as DialogModel
-import Dialog.Msg as DialogMsg
-
import LoggedData exposing (LoggedData)
import LoggedIn.Home.Model as HomeModel
-view : LoggedData -> List (String, Field) -> String -> Html Msg -> Html Msg
-view loggedData initialForm title buttonContent =
+view : LoggedData -> List (String, Field) -> String -> Html Msg -> Maybe String -> Html Msg
+view loggedData initialForm title buttonContent tooltip =
let dialogConfig =
{ className = "paymentDialog"
, title = getMessage title loggedData.translations
@@ -42,9 +43,14 @@ view loggedData initialForm title buttonContent =
, undo = getMessage "Undo" loggedData.translations
}
in button
- [ class "addPayment"
- , onClick (Msg.Dialog <| Dialog.OpenWithUpdate dialogConfig (DialogMsg.AddPaymentMsg <| Form.Reset initialForm))
- ]
+ ( ( case tooltip of
+ Just message -> Tooltip.show Msg.Tooltip message
+ Nothing -> []
+ )
+ ++ [ class "addPayment"
+ , onClick (Msg.Dialog <| Dialog.OpenWithUpdate dialogConfig (DialogMsg.AddPaymentMsg <| Form.Reset initialForm))
+ ]
+ )
[ buttonContent ]
addPaymentForm : LoggedData -> Form String DialogModel.AddPayment -> Html Msg