aboutsummaryrefslogtreecommitdiff
path: root/client/src/Component/Input.hs
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/Component/Input.hs')
-rw-r--r--client/src/Component/Input.hs20
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
]