From b4bc1f8f77eeb3a58461c59b343b0f7f80d30b1d Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Fri, 9 Jun 2023 01:40:31 +0200 Subject: [PATCH] Authentication and registration forms: updated to new Bulma module. --- src/App/AuthenticationForm.purs | 70 +++++++++++++-------------------- 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/src/App/AuthenticationForm.purs b/src/App/AuthenticationForm.purs index 2d463e1..ad4ec3e 100644 --- a/src/App/AuthenticationForm.purs +++ b/src/App/AuthenticationForm.purs @@ -235,52 +235,38 @@ render { authenticationForm.pass -- value true -- validity (TODO) (maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection) -- condition - , 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.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" ] ] render_register_form = HH.form [ HE.onSubmit RegisterAttempt ] - [ HH.p_ - [ HH.div_ - [ HH.input - [ inputCSS - , HP.type_ HP.InputText - , HP.value registrationForm.login - , HE.onValueInput $ HandleRegisterInput <<< REG_INP_login - , maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection - ] - ] - , HH.div_ - [ HH.input - [ inputCSS - , HP.type_ HP.InputText - , HP.value registrationForm.email - , HE.onValueInput $ HandleRegisterInput <<< REG_INP_email - , maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection - ] - ] - , HH.div_ - [ 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" ] + [ Bulma.box_input "Login" "login" -- title, placeholder + (HandleRegisterInput <<< REG_INP_login) -- action + registrationForm.login -- value + true -- validity (TODO) + (maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection) -- condition + , Bulma.box_input "Email" "email@example.com" -- title, placeholder + (HandleRegisterInput <<< REG_INP_email) -- action + registrationForm.email -- value + true -- validity (TODO) + (maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection) -- condition + , Bulma.box_password "Password" "password" -- title, placeholder + (HandleRegisterInput <<< REG_INP_pass) -- action + registrationForm.pass -- value + true -- validity (TODO) + (maybe (HP.disabled true) (\_ -> HP.enabled true) wsConnection) -- condition + , 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" ] ] ] @@ -541,8 +527,6 @@ foreignToArrayBuffer renderForeignErrors = 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 arraybuffer = do -- fromTypedIPC :: ArrayBuffer -> Effect (Either ParseError (Tuple UInt String))