From 8638a2266db3209256e72b85f85c2c495aebac81 Mon Sep 17 00:00:00 2001 From: Ulises M Date: Thu, 22 Aug 2024 14:36:14 -0600 Subject: [PATCH] Add link to Privacy Policy in onboarding flow --- .../metrics_confirmation_modal/style.cljs | 8 +++- .../metrics_confirmation_modal/view.cljs | 47 +++++++++++++------ .../contexts/onboarding/intro/style.cljs | 2 +- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/src/status_im/common/metrics_confirmation_modal/style.cljs b/src/status_im/common/metrics_confirmation_modal/style.cljs index e14d0a4159..73843c0ba3 100644 --- a/src/status_im/common/metrics_confirmation_modal/style.cljs +++ b/src/status_im/common/metrics_confirmation_modal/style.cljs @@ -4,7 +4,7 @@ {:margin-top 11 :margin-horizontal 20 :gap 21 - :margin-bottom 15}) + :margin-bottom 8}) (def item-text {:margin-top 10 @@ -12,3 +12,9 @@ (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 index 8bfaa32ff0..75d76145c1 100644 --- a/src/status_im/common/metrics_confirmation_modal/view.cljs +++ b/src/status_im/common/metrics_confirmation_modal/view.cljs @@ -1,6 +1,7 @@ (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] @@ -52,14 +53,36 @@ (toggle-metrics false) (hide-bottom-sheet)) +(declare view) + (defn- on-privacy-policy-press - [] + [settings?] (rf/dispatch [:show-bottom-sheet - {:content (fn [] - [quo.theme/provider :dark - [privacy/privacy-statement]]) - :shell? true}])) + {:content (fn [] + [quo.theme/provider :dark + [privacy/privacy-statement]]) + :on-close (fn [] + (rf/dispatch [:show-bottom-sheet + {:content (fn [] + [quo.theme/provider :dark + [view {:settings? settings?}]]) + :shell? true}])) + :shell? true}])) + +(defn- privacy-policy-text + [settings?] + [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 settings?)} + (i18n/label :t/more-details-in-privacy-policy-2)]]]) (defn view [{:keys [settings?]}] @@ -79,22 +102,18 @@ [quo/text {:size :paragraph-2 :style style/info-text} - (i18n/label :t/usage-data-shared-from-all-profiles) - (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)]] + (i18n/label :t/usage-data-shared-from-all-profiles)] [quo/text {:size :paragraph-2 :style style/info-text} + (i18n/label :t/usage-data-shared-from-all-profiles) (i18n/label :t/sharing-usage-data-can-be-turned-off)])] [quo/bottom-actions {:actions :two-actions :blur? true :button-one-label (i18n/label :t/share-usage-data) :button-one-props {:on-press on-share-usage} - :button-two-label (i18n/label (if settings? :t/do-not-share :t/not-now)) + :button-two-label (i18n/label :t/not-now) :button-two-props {:type :grey - :on-press on-do-not-share}}]]) + :on-press on-do-not-share}}] + [privacy-policy-text settings?]]) diff --git a/src/status_im/contexts/onboarding/intro/style.cljs b/src/status_im/contexts/onboarding/intro/style.cljs index 5e21e4b041..e43705e4e9 100644 --- a/src/status_im/contexts/onboarding/intro/style.cljs +++ b/src/status_im/contexts/onboarding/intro/style.cljs @@ -10,7 +10,7 @@ {:flex 1 :flex-direction :row :flex-wrap :wrap - :align-self :center}) + :align-self :flex-start}) (def terms-privacy-container {:gap 8