diff --git a/src/status_im/translations/en.cljs b/src/status_im/translations/en.cljs index 2976b618bb..e30c408d39 100644 --- a/src/status_im/translations/en.cljs +++ b/src/status_im/translations/en.cljs @@ -53,6 +53,10 @@ :other-accounts "Other accounts" :sign-you-in "Signing you in…" + ;; privacy policy + :privacy-policy "Privacy Policy" + :agree-by-continuing "By continuing you agree\n to our " + ;;drawer :switch-users "Switch users" :logout-title "Log out?" @@ -134,6 +138,7 @@ :message "Message" :notifications "Notifications" :need-help "Need help?" + :about-app "About" :help-center "Help Center" :faq "Frequently asked questions" :submit-bug "Submit a bug" @@ -155,6 +160,7 @@ :mainnet-text "You’re on the Mainnet. Real ETH will be sent" :dev-mode "Development mode" :backup-your-recovery-phrase "Backup your recovery phrase" + :version "Version {{version}}" ;;recovery phrase :your-data-belongs-to-you "If you lose your recovery phrase you lose your data and funds" diff --git a/src/status_im/ui/screens/about_app/views.cljs b/src/status_im/ui/screens/about_app/views.cljs new file mode 100644 index 0000000000..66bf99cc41 --- /dev/null +++ b/src/status_im/ui/screens/about_app/views.cljs @@ -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}]]]])) diff --git a/src/status_im/ui/screens/accounts/views.cljs b/src/status_im/ui/screens/accounts/views.cljs index c80ea16cde..f0b87dbf1d 100644 --- a/src/status_im/ui/screens/accounts/views.cljs +++ b/src/status_im/ui/screens/accounts/views.cljs @@ -11,7 +11,8 @@ [status-im.ui.components.icons.vector-icons :as icons] [status-im.ui.components.colors :as colors] [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]}] [react/touchable-highlight {:on-press #(re-frame/dispatch [:open-login address photo-path name])} @@ -46,4 +47,5 @@ [react/view styles/bottom-button-container [components.common/button {:on-press #(re-frame/dispatch [:navigate-to :recover]) :label (i18n/label :t/add-existing-account) - :background? false}]]]]])) + :background? false}]] + [privacy-policy/privacy-policy-button]]]])) diff --git a/src/status_im/ui/screens/events.cljs b/src/status_im/ui/screens/events.cljs index d16a24516a..c2ea33ac6d 100644 --- a/src/status_im/ui/screens/events.cljs +++ b/src/status_im/ui/screens/events.cljs @@ -29,6 +29,7 @@ status-im.ui.screens.wallet.collectibles.etheremon.events status-im.ui.screens.browser.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.currency-settings.events status-im.utils.keychain.events diff --git a/src/status_im/ui/screens/intro/views.cljs b/src/status_im/ui/screens/intro/views.cljs index 142e602d80..2743d7f4c1 100644 --- a/src/status_im/ui/screens/intro/views.cljs +++ b/src/status_im/ui/screens/intro/views.cljs @@ -5,7 +5,8 @@ [status-im.ui.components.common.common :as components.common] [status-im.ui.screens.intro.styles :as styles] [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 [] [react/view {:style styles/intro-view} @@ -24,4 +25,5 @@ [react/view styles/bottom-button-container [components.common/button {:on-press #(re-frame/dispatch [:navigate-to :recover]) :label (i18n/label :t/already-have-account) - :background? false}]]]]) + :background? false}]] + [privacy-policy/privacy-policy-button]]]) diff --git a/src/status_im/ui/screens/privacy_policy/events.cljs b/src/status_im/ui/screens/privacy_policy/events.cljs new file mode 100644 index 0000000000..e555b5b45c --- /dev/null +++ b/src/status_im/ui/screens/privacy_policy/events.cljs @@ -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})) diff --git a/src/status_im/ui/screens/privacy_policy/styles.cljs b/src/status_im/ui/screens/privacy_policy/styles.cljs new file mode 100644 index 0000000000..17f27a8570 --- /dev/null +++ b/src/status_im/ui/screens/privacy_policy/styles.cljs @@ -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})) diff --git a/src/status_im/ui/screens/privacy_policy/views.cljs b/src/status_im/ui/screens/privacy_policy/views.cljs new file mode 100644 index 0000000000..7374fc45dc --- /dev/null +++ b/src/status_im/ui/screens/privacy_policy/views.cljs @@ -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)]]]]) diff --git a/src/status_im/ui/screens/profile/components/views.cljs b/src/status_im/ui/screens/profile/components/views.cljs index 22798fed14..b00071816b 100644 --- a/src/status_im/ui/screens/profile/components/views.cljs +++ b/src/status_im/ui/screens/profile/components/views.cljs @@ -65,8 +65,10 @@ [react/text {:style styles/settings-title} title]) -(defn settings-item [{:keys [label-kw value action-fn active? destructive? hide-arrow? accessibility-label icon-content] - :or {value "" active? true}}] +(defn settings-item + [{:keys [item-text label-kw value action-fn active? destructive? hide-arrow? + accessibility-label icon-content] + :or {value "" active? true}}] [react/touchable-highlight (cond-> {:on-press action-fn :disabled (not active?)} @@ -77,7 +79,7 @@ [react/text {:style (merge styles/settings-item-text (when destructive? styles/settings-item-destructive)) :number-of-lines 1} - (i18n/label label-kw)] + (or item-text (i18n/label label-kw))] (when-not (string/blank? value) [react/text {:style styles/settings-item-value :number-of-lines 1 diff --git a/src/status_im/ui/screens/profile/subs.cljs b/src/status_im/ui/screens/profile/subs.cljs index dacaa750e3..c4897df510 100644 --- a/src/status_im/ui/screens/profile/subs.cljs +++ b/src/status_im/ui/screens/profile/subs.cljs @@ -14,7 +14,7 @@ :get-app-version (fn [{:keys [web3-node-version]}] (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 (fn [db] diff --git a/src/status_im/ui/screens/profile/user/views.cljs b/src/status_im/ui/screens/profile/user/views.cljs index c6549e891c..68ce89d472 100644 --- a/src/status_im/ui/screens/profile/user/views.cljs +++ b/src/status_im/ui/screens/profile/user/views.cljs @@ -118,9 +118,15 @@ :action-fn #(re-frame/dispatch [:navigate-to :backup-seed]) :icon-content [components.common/counter {:size 22} 1]}]) [profile.components/settings-item-separator] - [profile.components/settings-item {:label-kw :t/need-help - :accessibility-label :help-button - :action-fn #(re-frame/dispatch [:navigate-to :help-center])}] + [profile.components/settings-item + {:label-kw :t/need-help + :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] [react/view styles/my-profile-settings-logout-wrapper [react/view styles/my-profile-settings-logout @@ -128,9 +134,7 @@ :accessibility-label :log-out-button :destructive? true :hide-arrow? true - :action-fn #(handle-logout)}]] - [react/view styles/my-profile-settings-logout-version - [react/text @(re-frame/subscribe [:get-app-version])]]]])) + :action-fn #(handle-logout)}]]]])) (defview advanced-settings [{:keys [network networks dev-mode?]} on-show] (letsubs [{:keys [sharing-usage-data?]} [:get-current-account]] diff --git a/src/status_im/ui/screens/views.cljs b/src/status_im/ui/screens/views.cljs index 907efb0664..7671efb342 100644 --- a/src/status_im/ui/screens/views.cljs +++ b/src/status_im/ui/screens/views.cljs @@ -50,7 +50,8 @@ [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.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] (case view-id @@ -98,6 +99,7 @@ :recipient-qr-code recipient-qr-code :contact-code contact-code :backup-seed backup-seed + :about-app about-app/about-app [react/view [react/text (str "Unknown view: " view-id)]])) (defn get-modal-component [modal-view]