mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 21:09:00 -05:00
🐛 Fix accept privacy terms checkbox
This commit is contained in:
parent
258969f342
commit
3f23953f83
2 changed files with 5 additions and 3 deletions
|
@ -253,6 +253,7 @@
|
||||||
[:& fm/input {:name :accept-terms-and-privacy
|
[:& fm/input {:name :accept-terms-and-privacy
|
||||||
:class "check-primary"
|
:class "check-primary"
|
||||||
:type "checkbox"
|
:type "checkbox"
|
||||||
|
:default-checked false
|
||||||
:label terms-label}]]))
|
:label terms-label}]]))
|
||||||
|
|
||||||
[:> fm/submit-button*
|
[:> fm/submit-button*
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
input-name (get props :name)
|
input-name (get props :name)
|
||||||
more-classes (get props :class)
|
more-classes (get props :class)
|
||||||
auto-focus? (get props :auto-focus? false)
|
auto-focus? (get props :auto-focus? false)
|
||||||
placeholder (or placeholder label)
|
|
||||||
|
|
||||||
form (or form (mf/use-ctx form-ctx))
|
form (or form (mf/use-ctx form-ctx))
|
||||||
|
|
||||||
|
@ -43,6 +42,7 @@
|
||||||
is-text? (or (= @type' "password")
|
is-text? (or (= @type' "password")
|
||||||
(= @type' "text")
|
(= @type' "text")
|
||||||
(= @type' "email"))
|
(= @type' "email"))
|
||||||
|
placeholder (when is-text? (or placeholder label))
|
||||||
|
|
||||||
touched? (get-in @form [:touched input-name])
|
touched? (get-in @form [:touched input-name])
|
||||||
error (get-in @form [:errors input-name])
|
error (get-in @form [:errors input-name])
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
(swap! form assoc-in [:touched input-name] true)))
|
(swap! form assoc-in [:touched input-name] true)))
|
||||||
|
|
||||||
props (-> props
|
props (-> props
|
||||||
(dissoc :help-icon :form :trim :children :show-success? :auto-focus?)
|
(dissoc :help-icon :form :trim :children :show-success? :auto-focus? :label)
|
||||||
(assoc :id (name input-name)
|
(assoc :id (name input-name)
|
||||||
:value value
|
:value value
|
||||||
:auto-focus auto-focus?
|
:auto-focus auto-focus?
|
||||||
|
@ -103,6 +103,7 @@
|
||||||
"aria-describedby" (dm/str "error-" input-name)))
|
"aria-describedby" (dm/str "error-" input-name)))
|
||||||
(obj/clj->props))
|
(obj/clj->props))
|
||||||
|
|
||||||
|
checked? (and is-checkbox? (= value true))
|
||||||
show-valid? (and show-success? touched? (not error))
|
show-valid? (and show-success? touched? (not error))
|
||||||
show-invalid? (and touched? error)]
|
show-invalid? (and touched? error)]
|
||||||
|
|
||||||
|
@ -124,7 +125,7 @@
|
||||||
:for (name input-name)} label
|
:for (name input-name)} label
|
||||||
|
|
||||||
(when is-checkbox?
|
(when is-checkbox?
|
||||||
[:span {:class (stl/css-case :global/checked value)} i/status-tick-refactor])
|
[:span {:class (stl/css-case :global/checked checked?)} (when checked? i/status-tick-refactor)])
|
||||||
|
|
||||||
(if is-checkbox?
|
(if is-checkbox?
|
||||||
[:> :input props]
|
[:> :input props]
|
||||||
|
|
Loading…
Add table
Reference in a new issue