Small code reduction.
parent
b061c0b18e
commit
c2569bc959
|
@ -112,18 +112,20 @@ render { wsUp,
|
||||||
, render_register_form
|
, render_register_form
|
||||||
]
|
]
|
||||||
|
|
||||||
|
should_be_disabled = (if wsUp then (HP.enabled true) else (HP.disabled true))
|
||||||
|
|
||||||
render_auth_form = HH.form
|
render_auth_form = HH.form
|
||||||
[ HE.onSubmit AuthenticationAttempt ]
|
[ HE.onSubmit AuthenticationAttempt ]
|
||||||
[ Bulma.box_input "Login" "login" -- title, placeholder
|
[ Bulma.box_input "Login" "login" -- title, placeholder
|
||||||
(HandleAuthenticationInput <<< AUTH_INP_login) -- action
|
(HandleAuthenticationInput <<< AUTH_INP_login) -- action
|
||||||
authenticationForm.login -- value
|
authenticationForm.login -- value
|
||||||
true -- validity (TODO)
|
true -- validity (TODO)
|
||||||
(if wsUp then (HP.enabled true) else (HP.disabled true)) -- condition
|
should_be_disabled -- condition
|
||||||
, Bulma.box_password "Password" "password" -- title, placeholder
|
, Bulma.box_password "Password" "password" -- title, placeholder
|
||||||
(HandleAuthenticationInput <<< AUTH_INP_pass) -- action
|
(HandleAuthenticationInput <<< AUTH_INP_pass) -- action
|
||||||
authenticationForm.pass -- value
|
authenticationForm.pass -- value
|
||||||
true -- validity (TODO)
|
true -- validity (TODO)
|
||||||
(if wsUp then (HP.enabled true) else (HP.disabled true)) -- condition
|
should_be_disabled -- 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
|
||||||
|
@ -138,17 +140,17 @@ render { wsUp,
|
||||||
(HandleRegisterInput <<< REG_INP_login) -- action
|
(HandleRegisterInput <<< REG_INP_login) -- action
|
||||||
registrationForm.login -- value
|
registrationForm.login -- value
|
||||||
true -- validity (TODO)
|
true -- validity (TODO)
|
||||||
(if wsUp then (HP.enabled true) else (HP.disabled true)) -- condition
|
should_be_disabled -- condition
|
||||||
, Bulma.box_input "Email" "email@example.com" -- title, placeholder
|
, Bulma.box_input "Email" "email@example.com" -- title, placeholder
|
||||||
(HandleRegisterInput <<< REG_INP_email) -- action
|
(HandleRegisterInput <<< REG_INP_email) -- action
|
||||||
registrationForm.email -- value
|
registrationForm.email -- value
|
||||||
true -- validity (TODO)
|
true -- validity (TODO)
|
||||||
(if wsUp then (HP.enabled true) else (HP.disabled true)) -- condition
|
should_be_disabled -- condition
|
||||||
, Bulma.box_password "Password" "password" -- title, placeholder
|
, Bulma.box_password "Password" "password" -- title, placeholder
|
||||||
(HandleRegisterInput <<< REG_INP_pass) -- action
|
(HandleRegisterInput <<< REG_INP_pass) -- action
|
||||||
registrationForm.pass -- value
|
registrationForm.pass -- value
|
||||||
true -- validity (TODO)
|
true -- validity (TODO)
|
||||||
(if wsUp then (HP.enabled true) else (HP.disabled true)) -- condition
|
should_be_disabled -- condition
|
||||||
, HH.div_
|
, HH.div_
|
||||||
[ HH.button
|
[ HH.button
|
||||||
[ HP.style "padding: 0.5rem 1.25rem;"
|
[ HP.style "padding: 0.5rem 1.25rem;"
|
||||||
|
|
Loading…
Reference in New Issue