Authentication and registration forms: updated to new Bulma module.

master
Philippe Pittoli 2023-06-09 01:40:31 +02:00
parent 4d73afa642
commit b4bc1f8f77
1 changed files with 27 additions and 43 deletions

View File

@ -235,52 +235,38 @@ render {
authenticationForm.pass -- value authenticationForm.pass -- value
true -- validity (TODO) true -- validity (TODO)
(maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection) -- condition (maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection) -- condition
, HH.button , HH.button
[ HP.style "padding: 0.5rem 1.25rem;" [ HP.style "padding: 0.5rem 1.25rem;"
, HP.type_ HP.ButtonSubmit , HP.type_ HP.ButtonSubmit
, maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection , maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection
] ]
[ HH.text "Send Message to Server" ] [ HH.text "Send Message to Server" ]
] ]
render_register_form = HH.form render_register_form = HH.form
[ HE.onSubmit RegisterAttempt ] [ HE.onSubmit RegisterAttempt ]
[ HH.p_ [ Bulma.box_input "Login" "login" -- title, placeholder
[ HH.div_ (HandleRegisterInput <<< REG_INP_login) -- action
[ HH.input registrationForm.login -- value
[ inputCSS true -- validity (TODO)
, HP.type_ HP.InputText (maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection) -- condition
, HP.value registrationForm.login , Bulma.box_input "Email" "email@example.com" -- title, placeholder
, HE.onValueInput $ HandleRegisterInput <<< REG_INP_login (HandleRegisterInput <<< REG_INP_email) -- action
, maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection registrationForm.email -- value
] true -- validity (TODO)
] (maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection) -- condition
, HH.div_ , Bulma.box_password "Password" "password" -- title, placeholder
[ HH.input (HandleRegisterInput <<< REG_INP_pass) -- action
[ inputCSS registrationForm.pass -- value
, HP.type_ HP.InputText true -- validity (TODO)
, HP.value registrationForm.email (maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection) -- condition
, HE.onValueInput $ HandleRegisterInput <<< REG_INP_email , HH.div_
, maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection [ HH.button
] [ HP.style "padding: 0.5rem 1.25rem;"
] , HP.type_ HP.ButtonSubmit
, HH.div_ , maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection
[ HH.input
[ inputCSS
, HP.type_ HP.InputPassword
, HP.value registrationForm.pass
, HE.onValueInput $ HandleRegisterInput <<< REG_INP_pass
, maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection
]
]
, HH.div_
[ HH.button
[ HP.style "padding: 0.5rem 1.25rem;"
, HP.type_ HP.ButtonSubmit
, maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection
]
[ HH.text "Send Message to Server" ]
] ]
[ HH.text "Send Message to Server" ]
] ]
] ]
@ -541,8 +527,6 @@ foreignToArrayBuffer
renderForeignErrors = renderForeignErrors =
String.joinWith "; " <<< A.fromFoldable <<< map F.renderForeignError String.joinWith "; " <<< A.fromFoldable <<< map F.renderForeignError
inputCSS = HP.style "padding: 0.5rem 0.75rem; margin-bottom: 0.25rem;"
print_json_string :: forall m. MonadEffect m => MonadState State m => ArrayBuffer -> m Unit print_json_string :: forall m. MonadEffect m => MonadState State m => ArrayBuffer -> m Unit
print_json_string arraybuffer = do print_json_string arraybuffer = do
-- fromTypedIPC :: ArrayBuffer -> Effect (Either ParseError (Tuple UInt String)) -- fromTypedIPC :: ArrayBuffer -> Effect (Either ParseError (Tuple UInt String))