File tree 3 files changed +20
-22
lines changed
quo2/components/selectors/disclaimer
status_im2/contexts/onboarding/create_password
3 files changed +20
-22
lines changed Original file line number Diff line number Diff line change 12
12
(h/render [disclaimer/view {} text])
13
13
(h/is-truthy (h/get-by-text text))))
14
14
15
- (h/test " On change event gets fire after press"
16
- (let [mock-fn (h/mock-fn )]
17
- (h/render [disclaimer/view {:on-change mock-fn} " test" ])
18
- (h/fire-event :press (h/get-by-label-text :checkbox-off ))
19
- (h/was-called mock-fn)))
20
-
21
15
(h/describe " It's rendered according to its `checked?` property"
22
16
(h/test " checked? true"
23
17
(h/render [disclaimer/view {:checked? true } " test" ])
Original file line number Diff line number Diff line change 2
2
(:require [quo2.components.markdown.text :as text]
3
3
[quo2.components.selectors.disclaimer.style :as style]
4
4
[quo2.components.selectors.selectors.view :as selectors]
5
- [react-native.core :as rn]))
5
+ [react-native.core :as rn]
6
+ [reagent.core :as reagent]))
6
7
7
8
(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 [checked? blur? accessibility-label container-style]} label]
10
+ (let [checked-state? (reagent/atom (or checked? false ))]
11
+ (fn []
12
+ [rn/touchable-opacity
13
+ {:on-press #(swap! checked-state? not)
14
+ :accessibility-label " disclaimer-touchable-opacity" }
15
+ [rn/view {:style (merge container-style (style/container blur?))}
16
+ [selectors/checkbox
17
+ {:accessibility-label accessibility-label
18
+ :blur? blur?
19
+ :checked? @checked-state?
20
+ :on-change #(swap! checked-state? not)}]
21
+ [text/text
22
+ {:size :paragraph-2
23
+ :style style/text}
24
+ label]]])))
Original file line number Diff line number Diff line change 165
165
[rn/view {:style style/bottom-part}
166
166
[rn/view {:style style/disclaimer-container}
167
167
[quo/disclaimer
168
- {:blur? true
169
- :on-change #(reset! accepts-disclaimer? %)
170
- :checked? @accepts-disclaimer?}
168
+ {:blur? true
169
+ :checked? @accepts-disclaimer?}
171
170
(i18n/label :t/password-creation-disclaimer )]]
172
171
173
172
(when (= @focused-input :password )
You can’t perform that action at this time.
0 commit comments