From 342ebdf61b3b9021b9e58cfce607e96a6e7ae54e Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Tue, 4 Jun 2024 09:28:10 +0200 Subject: refactor `Form` module --- frontend/app/Form/Input.hs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 frontend/app/Form/Input.hs (limited to 'frontend/app/Form/Input.hs') diff --git a/frontend/app/Form/Input.hs b/frontend/app/Form/Input.hs new file mode 100644 index 0000000..a9648c4 --- /dev/null +++ b/frontend/app/Form/Input.hs @@ -0,0 +1,26 @@ +module Form.Input + ( string, + ) +where + +import Data.Text qualified as T +import Form.Internal +import Miso +import Miso.String (toMisoString) + +string :: String -> Form T.Text T.Text +string label = + Form + { view = \i -> + [ div_ [] $ + [ label_ [] $ + [ text (toMisoString label), + input_ + [ type_ "text", + value_ (toMisoString i) + ] + ] + ] + ], + fill = \i -> Right i + } -- cgit v1.2.3