[#4932] add privacy policy to signup, recover and profile

Signed-off-by: Goran Jovic <goranjovic@gmail.com>
This commit is contained in:
Roman Volosovskyi 2018-08-16 19:49:30 +03:00 committed by Goran Jovic
parent 3e7c059b59
commit 1b9c8d3d6f
No known key found for this signature in database
GPG Key ID: D429D1A9B2EB8A8E
12 changed files with 104 additions and 15 deletions

View File

@ -53,6 +53,10 @@
:other-accounts "Other accounts" :other-accounts "Other accounts"
:sign-you-in "Signing you in…" :sign-you-in "Signing you in…"
;; privacy policy
:privacy-policy "Privacy Policy"
:agree-by-continuing "By continuing you agree\n to our "
;;drawer ;;drawer
:switch-users "Switch users" :switch-users "Switch users"
:logout-title "Log out?" :logout-title "Log out?"
@ -134,6 +138,7 @@
:message "Message" :message "Message"
:notifications "Notifications" :notifications "Notifications"
:need-help "Need help?" :need-help "Need help?"
:about-app "About"
:help-center "Help Center" :help-center "Help Center"
:faq "Frequently asked questions" :faq "Frequently asked questions"
:submit-bug "Submit a bug" :submit-bug "Submit a bug"
@ -155,6 +160,7 @@
:mainnet-text "Youre on the Mainnet. Real ETH will be sent" :mainnet-text "Youre on the Mainnet. Real ETH will be sent"
:dev-mode "Development mode" :dev-mode "Development mode"
:backup-your-recovery-phrase "Backup your recovery phrase" :backup-your-recovery-phrase "Backup your recovery phrase"
:version "Version {{version}}"
;;recovery phrase ;;recovery phrase
:your-data-belongs-to-you "If you lose your recovery phrase you lose your data and funds" :your-data-belongs-to-you "If you lose your recovery phrase you lose your data and funds"

View File

@ -0,0 +1,27 @@
(ns status-im.ui.screens.about-app.views
(:require-macros [status-im.utils.views :as views])
(:require [status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.react :as react]
[status-im.ui.components.status-bar.view :as status-bar]
[status-im.i18n :as i18n]
[status-im.ui.screens.profile.components.views :as profile.components]
[re-frame.core :as re-frame]))
(views/defview about-app []
(views/letsubs [version [:get-app-version]]
[react/view {:flex 1}
[status-bar/status-bar]
[toolbar/simple-toolbar (i18n/label :t/about-app)]
[react/scroll-view
[react/view
[profile.components/settings-item-separator]
[profile.components/settings-item
{:label-kw :t/privacy-policy
:accessibility-label :privacy-policy
:action-fn #(re-frame/dispatch [:open-privacy-policy-link])}]
(when status-im.utils.platform/ios?
[profile.components/settings-item-separator])
[profile.components/settings-item
{:item-text (i18n/label :t/version {:version version})
:accessibility-label :version
:hide-arrow? true}]]]]))

View File

@ -11,7 +11,8 @@
[status-im.ui.components.icons.vector-icons :as icons] [status-im.ui.components.icons.vector-icons :as icons]
[status-im.ui.components.colors :as colors] [status-im.ui.components.colors :as colors]
[status-im.ui.components.common.common :as components.common] [status-im.ui.components.common.common :as components.common]
[status-im.ui.components.toolbar.view :as toolbar])) [status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.screens.privacy-policy.views :as privacy-policy]))
(defn account-view [{:keys [address photo-path name public-key]}] (defn account-view [{:keys [address photo-path name public-key]}]
[react/touchable-highlight {:on-press #(re-frame/dispatch [:open-login address photo-path name])} [react/touchable-highlight {:on-press #(re-frame/dispatch [:open-login address photo-path name])}
@ -46,4 +47,5 @@
[react/view styles/bottom-button-container [react/view styles/bottom-button-container
[components.common/button {:on-press #(re-frame/dispatch [:navigate-to :recover]) [components.common/button {:on-press #(re-frame/dispatch [:navigate-to :recover])
:label (i18n/label :t/add-existing-account) :label (i18n/label :t/add-existing-account)
:background? false}]]]]])) :background? false}]]
[privacy-policy/privacy-policy-button]]]]))

