mirror of
https://github.com/status-im/status-react.git
synced 2025-02-21 07:08:44 +00:00
Fix keycard theme issue and add documentation for ready to add key pair screen (#22028)
This commit is contained in:
parent
45b09603d2
commit
8c089bb334
@ -13,11 +13,11 @@
|
||||
|
||||
(def content
|
||||
{:align-items :flex-start
|
||||
:margin-top 8
|
||||
:margin-bottom (+ (safe-area/get-bottom) 12)})
|
||||
|
||||
(defn title
|
||||
[theme]
|
||||
{:color (colors/theme-colors colors/neutral-100
|
||||
colors/white
|
||||
theme)})
|
||||
{:color (colors/theme-colors colors/neutral-100
|
||||
colors/white
|
||||
theme)
|
||||
:margin-bottom 8})
|
||||
|
@ -24,12 +24,13 @@
|
||||
:always-bounce-vertical false
|
||||
:content-inset-adjustment-behavior :never}
|
||||
[rn/view {:style style/container}
|
||||
[text/text
|
||||
{:size :heading-2
|
||||
:accessibility-label :documentation-drawer-title
|
||||
:style (style/title theme)
|
||||
:weight :semi-bold}
|
||||
title]
|
||||
(when title
|
||||
[text/text
|
||||
{:size :heading-2
|
||||
:accessibility-label :documentation-drawer-title
|
||||
:style (style/title theme)
|
||||
:weight :semi-bold}
|
||||
title])
|
||||
[rn/view {:style style/content :accessibility-label :documentation-drawer-content}
|
||||
content
|
||||
(when show-button?
|
||||
|
@ -28,7 +28,8 @@
|
||||
(fn [_]
|
||||
{:fx [[:dispatch
|
||||
[:keycard/connect
|
||||
{:on-error
|
||||
{:theme :dark
|
||||
:on-error
|
||||
(fn [error]
|
||||
(if (= error :keycard/error.keycard-blank)
|
||||
(rf/dispatch [:keycard/backup.generate-and-load-key])
|
||||
@ -48,7 +49,8 @@
|
||||
(fn [_]
|
||||
{:fx [[:dispatch
|
||||
[:keycard/connect
|
||||
{:on-error
|
||||
{:theme :dark
|
||||
:on-error
|
||||
(fn [error]
|
||||
(if (= error :keycard/error.keycard-blank)
|
||||
(do
|
||||
@ -73,7 +75,8 @@
|
||||
[pin]
|
||||
(rf/dispatch
|
||||
[:keycard/connect
|
||||
{:on-error
|
||||
{:theme :dark
|
||||
:on-error
|
||||
(fn [error]
|
||||
(if (= error :keycard/error.keycard-blank)
|
||||
(rf/dispatch
|
||||
@ -89,7 +92,8 @@
|
||||
[pin]
|
||||
(rf/dispatch
|
||||
[:keycard/connect
|
||||
{:on-error
|
||||
{:theme :dark
|
||||
:on-error
|
||||
(fn [error]
|
||||
(if (= error :keycard/error.keycard-blank)
|
||||
(rf/dispatch
|
||||
|
@ -68,5 +68,6 @@
|
||||
unmasked-new-pin (security/safe-unmask-data new-pin)]
|
||||
{:fx [[:dispatch
|
||||
[:keycard/connect
|
||||
{:key-uid (get-in db [:profile/profile :key-uid])
|
||||
{:theme :dark
|
||||
:key-uid (get-in db [:profile/profile :key-uid])
|
||||
:on-success #(verify-pin-and-continue unmasked-current-pin unmasked-new-pin)}]]]})))
|
||||
|
@ -7,6 +7,7 @@
|
||||
{:fx [[:dispatch
|
||||
[:keycard/connect
|
||||
{:key-uid (get-in db [:profile/profile :key-uid])
|
||||
:theme :dark
|
||||
:on-success
|
||||
(fn []
|
||||
(rf/dispatch [:keycard/disconnect])
|
||||
|
@ -36,6 +36,7 @@
|
||||
:right-side [{:icon-name :i/info
|
||||
:on-press #(rf/dispatch [:show-bottom-sheet
|
||||
{:content keycard-documentation
|
||||
:theme :dark
|
||||
:shell? true}])}]}]
|
||||
[quo/page-top
|
||||
{:title (i18n/label :t/check-keycard)
|
||||
|
@ -7,7 +7,8 @@
|
||||
(fn [_]
|
||||
{:fx [[:dispatch
|
||||
[:keycard/connect
|
||||
{:on-error
|
||||
{:theme :dark
|
||||
:on-error
|
||||
(fn [error]
|
||||
(if (= error :keycard/error.keycard-blank)
|
||||
(do
|
||||
@ -18,8 +19,10 @@
|
||||
(defn- backup-recovery-phrase-success
|
||||
[masked-seed-phrase]
|
||||
(rf/dispatch [:navigate-back])
|
||||
(rf/dispatch [:open-modal :screen/confirm-backup
|
||||
(rf/dispatch [:open-modal :screen/confirm-backup-dark
|
||||
{:masked-seed-phrase masked-seed-phrase
|
||||
:theme :dark
|
||||
:shell? true
|
||||
:on-try-again #(rf/dispatch [:open-modal :screen/backup-recovery-phrase-dark
|
||||
{:on-success backup-recovery-phrase-success
|
||||
:masked-seed-phrase (->> masked-seed-phrase
|
||||
@ -81,7 +84,8 @@
|
||||
(fn [_]
|
||||
{:fx [[:dispatch
|
||||
[:keycard/connect
|
||||
{:on-error #(rf/dispatch [:keycard/create.on-application-info-error %])}]]]}))
|
||||
{:theme :dark
|
||||
:on-error #(rf/dispatch [:keycard/create.on-application-info-error %])}]]]}))
|
||||
|
||||
(defn get-application-info-and-continue
|
||||
[]
|
||||
|
@ -2,9 +2,7 @@
|
||||
(:require [quo.core :as quo]
|
||||
[react-native.core :as rn]
|
||||
[status-im.common.events-helper :as events-helper]
|
||||
[status-im.common.not-implemented :as not-implemented]
|
||||
[status-im.common.resources :as resources]
|
||||
[status-im.config :as config]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.contexts.keycard.common.view :as common.view]
|
||||
[utils.i18n :as i18n]
|
||||
@ -40,15 +38,24 @@
|
||||
[rn/view {:style {:flex 1}}]
|
||||
[common.view/tips]])
|
||||
|
||||
(defn- ready-to-add-documentation
|
||||
[]
|
||||
[quo/documentation-drawers
|
||||
{:shell? true}
|
||||
[quo/text {:size :paragraph-2}
|
||||
(i18n/label :t/ready-add-keypair-keycard-documentation)]])
|
||||
|
||||
(defn ready-to-add
|
||||
[]
|
||||
[:<>
|
||||
[quo/page-nav
|
||||
{:icon-name :i/close
|
||||
:on-press events-helper/navigate-back
|
||||
:right-side [(when config/show-not-implemented-features?
|
||||
{:icon-name :i/info
|
||||
:on-press not-implemented/alert})]}]
|
||||
:right-side [{:icon-name :i/info
|
||||
:on-press #(rf/dispatch [:show-bottom-sheet
|
||||
{:content ready-to-add-documentation
|
||||
:theme :dark
|
||||
:shell? true}])}]}]
|
||||
[quo/page-top
|
||||
{:title (i18n/label :t/ready-add-keypair-keycard)
|
||||
:description :text
|
||||
|
@ -60,4 +60,6 @@
|
||||
:description-props {:text (i18n/label :t/remove-keycard-content)}
|
||||
:on-press (fn []
|
||||
(rf/dispatch [:show-bottom-sheet
|
||||
{:content factory-reset/sheet}]))}])]]))
|
||||
{:theme :dark
|
||||
:shell? true
|
||||
:content factory-reset/sheet}]))}])]]))
|
||||
|
@ -90,7 +90,8 @@
|
||||
(fn [_ [{:keys [pin derivation-path key-uid account-preferences]}]]
|
||||
{:fx [[:dispatch
|
||||
[:keycard/connect
|
||||
{:key-uid key-uid
|
||||
{:theme :dark
|
||||
:key-uid key-uid
|
||||
:on-success
|
||||
(fn []
|
||||
(rf/dispatch
|
||||
@ -160,7 +161,7 @@
|
||||
:keycard/error.not-keycard]))))}}))
|
||||
|
||||
(rf/reg-event-fx :keycard/connect
|
||||
(fn [{:keys [db]} [{:keys [key-uid on-success on-error on-connect-event-vector]}]]
|
||||
(fn [{:keys [db]} [{:keys [key-uid on-success on-error on-connect-event-vector theme]}]]
|
||||
(let [event-vector
|
||||
(or on-connect-event-vector
|
||||
[:keycard/get-application-info
|
||||
@ -170,6 +171,7 @@
|
||||
{:db (assoc-in db [:keycard :on-card-connected-event-vector] event-vector)
|
||||
:fx [[:dispatch
|
||||
[:keycard/show-connection-sheet
|
||||
{:on-cancel-event-vector [:keycard/cancel-connection]}]]
|
||||
{:on-cancel-event-vector [:keycard/cancel-connection]
|
||||
:theme theme}]]
|
||||
(when (get-in db [:keycard :card-connected?])
|
||||
[:dispatch event-vector])]})))
|
||||
|
@ -22,7 +22,8 @@
|
||||
[key-uid]
|
||||
(rf/dispatch
|
||||
[:keycard/connect
|
||||
{:key-uid key-uid
|
||||
{:theme :dark
|
||||
:key-uid key-uid
|
||||
:on-success reset-card
|
||||
:on-error (fn [error]
|
||||
(if (or (= error :keycard/error.keycard-frozen)
|
||||
|
@ -43,7 +43,8 @@
|
||||
(fn []
|
||||
{:fx [[:dispatch
|
||||
[:keycard/connect
|
||||
{:on-error
|
||||
{:theme :dark
|
||||
:on-error
|
||||
(fn [error]
|
||||
(if (= error :keycard/error.keycard-wrong-profile)
|
||||
(do
|
||||
@ -57,7 +58,8 @@
|
||||
(fn [{:keys [db]} [pin]]
|
||||
{:fx [[:dispatch
|
||||
[:keycard/connect
|
||||
{:key-uid (get-in db [:keycard :application-info :key-uid])
|
||||
{:theme :dark
|
||||
:key-uid (get-in db [:keycard :application-info :key-uid])
|
||||
:on-success (fn []
|
||||
(rf/dispatch
|
||||
[:keycard/get-more-keys
|
||||
|
@ -40,7 +40,9 @@
|
||||
:description-props {:text (i18n/label :t/change-pin-keycard-description)}
|
||||
:on-press (fn []
|
||||
(rf/dispatch [:show-bottom-sheet
|
||||
{:content change-pin.view/change-pin-confirmation-sheet}]))}]
|
||||
{:theme :dark
|
||||
:shell? true
|
||||
:content change-pin.view/change-pin-confirmation-sheet}]))}]
|
||||
[quo/settings-item
|
||||
{:title (i18n/label :t/backup-keycard)
|
||||
:image :icon
|
||||
@ -50,4 +52,7 @@
|
||||
:description :text
|
||||
:description-props {:text (i18n/label :t/create-backup-profile-keycard)}
|
||||
:on-press (fn []
|
||||
(rf/dispatch [:show-bottom-sheet {:content backup-sheet}]))}]]]))
|
||||
(rf/dispatch [:show-bottom-sheet
|
||||
{:theme :dark
|
||||
:shell? true
|
||||
:content backup-sheet}]))}]]]))
|
||||
|
@ -46,6 +46,7 @@
|
||||
[:keycard/connect
|
||||
{:key-uid (get-in db [:profile/profile :key-uid])
|
||||
:on-success #(rf/dispatch [:keycard/migration.continue])
|
||||
:theme :dark
|
||||
:on-error
|
||||
(fn [error]
|
||||
(if (= error :keycard/error.keycard-blank)
|
||||
@ -55,8 +56,10 @@
|
||||
(defn- backup-recovery-phrase-success
|
||||
[masked-seed-phrase]
|
||||
(rf/dispatch [:navigate-back])
|
||||
(rf/dispatch [:open-modal :screen/confirm-backup
|
||||
(rf/dispatch [:open-modal :screen/confirm-backup-dark
|
||||
{:masked-seed-phrase masked-seed-phrase
|
||||
:theme :dark
|
||||
:shell? true
|
||||
:on-try-again #(rf/dispatch [:open-modal :screen/backup-recovery-phrase-dark
|
||||
{:on-success backup-recovery-phrase-success
|
||||
:masked-seed-phrase (->> masked-seed-phrase
|
||||
|
@ -3,11 +3,12 @@
|
||||
[react-native.platform :as platform]))
|
||||
|
||||
(rf/reg-event-fx :keycard/show-connection-sheet
|
||||
(fn [{:keys [db]} [{:keys [on-cancel-event-vector]} :as args]]
|
||||
(fn [{:keys [db]} [{:keys [on-cancel-event-vector theme]} :as args]]
|
||||
(if platform/android?
|
||||
{:db (assoc-in db
|
||||
[:keycard :connection-sheet-opts]
|
||||
{:on-close #(rf/dispatch on-cancel-event-vector)})
|
||||
{:on-close #(rf/dispatch on-cancel-event-vector)
|
||||
:theme theme})
|
||||
:fx [[:effects.keycard.ios/start-nfc nil]
|
||||
[:dismiss-keyboard true]
|
||||
[:show-nfc-sheet nil]]}
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
(defn connect-keycard
|
||||
[]
|
||||
(let [connected? (rf/sub [:keycard/connected?])
|
||||
{:keys [on-close]} (rf/sub [:keycard/connection-sheet-opts])
|
||||
theme (quo.theme/use-theme)]
|
||||
(let [connected? (rf/sub [:keycard/connected?])
|
||||
{:keys [on-close theme]} (rf/sub [:keycard/connection-sheet-opts])
|
||||
theme (or theme (quo.theme/use-theme))]
|
||||
[rn/view {:flex 1}
|
||||
[rn/view {:flex 1}]
|
||||
[rn/view
|
||||
|
@ -92,15 +92,16 @@
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [random-indices (random-selection)
|
||||
quiz-index (reagent/atom 0)
|
||||
incorrect-count (reagent/atom 0)
|
||||
show-error? (reagent/atom false)
|
||||
(let [random-indices (random-selection)
|
||||
quiz-index (reagent/atom 0)
|
||||
incorrect-count (reagent/atom 0)
|
||||
show-error? (reagent/atom false)
|
||||
{:keys [on-success
|
||||
on-try-again
|
||||
masked-seed-phrase]} (rf/sub [:get-screen-params])
|
||||
unmasked-seed-phrase (security/safe-unmask-data masked-seed-phrase)
|
||||
random-phrase (reagent/atom [])]
|
||||
masked-seed-phrase
|
||||
theme shell?]} (rf/sub [:get-screen-params])
|
||||
unmasked-seed-phrase (security/safe-unmask-data masked-seed-phrase)
|
||||
random-phrase (reagent/atom [])]
|
||||
(fn []
|
||||
(rn/use-mount
|
||||
(fn []
|
||||
@ -119,12 +120,16 @@
|
||||
(reset! show-error? false)
|
||||
(when (and on-success (= @quiz-index questions-count))
|
||||
(rf/dispatch [:show-bottom-sheet
|
||||
{:content (fn [] [complete-backup-sheet
|
||||
{:theme theme
|
||||
:shell? shell?
|
||||
:content (fn [] [complete-backup-sheet
|
||||
on-success])}])))
|
||||
(do
|
||||
(when (> @incorrect-count 0)
|
||||
(rf/dispatch [:show-bottom-sheet
|
||||
{:content (fn []
|
||||
{:theme theme
|
||||
:shell? shell?
|
||||
:content (fn []
|
||||
[cheat-warning
|
||||
on-try-again])}]))
|
||||
(reset! incorrect-count (inc @incorrect-count))
|
||||
|
@ -925,6 +925,7 @@
|
||||
{:name :screen/keycard.empty-create
|
||||
:metrics {:track? true}
|
||||
:options {:insets {:top? true :bottom? true}
|
||||
:theme :dark
|
||||
:modalPresentationStyle :fullScreen}
|
||||
:component keycard.empty/create}
|
||||
|
||||
@ -1024,30 +1025,35 @@
|
||||
{:name :screen/keycard.create-profile
|
||||
:metrics {:track? true}
|
||||
:options {:insets {:top? true :bottom? true}
|
||||
:theme :dark
|
||||
:modalPresentationStyle :fullScreen}
|
||||
:component keycard.create/view}
|
||||
|
||||
{:name :screen/keycard.create.ready-to-add
|
||||
:metrics {:track? true}
|
||||
:options {:insets {:top? true :bottom? true}
|
||||
:theme :dark
|
||||
:modalPresentationStyle :fullScreen}
|
||||
:component keycard.create/ready-to-add}
|
||||
|
||||
{:name :screen/keycard.ready-to-change-pin
|
||||
:metrics {:track? true}
|
||||
:options {:insets {:top? true :bottom? true}
|
||||
:theme :dark
|
||||
:modalPresentationStyle :fullScreen}
|
||||
:component keycard.change-pin/ready-to-change-pin}
|
||||
|
||||
{:name :screen/keycard.pin-change-success
|
||||
:metrics {:track? true}
|
||||
:options {:insets {:top? true :bottom? true}
|
||||
:theme :dark
|
||||
:modalPresentationStyle :fullScreen}
|
||||
:component keycard.change-pin/pin-change-success}
|
||||
|
||||
{:name :screen/keycard.pin-change-failed
|
||||
:metrics {:track? true}
|
||||
:options {:insets {:top? true :bottom? true}
|
||||
:theme :dark
|
||||
:modalPresentationStyle :fullScreen}
|
||||
:component keycard.change-pin/pin-change-failed}
|
||||
|
||||
@ -1169,6 +1175,12 @@
|
||||
:insets {:top? true :bottom? true}}
|
||||
:component backup-recovery-phrase/view}
|
||||
|
||||
{:name :screen/confirm-backup-dark
|
||||
:metrics {:track? true}
|
||||
:options {:insets {:top? true :bottom? true}
|
||||
:theme :dark}
|
||||
:component wallet-confirm-backup/view}
|
||||
|
||||
{:name :screen/use-recovery-phrase
|
||||
:metrics {:track? true}
|
||||
:component enter-seed-phrase/view}
|
||||
|
@ -2131,6 +2131,7 @@
|
||||
"read": "Read",
|
||||
"read-more": "Read more",
|
||||
"ready-add-keypair-keycard": "Ready to add key pair to Keycard",
|
||||
"ready-add-keypair-keycard-documentation": "When you create a Status profile, the Status app generates cryptographic keys for your profile authentication and authorization.\n\nYour Keycard stores the cryptographic keys for your Status profile, permanently offline and isolated from the internet, and also secures your Wallet accounts.",
|
||||
"ready-keycard": "Get your Keycard ready",
|
||||
"ready-to-change-pin": "Ready to change PIN",
|
||||
"ready-to-migrate-key-pair": "Ready to migrate profile key pair to the Keycard",
|
||||
|
Loading…
x
Reference in New Issue
Block a user