blob: a1be16d004c8eb54a78fbb168fae24259fc33b91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
module View.Payment.Delete
( view
, DeleteIn(..)
, DeleteOut(..)
) where
import Reflex.Dom (Event, MonadWidget)
import qualified Reflex.Dom as R
import qualified Common.Msg as Msg
import Component (ButtonIn (..), ButtonOut (..))
import qualified Component as Component
-- import qualified Util.Ajax as Ajax
-- import qualified Util.WaitFor as Util
data DeleteIn = DeleteIn
{}
data DeleteOut t = DeleteOut
{ _deleteOut_cancel :: Event t ()
}
view :: forall t m. MonadWidget t m => DeleteIn -> m (DeleteOut t)
view _ =
R.divClass "delete" $ do
R.divClass "deleteHeader" $ R.text $ Msg.get Msg.Payment_DeleteConfirm
R.divClass "deleteContent" $ do
cancel <- R.divClass "buttons" $ do
rec
_ <- Component._buttonOut_clic <$> (Component.button $
(Component.defaultButtonIn (R.text $ Msg.get Msg.Dialog_Confirm))
{ _buttonIn_class = R.constDyn "confirm"
, _buttonIn_submit = True
})
-- (_, waiting) <- Util.waitFor
-- (Ajax.post "/payment")
-- validate
-- payment
cancel <- Component._buttonOut_clic <$> (Component.button $
(Component.defaultButtonIn (R.text $ Msg.get Msg.Dialog_Undo))
{ _buttonIn_class = R.constDyn "undo" })
return cancel
return DeleteOut
{ _deleteOut_cancel = cancel
}
|