View File

@ -29,6 +29,7 @@
status-im.ui.screens.wallet.collectibles.etheremon.events status-im.ui.screens.wallet.collectibles.etheremon.events
status-im.ui.screens.browser.events status-im.ui.screens.browser.events
status-im.ui.screens.offline-messaging-settings.events status-im.ui.screens.offline-messaging-settings.events
status-im.ui.screens.privacy-policy.events
status-im.ui.screens.bootnodes-settings.events status-im.ui.screens.bootnodes-settings.events
status-im.ui.screens.currency-settings.events status-im.ui.screens.currency-settings.events
status-im.utils.keychain.events status-im.utils.keychain.events

View File

@ -5,7 +5,8 @@
[status-im.ui.components.common.common :as components.common] [status-im.ui.components.common.common :as components.common]
[status-im.ui.screens.intro.styles :as styles] [status-im.ui.screens.intro.styles :as styles]
[status-im.i18n :as i18n] [status-im.i18n :as i18n]
[status-im.ui.components.status-bar.view :as status-bar])) [status-im.ui.components.status-bar.view :as status-bar]
[status-im.ui.screens.privacy-policy.views :as privacy-policy]))
(defview intro [] (defview intro []
[react/view {:style styles/intro-view} [react/view {:style styles/intro-view}
@ -24,4 +25,5 @@
[react/view styles/bottom-button-container [react/view styles/bottom-button-container
[components.common/button {:on-press #(re-frame/dispatch [:navigate-to :recover]) [components.common/button {:on-press #(re-frame/dispatch [:navigate-to :recover])
:label (i18n/label :t/already-have-account) :label (i18n/label :t/already-have-account)
:background? false}]]]]) :background? false}]]
[privacy-policy/privacy-policy-button]]])

View File

@ -0,0 +1,14 @@
(ns status-im.ui.screens.privacy-policy.events
(:require [status-im.utils.handlers :as handlers]
[status-im.ui.components.react :as react]
[re-frame.core :as re-frame]))
(def ^:const privacy-policy-link "https://www.iubenda.com/privacy-policy/45710059")
(re-frame/reg-fx
::open-privacy-policy
(fn [] (.openURL react/linking privacy-policy-link)))
(handlers/register-handler-fx
:open-privacy-policy-link
(fn [] {::open-privacy-policy nil}))

View File

@ -0,0 +1,14 @@
(ns status-im.ui.screens.privacy-policy.styles
(:require [status-im.ui.components.common.styles :as common-styles]
[status-im.ui.components.colors :as colors]))
(def privacy-policy-button-container
{:margin-bottom 16
:margin-top 42})
(def privacy-policy-button-text
(merge common-styles/button-label
{:font-size 14}))
(def privacy-policy-button-text-gray
(merge privacy-policy-button-text {:color colors/gray}))

View File

