diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 0283dab696..1cedc491e7 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -56,7 +56,7 @@ :after-load-async status-im.setup.hot-reload/reload :build-notify status-im.setup.hot-reload/build-notify :preloads [;; The official recommendation is to - ;; load the debugger preload first. + user flow-storm.api re-frisk-remote.preload status-im.setup.schema-preload diff --git a/src/quo/components/markdown/list/style.cljs b/src/quo/components/markdown/list/style.cljs index aa3f645902..132517fe17 100644 --- a/src/quo/components/markdown/list/style.cljs +++ b/src/quo/components/markdown/list/style.cljs @@ -2,11 +2,12 @@ (defn container [container-style] - (merge container-style - {:padding-vertical 7 - :padding-horizontal 20 - :flex-direction :row - :align-items :flex-start})) + (merge + {:padding-vertical 7 + :padding-horizontal 20 + :flex-direction :row + :align-items :flex-start} + container-style)) (def index {:margin-left 5}) diff --git a/src/quo/components/markdown/list/view.cljs b/src/quo/components/markdown/list/view.cljs index f823cd8b2b..bd854ae7fd 100644 --- a/src/quo/components/markdown/list/view.cljs +++ b/src/quo/components/markdown/list/view.cljs @@ -41,7 +41,7 @@ (defn view [{:keys [title description tag-picture tag-name description-after-tag step-number - customization-color type blur? container-style] + customization-color type blur? container-style icon icon-props] :or {type :bullet}}] (let [theme (quo.theme/use-theme)] [rn/view {:style (style/container container-style)} @@ -54,6 +54,8 @@ :type (if customization-color :complete :neutral)} step-number] :lock [icon/icon :i/locked {:color (get-colors theme blur?)}] + :custom-icon + [icon/icon icon icon-props] [icon/icon :i/bullet {:color (get-colors theme blur?)}])] [rn/view {:style style/text-container} (when title diff --git a/src/status_im/common/metrics_confirmation_modal/style.cljs b/src/status_im/common/metrics_confirmation_modal/style.cljs deleted file mode 100644 index d2a07b5e72..0000000000 --- a/src/status_im/common/metrics_confirmation_modal/style.cljs +++ /dev/null @@ -1,19 +0,0 @@ -(ns status-im.common.metrics-confirmation-modal.style) - -(def points-wrapper - {:margin-top 11 - :margin-horizontal 20 - :gap 21 - :margin-bottom 8}) - -(def item-text - {:margin-left -24}) - -(def info-text - {:margin-top -5}) - -(def privacy-policy - {:margin-top 4 - :margin-horizontal 20 - :margin-bottom 20 - :align-items :center}) diff --git a/src/status_im/common/metrics_confirmation_modal/view.cljs b/src/status_im/common/metrics_confirmation_modal/view.cljs deleted file mode 100644 index e24160114b..0000000000 --- a/src/status_im/common/metrics_confirmation_modal/view.cljs +++ /dev/null @@ -1,119 +0,0 @@ -(ns status-im.common.metrics-confirmation-modal.view - (:require - [quo.core :as quo] - [quo.foundations.colors :as colors] - [quo.theme] - [react-native.core :as rn] - [status-im.common.metrics-confirmation-modal.style :as style] - [status-im.common.privacy.view :as privacy] - [utils.i18n :as i18n] - [utils.re-frame :as rf])) - -(defn- dismiss-keyboard - [] - (rf/dispatch [:dismiss-keyboard])) - -(defn- hide-bottom-sheet - [] - (rf/dispatch [:hide-bottom-sheet])) - -(def ^:private will-receive-for-current-points - [:t/number-of-messages-sent - :t/connected-peers - :t/successful-messages-rate - :t/connection-type - :t/os-app-version-bandwidth]) - -(def ^:private will-receive-for-all-points - [:t/action-logs - :t/ip-addresses-uuid]) - -(def ^:private not-receive-points - [:t/your-profile-information - :t/your-addresses - :t/information-you-input-and-send]) - -(defn- bullet-points - [{:keys [title points lock?]}] - [rn/view - [quo/text {:weight :semi-bold} - title] - (for [label points] - ^{:key label} - [quo/markdown-list - {:description (i18n/label label) - :blur? true - :type (when lock? :lock) - :container-style style/item-text}])]) - -(defn- on-share-usage - [] - (rf/dispatch [:centralized-metrics/toggle-centralized-metrics true true]) - (hide-bottom-sheet)) - -(defn- on-do-not-share - [] - (rf/dispatch [:centralized-metrics/toggle-centralized-metrics false true]) - (hide-bottom-sheet)) - -(declare view) - -(defn- on-privacy-policy-press - [] - (rf/dispatch - [:show-bottom-sheet - {:content privacy/privacy-statement - :on-close (fn [] - (rf/dispatch [:show-bottom-sheet - {:content view - :theme :dark - :shell? true}])) - :theme :dark - :shell? true}])) - -(defn- privacy-policy-text - [] - [rn/view {:style style/privacy-policy} - [quo/text - [quo/text - {:style {:color colors/white-opa-50} - :size :paragraph-2} - (i18n/label :t/more-details-in-privacy-policy-1)] - [quo/text - {:size :paragraph-2 - :weight :bold - :on-press on-privacy-policy-press} - (i18n/label :t/more-details-in-privacy-policy-2)]]]) - -(defn view - [] - (rn/use-mount #(dismiss-keyboard)) - [:<> - [quo/drawer-top - {:title (i18n/label :t/help-us-improve-status) - :description (i18n/label :t/collecting-usage-data)}] - [rn/scroll-view - [rn/view {:style style/points-wrapper} - [bullet-points - {:title (i18n/label :t/we-will-receive-from-all-profiles) - :points will-receive-for-all-points}] - [bullet-points - {:title (i18n/label :t/we-will-receive-from-the-current-profile) - :points will-receive-for-current-points}] - [bullet-points - {:title (i18n/label :t/what-we-wont-receive) - :points not-receive-points - :lock? true}] - [quo/text - {:size :paragraph-2 - :style style/info-text} - (i18n/label :t/sharing-usage-data-can-be-turned-off)]]] - [quo/bottom-actions - {:actions :two-actions - :blur? true - :button-one-label (i18n/label :t/help-us-improve-status) - :button-one-props {:on-press on-share-usage} - :button-two-label (i18n/label :t/not-now) - :button-two-props {:type :grey - :on-press on-do-not-share}}] - [privacy-policy-text]]) diff --git a/src/status_im/common/resources.cljs b/src/status_im/common/resources.cljs index 6755665c79..2a22189f8d 100644 --- a/src/status_im/common/resources.cljs +++ b/src/status_im/common/resources.cljs @@ -6,6 +6,7 @@ :desktop-how-to-pair-sign-in (js/require "../resources/images/ui2/desktop-how-to-pair-sign-in.png") :desktop-how-to-pair-logged-in (js/require "../resources/images/ui2/desktop-how-to-pair-logged-in.png") + :apple (js/require "../resources/images/icons2/20x20/check-circle.png") :mobile-how-to-pair-sign-in (js/require "../resources/images/ui2/mobile-how-to-pair-sign-in.png") :mobile-how-to-pair-logged-in (js/require "../resources/images/ui2/mobile-how-to-pair-logged-in.png") :find-sync-code-desktop (js/require "../resources/images/ui2/find-sync-code-desktop.png") diff --git a/src/status_im/contexts/centralized_metrics/events.cljs b/src/status_im/contexts/centralized_metrics/events.cljs index ba05aca914..1d0c3caa10 100644 --- a/src/status_im/contexts/centralized_metrics/events.cljs +++ b/src/status_im/contexts/centralized_metrics/events.cljs @@ -30,25 +30,13 @@ (rf/reg-event-fx :centralized-metrics/toggle-centralized-metrics (fn [{:keys [db]} [enabled? onboarding?]] - {:fx [[:effects.centralized-metrics/toggle-metrics enabled?]] + {:fx [ + #_[:effects.centralized-metrics/toggle-metrics enabled?]] :db (-> db (assoc :centralized-metrics/user-confirmed? true) (assoc :centralized-metrics/enabled? enabled?) (assoc :centralized-metrics/onboarding-enabled? (and onboarding? enabled?)))})) -(rf/reg-event-fx :centralized-metrics/check-modal - (fn [{:keys [db]} [modal-view]] - (when-not (:centralized-metrics/user-confirmed? db) - {:fx [[:dispatch - [:show-bottom-sheet - {:content (fn [] [modal-view]) - ;; When in the profiles screen do biometric auth after the metrics sheet is dismissed - ;; https://github.com/status-im/status-mobile/issues/20932 - :on-close (when (= (:view-id db) :screen/profile.profiles) - #(rf/dispatch [:profile.login/login-with-biometric-if-available - (get-in db [:profile/login :key-uid])])) - :shell? true}]]]}))) - (rf/reg-fx :effects.centralized-metrics/track (fn [event] (native-module/add-centralized-metric event))) diff --git a/src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs b/src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs index 5266b03baa..1cb55c6cad 100644 --- a/src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs +++ b/src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs @@ -5,9 +5,9 @@ [react-native.core :as rn] [react-native.safe-area :as safe-area] [status-im.common.check-before-syncing.view :as check-before-syncing] - [status-im.common.metrics-confirmation-modal.view :as metrics-modal] [status-im.common.resources :as resources] [status-im.config :as config] + [status-im.common.events-helper :as events-helper] [status-im.contexts.onboarding.create-or-sync-profile.style :as style] [status-im.contexts.onboarding.getting-started-doc.view :as getting-started-doc] [utils.debounce :as debounce] @@ -120,18 +120,12 @@ #(rf/dispatch [:keycard.login/check-card])}]))}]]])) -(defn- navigate-back - [] - (rf/dispatch [:onboarding/overlay-dismiss]) - (rf/dispatch [:navigate-back])) - (defn- navigate-to-quo-preview [] (rf/dispatch [:navigate-to :quo-preview])) (defn- internal-view [sign-in-type] - (rn/use-mount #(rf/dispatch [:centralized-metrics/check-modal metrics-modal/view])) (let [{:keys [top]} (safe-area/get-insets)] [rn/view {:style style/content-container} [quo/page-nav @@ -139,7 +133,7 @@ :type :no-title :background :blur :icon-name :i/arrow-left - :on-press navigate-back + :on-press events-helper/navigate-back :right-side [{:icon-name :i/info :on-press getting-started-doc/show-as-bottom-sheet} (when config/quo-preview-enabled? diff --git a/src/status_im/contexts/onboarding/intro/view.cljs b/src/status_im/contexts/onboarding/intro/view.cljs index 5aa67a8164..c305e8a99a 100644 --- a/src/status_im/contexts/onboarding/intro/view.cljs +++ b/src/status_im/contexts/onboarding/intro/view.cljs @@ -52,13 +52,16 @@ [] (when-let [blur-show-fn @overlay/blur-show-fn-atom] (blur-show-fn)) - (rf/dispatch [:open-modal :screen/onboarding.sync-or-recover-profile])) + (rf/dispatch [:open-modal + :screen/onboarding.share-usage + {:next-screen :screen/onboarding.sync-or-recover-profile}])) (defn- create-profile [] (when-let [blur-show-fn @overlay/blur-show-fn-atom] (blur-show-fn)) - (rf/dispatch [:open-modal :screen/onboarding.new-to-status])) + (rf/dispatch [:open-modal :screen/onboarding.share-usage + {:next-screen :screen/onboarding.new-to-status}])) (defn view [] diff --git a/src/status_im/contexts/onboarding/share_usage/learn_more_sheet.cljs b/src/status_im/contexts/onboarding/share_usage/learn_more_sheet.cljs new file mode 100644 index 0000000000..030d38f4d5 --- /dev/null +++ b/src/status_im/contexts/onboarding/share_usage/learn_more_sheet.cljs @@ -0,0 +1,58 @@ +(ns status-im.contexts.onboarding.share-usage.learn-more-sheet + (:require + [quo.core :as quo] + [quo.foundations.colors :as colors] + [quo.theme] + [react-native.core :as rn] + [status-im.common.terms.view :as terms] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) + +(def ^:private bullet-points-data + [[:t/help-us-improve-status-bullet-point-1 true] + [:t/help-us-improve-status-bullet-point-2 true] + [:t/help-us-improve-status-bullet-point-3 false] + [:t/help-us-improve-status-bullet-point-4 false] + [:t/help-us-improve-status-bullet-point-5 false]]) + +(defn- privacy-policy-text + [] + [rn/view {:style {:margin-horizontal 20 :margin-vertical 8}} + [quo/text + [quo/text + {:style {:color colors/white-opa-50} + :size :paragraph-2} + (i18n/label :t/more-details-in-privacy-policy-1-onboarding)] + [quo/text + {:size :paragraph-2 + :weight :bold + :on-press #(rf/dispatch [:show-bottom-sheet {:content terms/terms-of-use :shell? true}])} + (i18n/label :t/more-details-in-privacy-policy-2)]]]) + +(defn- bullet-points + [] + [:<> + (for [[label collected?] bullet-points-data] + ^{:key label} + [quo/markdown-list + {:description (i18n/label label) + :blur? true + :type :custom-icon + :container-style {:padding-vertical 5} + :icon (if collected? :i/check-circle :i/clear) + :icon-props (if collected? + {:no-color true} + {:size 20 :color colors/danger-60 :color-2 colors/white})}])]) + +(defn view + [] + [:<> + [quo/drawer-top + {:title (i18n/label :t/help-us-improve-status)}] + [quo/text + {:size :paragraph-1 + :style {:padding-horizontal 20}} + (i18n/label :t/help-us-improve-status-subtitle)] + [rn/view {:style {:padding-vertical 8}} + [bullet-points]] + [privacy-policy-text]]) diff --git a/src/status_im/contexts/onboarding/share_usage/style.cljs b/src/status_im/contexts/onboarding/share_usage/style.cljs new file mode 100644 index 0000000000..c32258759f --- /dev/null +++ b/src/status_im/contexts/onboarding/share_usage/style.cljs @@ -0,0 +1,18 @@ +(ns status-im.contexts.onboarding.share-usage.style) + +(def title-container + {:margin-horizontal 20 + :padding-bottom 20 + :padding-top 12}) + +(defn page-illustration + [width] + {:flex 1 + :margin-top 12 + :margin-bottom 10 + :width width}) + +(defn buttons + [insets] + {:margin 20 + :margin-bottom (+ 12 (:bottom insets))}) diff --git a/src/status_im/contexts/onboarding/share_usage/view.cljs b/src/status_im/contexts/onboarding/share_usage/view.cljs new file mode 100644 index 0000000000..7406fa5744 --- /dev/null +++ b/src/status_im/contexts/onboarding/share_usage/view.cljs @@ -0,0 +1,60 @@ +(ns status-im.contexts.onboarding.share-usage.view + (:require + [quo.core :as quo] + [react-native.core :as rn] + [react-native.safe-area :as safe-area] + [status-im.common.events-helper :as events-helper] + [status-im.common.resources :as resources] + [status-im.contexts.onboarding.share-usage.learn-more-sheet :as learn-more-sheet] + [status-im.contexts.onboarding.share-usage.style :as style] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) + +(defn- share-usage-data-fn + [enabled? next-screen] + (rf/dispatch [:centralized-metrics/toggle-centralized-metrics enabled? true]) + (rf/dispatch [:navigate-to next-screen])) + +(defn view + [] + (let [insets (safe-area/get-insets) + next-screen (:next-screen (rf/sub [:get-screen-params :screen/onboarding.share-usage])) + share-usage-data (rn/use-callback #(share-usage-data-fn true next-screen)) + maybe-later (rn/use-callback #(share-usage-data-fn false next-screen)) + learn-more (rn/use-callback #(rf/dispatch [:show-bottom-sheet + {:content learn-more-sheet/view + :shell? true}]))] + [:<> + [quo/page-nav + {:margin-top (:top insets) + :background :blur + :icon-name :i/arrow-left + :on-press events-helper/navigate-back + :right-side [{:icon-left :i/info + :accessibility-label :learn-more + :label (i18n/label :t/learn-more) + :on-press learn-more}]}] + [quo/text-combinations + {:container-style style/title-container + :title (i18n/label :t/help-us-improve-status) + :title-accessibility-label :share-usage-title + :description (i18n/label :t/collecting-usage-data) + :description-accessibility-label :share-usage-subtitle}] + [rn/image + {:resize-mode :contain + :style (style/page-illustration (:width (rn/get-window))) + :source (resources/get-image :biometrics)}] + [rn/view {:style (style/buttons insets)} + [quo/button + {:size 40 + :accessibility-label :share-usage-data + :on-press share-usage-data} + (i18n/label :t/agree)] + [quo/button + {:size 40 + :accessibility-label :maybe-later-button + :background :blur + :type :grey + :on-press maybe-later + :container-style {:margin-top 12}} + (i18n/label :t/maybe-later)]]])) diff --git a/src/status_im/contexts/profile/events.cljs b/src/status_im/contexts/profile/events.cljs index af1e6c3a5d..79ebb3c939 100644 --- a/src/status_im/contexts/profile/events.cljs +++ b/src/status_im/contexts/profile/events.cljs @@ -84,7 +84,7 @@ {:db new-db :fx [[:dispatch [:profile/get-profiles-auth-method profiles-key-uids]] (if (profile.data-store/accepted-terms? accounts) - [:dispatch [:update-theme-and-init-root :screen/profile.profiles]] + [:dispatch [:update-theme-and-init-root :screen/onboarding.intro]] [:dispatch [:update-theme-and-init-root :screen/onboarding.intro]]) ;; dispatch-later makes sure that the logout button subscribed is always disabled [:dispatch-later diff --git a/src/status_im/contexts/profile/profiles/view.cljs b/src/status_im/contexts/profile/profiles/view.cljs index 393510555d..825e80c585 100644 --- a/src/status_im/contexts/profile/profiles/view.cljs +++ b/src/status_im/contexts/profile/profiles/view.cljs @@ -7,7 +7,6 @@ [react-native.reanimated :as reanimated] [react-native.safe-area :as safe-area] [status-im.common.confirmation-drawer.view :as confirmation-drawer] - [status-im.common.metrics-confirmation-modal.view :as metrics-modal] [status-im.common.standard-authentication.core :as standard-authentication] [status-im.config :as config] [status-im.constants :as constants] @@ -277,7 +276,6 @@ (defn view [] - (rn/use-mount #(rf/dispatch [:centralized-metrics/check-modal metrics-modal/view])) (let [[show-profiles? set-show-profiles] (rn/use-state true) show-profiles (rn/use-callback #(set-show-profiles true)) hide-profiles (rn/use-callback #(set-show-profiles false))] diff --git a/src/status_im/navigation/effects.cljs b/src/status_im/navigation/effects.cljs index b2fe251af2..e64867ebc0 100644 --- a/src/status_im/navigation/effects.cljs +++ b/src/status_im/navigation/effects.cljs @@ -77,17 +77,17 @@ (defn- navigate [[component theme animations]] (let [{:keys [options]} (get views/screens component) - options (if (map? animations) (assoc options :animations animations) options)] - (dismiss-all-modals) + options (if (map? animations) (assoc options :animations animations) options) + parent (or (first @state/modals) @state/root-id)] (navigation/push - (name @state/root-id) + (name parent) {:component {:id component :name component :options (merge (options/root-options {:theme (or (:theme options) theme)}) options)}}) (state/navigation-state-push {:id component :type :stack - :parent @state/root-id}))) + :parent parent}))) (rf/reg-fx :navigate-to navigate) diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index 17bff0b10a..a2412ca3ee 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -48,6 +48,7 @@ [status-im.contexts.onboarding.identifiers.view :as identifiers] [status-im.contexts.onboarding.intro.view :as intro] [status-im.contexts.onboarding.preparing-status.view :as preparing-status] + [status-im.contexts.onboarding.share-usage.view :as onboarding.share-usage] [status-im.contexts.onboarding.sign-in.view :as sign-in] [status-im.contexts.onboarding.syncing.progress.view :as syncing-devices] [status-im.contexts.onboarding.syncing.results.view :as syncing-results] @@ -733,16 +734,6 @@ :modalPresentationStyle :overCurrentContext} :component create-or-sync-profile/sync-or-recover-profile}) -(def onboarding-create-profile - {:name :screen/onboarding.create-profile - :metrics {:track? true - :alias-id :onboarding.create-profile-info} - :options {:theme :dark - :layout options/onboarding-transparent-layout - :animations transitions/push-animations-for-transparent-background - :popGesture false} - :component create-profile/create-profile}) - (def onboarding-create-profile-password {:name :screen/onboarding.create-profile-password :metrics {:track? true @@ -768,6 +759,28 @@ :popStackOnPress false}} :component enable-biometrics/view}) +(def onboarding-create-profile + {:name :screen/onboarding.create-profile + :metrics {:track? true + :alias-id :onboarding.create-profile-info} + :options {:theme :dark + :layout options/onboarding-transparent-layout + :animations transitions/push-animations-for-transparent-background + :popGesture false} + :component create-profile/create-profile}) + +(def onboarding-share-usage + {:name :screen/onboarding.share-usage + :metrics {:track? true} + :options {:theme :dark + :layout options/onboarding-transparent-layout + :animations (merge + transitions/new-to-status-modal-animations + transitions/push-animations-for-transparent-background) + :popGesture false + :modalPresentationStyle :overCurrentContext} + :component onboarding.share-usage/view}) + (def onboarding-preparing-status {:name :screen/onboarding.preparing-status :metrics {:track? true} @@ -872,6 +885,7 @@ onboarding-entering-seed-phrase onboarding-enable-notifications onboarding-identifiers + onboarding-share-usage onboarding-sign-in-intro onboarding-sign-in onboarding-syncing-progress diff --git a/translations/en.json b/translations/en.json index 3736ddbcd1..a7dea80366 100644 --- a/translations/en.json +++ b/translations/en.json @@ -107,6 +107,7 @@ "advertiser-starter-pack-description": "Here’s some crypto to get you started! Use it to get stickers, an ENS name and try dapps", "advertiser-starter-pack-title": "Starter Pack", "advertiser-title": "Privacy by default", + "agree": "Agree", "agree-by-continuing": "By continuing you agree\n to our ", "airdrop-addresses": "Address for airdrops", "album-images-count": "{{album-images-count}} photos", @@ -1147,6 +1148,12 @@ "help-center": "Help Center", "help-improve-status": "Help improve Status", "help-us-improve-status": "Help us improve Status", + "help-us-improve-status-bullet-point-1": "Collect basic usage data like taps and page views", + "help-us-improve-status-bullet-point-2": "Collect core diagnostics, like bandwidth usage", + "help-us-improve-status-bullet-point-3": "Never collect your profile information or wallet address", + "help-us-improve-status-bullet-point-4": "Never collect information you input or send", + "help-us-improve-status-bullet-point-5": "Never sell your usage analytics data", + "help-us-improve-status-subtitle": "We’ll collect anonymous analytics and diagnostics from your app to enhance Status’s quality and performance.", "here-is-a-cat-in-a-box-instead": "Here’s a cat in a box instead", "hex": "Hex", "hide": "Hide", @@ -1629,6 +1636,7 @@ "more": "more", "more-details": "More details", "more-details-in-privacy-policy-1": "For more details refer to our ", + "more-details-in-privacy-policy-1-onboarding": "For more details and other cases where we handle your data, refer to our ", "more-details-in-privacy-policy-2": "Privacy Policy", "more-details-in-privacy-policy-settings-1": "For details on this and other potential limited data processing by Status, see our ", "move-and-reset": "Move and Reset",