diff options
author | Joris | 2021-01-03 13:40:40 +0100 |
---|---|---|
committer | Joris | 2021-01-03 13:54:20 +0100 |
commit | 11052951b74b9ad4b6a9412ae490086235f9154b (patch) | |
tree | 64526ac926c1bf470ea113f6cac8a33158684e8d /client/src/Component/ConfirmDialog.hs | |
parent | 371449b0e312a03162b78797b83dee9d81706669 (diff) |
Rewrite in Rust
Diffstat (limited to 'client/src/Component/ConfirmDialog.hs')
-rw-r--r-- | client/src/Component/ConfirmDialog.hs | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/client/src/Component/ConfirmDialog.hs b/client/src/Component/ConfirmDialog.hs deleted file mode 100644 index cf26593..0000000 --- a/client/src/Component/ConfirmDialog.hs +++ /dev/null @@ -1,49 +0,0 @@ -module Component.ConfirmDialog - ( In(..) - , view - ) where - -import Data.Text (Text) -import Reflex.Dom (Event, MonadWidget) -import qualified Reflex.Dom as R - -import qualified Common.Msg as Msg -import qualified Component.Button as Button -import qualified Component.Modal as Modal -import qualified Util.Either as EitherUtil -import qualified Util.WaitFor as WaitFor - -data In t m = In - { _in_header :: Text - , _in_confirm :: Event t () -> m (Event t ()) - } - -view :: forall t m a. MonadWidget t m => (In t m) -> Modal.Content t m -view input _ = - R.divClass "confirm" $ do - R.divClass "confirmHeader" $ - R.text $ _in_header input - - R.divClass "confirmContent" $ do - (confirm, cancel) <- R.divClass "buttons" $ do - - cancel <- Button._out_clic <$> (Button.view $ - (Button.defaultIn (R.text $ Msg.get Msg.Dialog_Undo)) - { Button._in_class = R.constDyn "undo" }) - - rec - confirm <- Button._out_clic <$> (Button.view $ - (Button.defaultIn (R.text $ Msg.get Msg.Dialog_Confirm)) - { Button._in_class = R.constDyn "confirm" - , Button._in_submit = True - , Button._in_waiting = waiting - }) - - (result, waiting) <- WaitFor.waitFor (_in_confirm input) confirm - - return (result, cancel) - - return $ - ( R.leftmost [ cancel, () <$ confirm ] - , confirm - ) |