From 4f9e38930e1e2dc16aeedec20f5dd2f8cabf1899 Mon Sep 17 00:00:00 2001 From: andrey Date: Mon, 1 Mar 2021 12:12:09 +0100 Subject: [PATCH] Revert "[#11395] Inapp Keycard upsell MVP" This reverts commit 99e99b0e --- src/status_im/init/core.cljs | 4 +-- src/status_im/multiaccounts/login/core.cljs | 20 +---------- src/status_im/subs.cljs | 1 - .../multiaccounts/key_storage/views.cljs | 35 +++++++++---------- .../ui/screens/multiaccounts/login/views.cljs | 5 ++- translations/en.json | 2 +- 6 files changed, 21 insertions(+), 46 deletions(-) diff --git a/src/status_im/init/core.cljs b/src/status_im/init/core.cljs index f4df0527d9..daee384c12 100644 --- a/src/status_im/init/core.cljs +++ b/src/status_im/init/core.cljs @@ -60,9 +60,7 @@ (fx/merge cofx {:get-supported-biometric-auth nil ::init-theme nil - ::open-multiaccounts #(do - (re-frame/dispatch [::initialize-multiaccounts % {:logout? false}]) - (re-frame/dispatch [:get-keycard-banner-preference])) + ::open-multiaccounts #(re-frame/dispatch [::initialize-multiaccounts % {:logout? false}]) :ui/listen-to-window-dimensions-change nil ::network/listen-to-network-info nil :keycard/register-card-events nil diff --git a/src/status_im/multiaccounts/login/core.cljs b/src/status_im/multiaccounts/login/core.cljs index 04346a5ecd..1e2744ab59 100644 --- a/src/status_im/multiaccounts/login/core.cljs +++ b/src/status_im/multiaccounts/login/core.cljs @@ -30,8 +30,7 @@ [status-im.acquisition.core :as acquisition] [taoensso.timbre :as log] [status-im.data-store.invitations :as data-store.invitations] - [status-im.chat.models.link-preview :as link-preview] - [status-im.async-storage.core :as async-storage])) + [status-im.chat.models.link-preview :as link-preview])) (re-frame/reg-fx ::login @@ -494,20 +493,3 @@ (dissoc :intro-wizard) (update :keycard dissoc :application-info))} (open-login (select-keys multiaccount [:key-uid :name :public-key :identicon :images]))))) - -(fx/defn hide-keycard-banner - {:events [:hide-keycard-banner]} - [{:keys [db]}] - {:db (assoc db :keycard/banner-hidden true) - ::async-storage/set! {:keycard-banner-hidden true}}) - -(fx/defn get-keycard-banner-preference-cb - {:events [:get-keycard-banner-preference-cb]} - [{:keys [db]} {:keys [keycard-banner-hidden]}] - {:db (assoc db :keycard/banner-hidden keycard-banner-hidden)}) - -(fx/defn get-keycard-banner-preference - {:events [:get-keycard-banner-preference]} - [_] - {::async-storage/get {:keys [:keycard-banner-hidden] - :cb #(re-frame/dispatch [:get-keycard-banner-preference-cb %])}}) diff --git a/src/status_im/subs.cljs b/src/status_im/subs.cljs index c00d604d35..f6129ea6e9 100644 --- a/src/status_im/subs.cljs +++ b/src/status_im/subs.cljs @@ -200,7 +200,6 @@ ;; keycard (reg-root-key-sub :keycard/new-account-sheet? :keycard/new-account-sheet?) -(reg-root-key-sub :keycard/banner-hidden :keycard/banner-hidden) ;; delete profile (reg-root-key-sub :delete-profile/error :delete-profile/error) diff --git a/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs b/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs index d16f406db7..fefa218317 100644 --- a/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs +++ b/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs @@ -139,28 +139,25 @@ :height 16}]]]) (defn keycard-upsell-banner [] - [react/view {:background-color (if (= :dark @colors/theme) "#2C5955" "#DDF8F4") - :border-radius 16 :padding-left 12 :padding-right 50 :margin 16} - [react/touchable-highlight {:on-press #(.openURL ^js react/linking "https://get-keycard.status.im/")} - [react/view {:padding-vertical 8 - :flex-direction :row} + [react/touchable-highlight {:on-press #(.openURL ^js react/linking "https://get-keycard.status.im/")} + [react/view {:background-color (if (= :dark @colors/theme) "#2C5955" "#DDF8F4") + :border-radius 16 + :margin 16 + :padding-horizontal 12 + :padding-vertical 8 + :flex-direction :row} + [react/view [react/image {:source (resources/get-theme-image :keycard) :resize-mode :contain :style {:width 48 - :height 48}}] - [react/view {:flex 1 - :margin-left 12} - [react/text {:style {:font-size 20 - :font-weight "700"}} - (i18n/label :t/get-a-keycard)] - [react/text {:style {:color (colors/alpha colors/text 0.8)}} - (i18n/label :t/keycard-upsell-subtitle)]]]] - [react/touchable-highlight - {:style {:position :absolute :right 0 :top 0 - :align-items :center :justify-content :center :margin 2} - :on-press #(re-frame/dispatch [:hide-keycard-banner]) - :accessibility-label :hide-home-button} - [icons/icon :main-icons/close-circle {:color colors/gray}]]]) + :height 48}}]] + [react/view {:flex 1 + :margin-left 12} + [react/text {:style {:font-size 20 + :font-weight "700"}} + (i18n/label :t/get-a-keycard)] + [react/text {:style {:color (colors/alpha colors/text 0.8)}} + (i18n/label :t/keycard-upsell-subtitle)]]]]) (defview storage [] (letsubs diff --git a/src/status_im/ui/screens/multiaccounts/login/views.cljs b/src/status_im/ui/screens/multiaccounts/login/views.cljs index 7205d526d5..41d7cfcd35 100644 --- a/src/status_im/ui/screens/multiaccounts/login/views.cljs +++ b/src/status_im/ui/screens/multiaccounts/login/views.cljs @@ -45,8 +45,7 @@ auth-method [:auth-method] view-id [:view-id] supported-biometric-auth [:supported-biometric-auth] - keycard? [:keycard-multiaccount?] - banner-hidden [:keycard/banner-hidden]] + keycard? [:keycard-multiaccount?]] [react/keyboard-avoiding-view {:style ast/multiaccounts-view} [topbar/topbar {:border-bottom false :right-accessories [{:icon :more @@ -99,7 +98,7 @@ [react/view styles/processing-view [react/activity-indicator {:animating true}] [react/i18n-text {:style styles/processing :key :processing}]] - (when-not (or keycard? banner-hidden) + (when-not keycard? [key-storage/keycard-upsell-banner])) [toolbar/toolbar diff --git a/translations/en.json b/translations/en.json index ce2bf717d6..01db8ee022 100644 --- a/translations/en.json +++ b/translations/en.json @@ -1440,7 +1440,7 @@ "choose-storage": "Choose storage", "choose-new-location-for-keystore": "Choose a new location to save your keystore file", "get-a-keycard": "Get a Keycard", - "keycard-upsell-subtitle": "Enhanced security and convenience", + "keycard-upsell-subtitle": "Your portable, easy to use hardware wallet", "actions": "Actions", "move-keystore-file": "Move keystore file", "select-new-location-for-keys": "Select a new location to save your private key(s)",