Skip to content

Commit 8c089bb

Browse files
authored
Fix keycard theme issue and add documentation for ready to add key pair screen (#22028)
1 parent 45b0960 commit 8c089bb

File tree

19 files changed

+100
-47
lines changed

19 files changed

+100
-47
lines changed

src/quo/components/drawers/documentation_drawers/style.cljs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
(def content
1515
{:align-items :flex-start
16-
:margin-top 8
1716
:margin-bottom (+ (safe-area/get-bottom) 12)})
1817

1918
(defn title
2019
[theme]
21-
{:color (colors/theme-colors colors/neutral-100
22-
colors/white
23-
theme)})
20+
{:color (colors/theme-colors colors/neutral-100
21+
colors/white
22+
theme)
23+
:margin-bottom 8})

src/quo/components/drawers/documentation_drawers/view.cljs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@
2424
:always-bounce-vertical false
2525
:content-inset-adjustment-behavior :never}
2626
[rn/view {:style style/container}
27-
[text/text
28-
{:size :heading-2
29-
:accessibility-label :documentation-drawer-title
30-
:style (style/title theme)
31-
:weight :semi-bold}
32-
title]
27+
(when title
28+
[text/text
29+
{:size :heading-2
30+
:accessibility-label :documentation-drawer-title
31+
:style (style/title theme)
32+
:weight :semi-bold}
33+
title])
3334
[rn/view {:style style/content :accessibility-label :documentation-drawer-content}
3435
content
3536
(when show-button?

src/status_im/contexts/keycard/backup/events.cljs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
(fn [_]
2929
{:fx [[:dispatch
3030
[:keycard/connect
31-
{:on-error
31+
{:theme :dark
32+
:on-error
3233
(fn [error]
3334
(if (= error :keycard/error.keycard-blank)
3435
(rf/dispatch [:keycard/backup.generate-and-load-key])
@@ -48,7 +49,8 @@
4849
(fn [_]
4950
{:fx [[:dispatch
5051
[:keycard/connect
51-
{:on-error
52+
{:theme :dark
53+
:on-error
5254
(fn [error]
5355
(if (= error :keycard/error.keycard-blank)
5456
(do
@@ -73,7 +75,8 @@
7375
[pin]
7476
(rf/dispatch
7577
[:keycard/connect
76-
{:on-error
78+
{:theme :dark
79+
:on-error
7780
(fn [error]
7881
(if (= error :keycard/error.keycard-blank)
7982
(rf/dispatch
@@ -89,7 +92,8 @@
8992
[pin]
9093
(rf/dispatch
9194
[:keycard/connect
92-
{:on-error
95+
{:theme :dark
96+
:on-error
9397
(fn [error]
9498
(if (= error :keycard/error.keycard-blank)
9599
(rf/dispatch

src/status_im/contexts/keycard/change_pin/events.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@
6868
unmasked-new-pin (security/safe-unmask-data new-pin)]
6969
{:fx [[:dispatch
7070
[:keycard/connect
71-
{:key-uid (get-in db [:profile/profile :key-uid])
71+
{:theme :dark
72+
:key-uid (get-in db [:profile/profile :key-uid])
7273
:on-success #(verify-pin-and-continue unmasked-current-pin unmasked-new-pin)}]]]})))

src/status_im/contexts/keycard/check/events.cljs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
{:fx [[:dispatch
88
[:keycard/connect
99
{:key-uid (get-in db [:profile/profile :key-uid])
10+
:theme :dark
1011
:on-success
1112
(fn []
1213
(rf/dispatch [:keycard/disconnect])

src/status_im/contexts/keycard/check/view.cljs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
:right-side [{:icon-name :i/info
3737
:on-press #(rf/dispatch [:show-bottom-sheet
3838
{:content keycard-documentation
39+
:theme :dark
3940
:shell? true}])}]}]
4041
[quo/page-top
4142
{:title (i18n/label :t/check-keycard)

src/status_im/contexts/keycard/create/events.cljs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
(fn [_]
88
{:fx [[:dispatch
99
[:keycard/connect
10-
{:on-error
10+
{:theme :dark
11+
:on-error
1112
(fn [error]
1213
(if (= error :keycard/error.keycard-blank)
1314
(do
@@ -18,8 +19,10 @@
1819
(defn- backup-recovery-phrase-success
1920
[masked-seed-phrase]
2021
(rf/dispatch [:navigate-back])
21-
(rf/dispatch [:open-modal :screen/confirm-backup
22+
(rf/dispatch [:open-modal :screen/confirm-backup-dark
2223
{:masked-seed-phrase masked-seed-phrase
24+
:theme :dark
25+
:shell? true
2326
:on-try-again #(rf/dispatch [:open-modal :screen/backup-recovery-phrase-dark
2427
{:on-success backup-recovery-phrase-success
2528
:masked-seed-phrase (->> masked-seed-phrase
@@ -81,7 +84,8 @@
8184
(fn [_]
8285
{:fx [[:dispatch
8386
[:keycard/connect
84-
{:on-error #(rf/dispatch [:keycard/create.on-application-info-error %])}]]]}))
87+
{:theme :dark
88+
:on-error #(rf/dispatch [:keycard/create.on-application-info-error %])}]]]}))
8589

8690
(defn get-application-info-and-continue
8791
[]

src/status_im/contexts/keycard/create/view.cljs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
(:require [quo.core :as quo]
33
[react-native.core :as rn]
44
[status-im.common.events-helper :as events-helper]
5-
[status-im.common.not-implemented :as not-implemented]
65
[status-im.common.resources :as resources]
7-
[status-im.config :as config]
86
[status-im.constants :as constants]
97
[status-im.contexts.keycard.common.view :as common.view]
108
[utils.i18n :as i18n]
@@ -40,15 +38,24 @@
4038
[rn/view {:style {:flex 1}}]
4139
[common.view/tips]])
4240

41+
(defn- ready-to-add-documentation
42+
[]
43+
[quo/documentation-drawers
44+
{:shell? true}
45+
[quo/text {:size :paragraph-2}
46+
(i18n/label :t/ready-add-keypair-keycard-documentation)]])
47+
4348
(defn ready-to-add
4449
[]
4550
[:<>
4651
[quo/page-nav
4752
{:icon-name :i/close
4853
:on-press events-helper/navigate-back
49-
:right-side [(when config/show-not-implemented-features?
50-
{:icon-name :i/info
51-
:on-press not-implemented/alert})]}]
54+
:right-side [{:icon-name :i/info
55+
:on-press #(rf/dispatch [:show-bottom-sheet
56+
{:content ready-to-add-documentation
57+
:theme :dark
58+
:shell? true}])}]}]
5259
[quo/page-top
5360
{:title (i18n/label :t/ready-add-keypair-keycard)
5461
:description :text

src/status_im/contexts/keycard/error/view.cljs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,6 @@
6060
:description-props {:text (i18n/label :t/remove-keycard-content)}
6161
:on-press (fn []
6262
(rf/dispatch [:show-bottom-sheet
63-
{:content factory-reset/sheet}]))}])]]))
63+
{:theme :dark
64+
:shell? true
65+
:content factory-reset/sheet}]))}])]]))

src/status_im/contexts/keycard/events.cljs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@
9090
(fn [_ [{:keys [pin derivation-path key-uid account-preferences]}]]
9191
{:fx [[:dispatch
9292
[:keycard/connect
93-
{:key-uid key-uid
93+
{:theme :dark
94+
:key-uid key-uid
9495
:on-success
9596
(fn []
9697
(rf/dispatch
@@ -160,7 +161,7 @@
160161
:keycard/error.not-keycard]))))}}))
161162

162163
(rf/reg-event-fx :keycard/connect
163-
(fn [{:keys [db]} [{:keys [key-uid on-success on-error on-connect-event-vector]}]]
164+
(fn [{:keys [db]} [{:keys [key-uid on-success on-error on-connect-event-vector theme]}]]
164165
(let [event-vector
165166
(or on-connect-event-vector
166167
[:keycard/get-application-info
@@ -170,6 +171,7 @@
170171
{:db (assoc-in db [:keycard :on-card-connected-event-vector] event-vector)
171172
:fx [[:dispatch
172173
[:keycard/show-connection-sheet
173-
{:on-cancel-event-vector [:keycard/cancel-connection]}]]
174+
{:on-cancel-event-vector [:keycard/cancel-connection]
175+
:theme theme}]]
174176
(when (get-in db [:keycard :card-connected?])
175177
[:dispatch event-vector])]})))

0 commit comments

Comments
 (0)