Skip to content

Commit b807a38

Browse files
committed
modify disclaimer component to improve tap ux
1 parent e0f61d4 commit b807a38

File tree

2 files changed

+20
-19
lines changed
  • src
    • quo2/components/selectors/disclaimer
    • status_im2/contexts/onboarding/create_password

2 files changed

+20
-19
lines changed

src/quo2/components/selectors/disclaimer/view.cljs

+16-13
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22
(:require [quo2.components.markdown.text :as text]
33
[quo2.components.selectors.disclaimer.style :as style]
44
[quo2.components.selectors.selectors.view :as selectors]
5-
[react-native.core :as rn]))
5+
[react-native.core :as rn]
6+
[reagent.core :as reagent]))
67

78
(defn view
8-
[{:keys [checked? blur? on-change accessibility-label container-style]} label]
9-
[rn/view
10-
{:style (merge container-style (style/container blur?))}
11-
[selectors/checkbox
12-
{:accessibility-label accessibility-label
13-
:blur? blur?
14-
:checked? checked?
15-
:on-change on-change}]
16-
[text/text
17-
{:size :paragraph-2
18-
:style style/text}
19-
label]])
9+
[{:keys [blur? accessibility-label container-style]} label]
10+
(let [checked? (reagent/atom false)]
11+
(fn []
12+
[rn/touchable-opacity {:on-press #(swap! checked? not)}
13+
[rn/view {:style (merge container-style (style/container blur?))}
14+
[selectors/checkbox
15+
{:accessibility-label accessibility-label
16+
:blur? blur?
17+
:checked? @checked?
18+
:on-change #(swap! checked? not)}]
19+
[text/text
20+
{:size :paragraph-2
21+
:style style/text}
22+
label]]])))

src/status_im2/contexts/onboarding/create_password/view.cljs

+4-6
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,10 @@
164164

165165
[rn/view {:style style/bottom-part}
166166
[rn/view {:style style/disclaimer-container}
167-
[rn/touchable-opacity {:on-press #(swap! accepts-disclaimer? not)}
168-
[quo/disclaimer
169-
{:blur? true
170-
:on-change #(reset! accepts-disclaimer? %)
171-
:checked? @accepts-disclaimer?}
172-
(i18n/label :t/password-creation-disclaimer)]]]
167+
[quo/disclaimer
168+
{:blur? true
169+
:checked? @accepts-disclaimer?}
170+
(i18n/label :t/password-creation-disclaimer)]]
173171

174172
(when (= @focused-input :password)
175173
[help

0 commit comments

Comments
 (0)