diff --git a/src/status_im/contexts/keycard/authorise/view.cljs b/src/status_im/contexts/keycard/authorise/view.cljs new file mode 100644 index 0000000000..8c91198f9f --- /dev/null +++ b/src/status_im/contexts/keycard/authorise/view.cljs @@ -0,0 +1,35 @@ +(ns status-im.contexts.keycard.authorise.view + (:require [quo.core :as quo] + [react-native.core :as rn] + [status-im.common.events-helper :as events-helper] + [status-im.common.standard-authentication.core :as standard-auth] + [utils.i18n :as i18n] + [utils.re-frame :as rf] + [utils.security.core :as security])) + +(defn view + [] + (let [profile-name (rf/sub [:profile/name]) + profile-picture (rf/sub [:profile/image]) + customization-color (rf/sub [:profile/customization-color])] + [:<> + [quo/page-nav + {:key :header + :background :blur + :icon-name :i/close + :on-press events-helper/navigate-back}] + [quo/page-top + {:title (i18n/label :t/authorise-with-password) + :description :context-tag + :context-tag {:full-name profile-name + :profile-picture profile-picture + :customization-color customization-color}}] + [rn/view {:style {:flex 1 :padding-horizontal 20 :justify-content :space-between}} + [quo/text (i18n/label :t/migrate-key-pair-authorise)] + [standard-auth/slide-button + {:size :size-48 + :container-style {} + :customization-color customization-color + :track-text (i18n/label :t/slide-to-authorise) + :on-auth-success #(println "TBD" (security/safe-unmask-data %)) + :auth-button-label (i18n/label :t/confirm)}]]])) diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index ce5a29881f..9f7b24a47a 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -26,6 +26,7 @@ [status-im.contexts.communities.actions.share-community.view :as share-community] [status-im.contexts.communities.discover.view :as communities.discover] [status-im.contexts.communities.overview.view :as communities.overview] + [status-im.contexts.keycard.authorise.view :as keycard.authorise] [status-im.contexts.keycard.check.view :as keycard.check] [status-im.contexts.keycard.empty.view :as keycard.empty] [status-im.contexts.keycard.error.view :as keycard.error] @@ -697,7 +698,11 @@ {:name :screen/keycard.not-keycard :options options/keycard-modal-screen-options - :component keycard.not-keycard/view}] + :component keycard.not-keycard/view} + + {:name :screen/keycard.authorise + :options options/keycard-modal-screen-options + :component keycard.authorise/view}] [{:name :shell :options {:theme :dark}}] diff --git a/translations/en.json b/translations/en.json index 8ea1f62657..45098668cb 100644 --- a/translations/en.json +++ b/translations/en.json @@ -163,6 +163,7 @@ "audio-recorder-max-ms-reached": "Maximum recording time reached", "audio-recorder-permissions-error": "You have to give permission to send audio messages", "aug": "Aug", + "authorise-with-password": "Authorise with password", "authorize": "Authorize", "available": "Available", "available-participants": { @@ -1568,6 +1569,7 @@ "messages-from-contacts-only-subtitle": "Only people you added as contacts can start a new chat with you or invite you to a group", "messages-gap-warning": "Some messages might be missing", "might-break": "Might break some ÐApps", + "migrate-key-pair-authorise": "To migrate profile key pair to Keycard you need to authorise with profile password.", "migrate-key-pair-keycard": "Migrate profile key pair to Keycard", "migrate-key-pair-keycard-default-key": "{{name}} is your default Status key pair. Migrating this key pair to Keycard will require you to use your Keycard to login to Status and to transact with the key pair’s derived accounts on all synced devices.\n\nKey pair will be removed from device and stored on Keycard.", "migrate-key-pair-keycard-info": "Re-encrypting your data with your new Keycard login method may take some time, during which you won’t be able to use the app.", @@ -2340,6 +2342,7 @@ "signing-phrase": "Signing phrase", "simple": "Simple", "skip": "Skip", + "slide-to-authorise": "Slide to authorise", "slide-to-bridge": "Slide to bridge", "slide-to-create-account": "Slide to create account", "slide-to-import": "Slide to import",