diff options
author | Joris | 2018-10-30 18:04:58 +0100 |
---|---|---|
committer | Joris | 2018-10-30 18:04:58 +0100 |
commit | 50fb8fa48d1c4881da20b4ecf6d68a772301e713 (patch) | |
tree | 99c30c644d40664a9a7bb4a27e838d7cccda7a5f /client/src/Component/Input.hs | |
parent | 40b4994797a797b1fa86cafda789a5c488730c6d (diff) |
Update table when adding or removing a payment
Diffstat (limited to 'client/src/Component/Input.hs')
-rw-r--r-- | client/src/Component/Input.hs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/client/src/Component/Input.hs b/client/src/Component/Input.hs index c1eb4e8..57018a6 100644 --- a/client/src/Component/Input.hs +++ b/client/src/Component/Input.hs @@ -16,18 +16,16 @@ import Component.Button (ButtonIn (..), ButtonOut (..)) import qualified Component.Button as Button import qualified Icon -data InputIn t a b = InputIn - { _inputIn_reset :: Event t a - , _inputIn_hasResetButton :: Bool +data InputIn = InputIn + { _inputIn_hasResetButton :: Bool , _inputIn_label :: Text , _inputIn_initialValue :: Text , _inputIn_inputType :: Text } -defaultInputIn :: (Reflex t) => InputIn t a b +defaultInputIn :: InputIn defaultInputIn = InputIn - { _inputIn_reset = R.never - , _inputIn_hasResetButton = True + { _inputIn_hasResetButton = True , _inputIn_label = "" , _inputIn_initialValue = "" , _inputIn_inputType = "text" @@ -38,12 +36,16 @@ data InputOut t = InputOut , _inputOut_enter :: Event t () } -input :: forall t m a b. MonadWidget t m => InputIn t a b -> m (InputOut t) -input inputIn = +input + :: forall t m a b. MonadWidget t m + => InputIn + -> Event t a -- reset + -> m (InputOut t) +input inputIn reset = R.divClass "textInput" $ do rec let resetValue = R.leftmost - [ fmap (const "") (_inputIn_reset inputIn) + [ fmap (const "") reset , fmap (const "") resetClic ] |