@ -0,0 +1,15 @@
(ns status-im.ui.screens.privacy-policy.views
(:require [status-im.ui.components.react :as react]
[status-im.ui.screens.privacy-policy.styles :as styles]
[status-im.i18n :as i18n]
[re-frame.core :as re-frame]))
(defn privacy-policy-button []
[react/touchable-highlight
{:on-press #(re-frame/dispatch [:open-privacy-policy-link])}
[react/view styles/privacy-policy-button-container
[react/text {:style styles/privacy-policy-button-text-gray}
(i18n/label :t/agree-by-continuing)
[react/text
{:style styles/privacy-policy-button-text}
(i18n/label :t/privacy-policy)]]]])

View File

@ -65,8 +65,10 @@
[react/text {:style styles/settings-title} [react/text {:style styles/settings-title}
title]) title])
(defn settings-item [{:keys [label-kw value action-fn active? destructive? hide-arrow? accessibility-label icon-content] (defn settings-item
:or {value "" active? true}}] [{:keys [item-text label-kw value action-fn active? destructive? hide-arrow?
accessibility-label icon-content]
:or {value "" active? true}}]
[react/touchable-highlight [react/touchable-highlight
(cond-> {:on-press action-fn (cond-> {:on-press action-fn
:disabled (not active?)} :disabled (not active?)}
@ -77,7 +79,7 @@
[react/text {:style (merge styles/settings-item-text [react/text {:style (merge styles/settings-item-text
(when destructive? styles/settings-item-destructive)) (when destructive? styles/settings-item-destructive))
:number-of-lines 1} :number-of-lines 1}
(i18n/label label-kw)] (or item-text (i18n/label label-kw))]
(when-not (string/blank? value) (when-not (string/blank? value)
[react/text {:style styles/settings-item-value [react/text {:style styles/settings-item-value
:number-of-lines 1 :number-of-lines 1

View File

@ -14,7 +14,7 @@
:get-app-version :get-app-version
(fn [{:keys [web3-node-version]}] (fn [{:keys [web3-node-version]}]
(let [version (if platform/desktop? build/version build/build-no)] (let [version (if platform/desktop? build/version build/build-no)]
(str build/version " (" version ")\nnode " (or web3-node-version "N/A") "")))) (str build/version " (" version "); node " (or web3-node-version "N/A") ""))))
(reg-sub :get-device-UUID (reg-sub :get-device-UUID
(fn [db] (fn [db]

View File

@ -118,9 +118,15 @@
:action-fn #(re-frame/dispatch [:navigate-to :backup-seed]) :action-fn #(re-frame/dispatch [:navigate-to :backup-seed])
:icon-content [components.common/counter {:size 22} 1]}]) :icon-content [components.common/counter {:size 22} 1]}])
[profile.components/settings-item-separator] [profile.components/settings-item-separator]
[profile.components/settings-item {:label-kw :t/need-help [profile.components/settings-item
:accessibility-label :help-button {:label-kw :t/need-help
:action-fn #(re-frame/dispatch [:navigate-to :help-center])}] :accessibility-label :help-button
:action-fn #(re-frame/dispatch [:navigate-to :help-center])}]
[profile.components/settings-item-separator]
[profile.components/settings-item
{:label-kw :t/about-app
:accessibility-label :about-button
:action-fn #(re-frame/dispatch [:navigate-to :about-app])}]
[profile.components/settings-item-separator] [profile.components/settings-item-separator]
[react/view styles/my-profile-settings-logout-wrapper [react/view styles/my-profile-settings-logout-wrapper
[react/view styles/my-profile-settings-logout [react/view styles/my-profile-settings-logout
@ -128,9 +134,7 @@
:accessibility-label :log-out-button :accessibility-label :log-out-button
:destructive? true :destructive? true
:hide-arrow? true :hide-arrow? true
:action-fn #(handle-logout)}]] :action-fn #(handle-logout)}]]]]))
[react/view styles/my-profile-settings-logout-version
[react/text @(re-frame/subscribe [:get-app-version])]]]]))
(defview advanced-settings [{:keys [network networks dev-mode?]} on-show] (defview advanced-settings [{:keys [network networks dev-mode?]} on-show]
(letsubs [{:keys [sharing-usage-data?]} [:get-current-account]] (letsubs [{:keys [sharing-usage-data?]} [:get-current-account]]

View File

@ -50,7 +50,8 @@
[status-im.ui.screens.add-new.open-dapp.views :refer [open-dapp dapp-description]] [status-im.ui.screens.add-new.open-dapp.views :refer [open-dapp dapp-description]]
[status-im.ui.screens.intro.views :refer [intro]] [status-im.ui.screens.intro.views :refer [intro]]
[status-im.ui.screens.accounts.create.views :refer [create-account]] [status-im.ui.screens.accounts.create.views :refer [create-account]]
[status-im.ui.screens.profile.seed.views :refer [backup-seed]])) [status-im.ui.screens.profile.seed.views :refer [backup-seed]]
[status-im.ui.screens.about-app.views :as about-app]))
(defn get-main-component [view-id] (defn get-main-component [view-id]
(case view-id (case view-id
@ -98,6 +99,7 @@
:recipient-qr-code recipient-qr-code :recipient-qr-code recipient-qr-code
:contact-code contact-code :contact-code contact-code
:backup-seed backup-seed :backup-seed backup-seed
:about-app about-app/about-app
[react/view [react/text (str "Unknown view: " view-id)]])) [react/view [react/text (str "Unknown view: " view-id)]]))
(defn get-modal-component [modal-view] (defn get-modal-component [modal-view]