Add link to Privacy Policy in onboarding flow

This commit is contained in:
Ulises M 2024-08-22 14:36:14 -06:00 committed by Andrea Maria Piana
parent baab56946e
commit 8638a2266d
3 changed files with 41 additions and 16 deletions

View File

@ -4,7 +4,7 @@
{:margin-top 11 {:margin-top 11
:margin-horizontal 20 :margin-horizontal 20
:gap 21 :gap 21
:margin-bottom 15}) :margin-bottom 8})
(def item-text (def item-text
{:margin-top 10 {:margin-top 10
@ -12,3 +12,9 @@
(def info-text (def info-text
{:margin-top -5}) {:margin-top -5})
(def privacy-policy
{:margin-top 4
:margin-horizontal 20
:margin-bottom 20
:align-items :center})

View File

@ -1,6 +1,7 @@
(ns status-im.common.metrics-confirmation-modal.view (ns status-im.common.metrics-confirmation-modal.view
(:require (:require
[quo.core :as quo] [quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme] [quo.theme]
[react-native.core :as rn] [react-native.core :as rn]
[status-im.common.metrics-confirmation-modal.style :as style] [status-im.common.metrics-confirmation-modal.style :as style]
@ -52,14 +53,36 @@
(toggle-metrics false) (toggle-metrics false)
(hide-bottom-sheet)) (hide-bottom-sheet))
(declare view)
(defn- on-privacy-policy-press (defn- on-privacy-policy-press
[] [settings?]
(rf/dispatch (rf/dispatch
[:show-bottom-sheet [:show-bottom-sheet
{:content (fn [] {:content (fn []
[quo.theme/provider :dark [quo.theme/provider :dark
[privacy/privacy-statement]]) [privacy/privacy-statement]])
:shell? true}])) :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 (defn view
[{:keys [settings?]}] [{:keys [settings?]}]
@ -79,22 +102,18 @@
[quo/text [quo/text
{:size :paragraph-2 {:size :paragraph-2
:style style/info-text} :style style/info-text}
(i18n/label :t/usage-data-shared-from-all-profiles) (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)]]
[quo/text [quo/text
{:size :paragraph-2 {:size :paragraph-2
:style style/info-text} :style style/info-text}
(i18n/label :t/usage-data-shared-from-all-profiles)
(i18n/label :t/sharing-usage-data-can-be-turned-off)])] (i18n/label :t/sharing-usage-data-can-be-turned-off)])]
[quo/bottom-actions [quo/bottom-actions
{:actions :two-actions {:actions :two-actions
:blur? true :blur? true
:button-one-label (i18n/label :t/share-usage-data) :button-one-label (i18n/label :t/share-usage-data)
:button-one-props {:on-press on-share-usage} :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 :button-two-props {:type :grey
:on-press on-do-not-share}}]]) :on-press on-do-not-share}}]
[privacy-policy-text settings?]])

View File

@ -10,7 +10,7 @@
{:flex 1 {:flex 1
:flex-direction :row :flex-direction :row
:flex-wrap :wrap :flex-wrap :wrap
:align-self :center}) :align-self :flex-start})
(def terms-privacy-container (def terms-privacy-container
{:gap 8 {:gap 8