diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 584d9b3061..a4f0694da2 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/status_im/contexts/onboarding/intro/view.cljs b/src/status_im/contexts/onboarding/intro/view.cljs index 5aa67a8164..e0cf898d71 100644 --- a/src/status_im/contexts/onboarding/intro/view.cljs +++ b/src/status_im/contexts/onboarding/intro/view.cljs @@ -52,13 +52,13 @@ [] (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/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..d9e80bdec7 --- /dev/null +++ b/src/status_im/contexts/onboarding/share_usage/view.cljs @@ -0,0 +1,55 @@ +(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.biometric.utils :as biometric] + [status-im.common.events-helper :as events-helper] + [status-im.common.resources :as resources] + [status-im.common.terms.view :as terms] + [status-im.contexts.onboarding.enable-biometrics.style :as style] + [status-im.navigation.state :as state] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) + +(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 #(rf/dispatch [:onboarding/share-usage-data true next-screen])) + maybe-later (rn/use-callback #(rf/dispatch [:onboarding/share-usage-data false next-screen])) + learn-more (rn/use-callback #(rf/dispatch [:show-bottom-sheet {:content terms/terms-of-use :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/share-usage-data)] + [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 b35e224f28..7d827e3479 100644 --- a/src/status_im/contexts/profile/events.cljs +++ b/src/status_im/contexts/profile/events.cljs @@ -56,7 +56,7 @@ key-uid (update :profile/login #(select-profile % key-uid)))] {:db new-db - :fx (if (profile.data-store/accepted-terms? accounts) + :fx (if (and false (profile.data-store/accepted-terms? accounts)) [[:dispatch [:update-theme-and-init-root :screen/profile.profiles]] (when (and key-uid userConfirmed) [:effects.biometric/check-if-available diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index 9d3d494bbb..6dbe679754 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -45,6 +45,7 @@ [status-im.contexts.onboarding.create-profile.view :as create-profile] [status-im.contexts.onboarding.enable-biometrics.view :as enable-biometrics] [status-im.contexts.onboarding.enable-notifications.view :as enable-notifications] + [status-im.contexts.onboarding.share-usage.view :as onboarding.share-usage] [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] @@ -726,16 +727,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 @@ -761,6 +752,25 @@ :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 transitions/push-animations-for-transparent-background + :popGesture false} + :component onboarding.share-usage/view}) + (def onboarding-preparing-status {:name :screen/onboarding.preparing-status :metrics {:track? true} @@ -865,6 +875,7 @@ onboarding-entering-seed-phrase onboarding-enable-notifications onboarding-identifiers + onboarding-share-usage onboarding-sign-in-intro onboarding-sign-in onboarding-syncing-progress