-
Notifications
You must be signed in to change notification settings - Fork 986
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(profile): Make terms of use and privacy policy easily accessible (…
…#21759) * Fix `:true` keyword being used in navigation screens. * Add about screen, terms of use and privacy policy links * Remove old about app screen
- Loading branch information
Showing
12 changed files
with
249 additions
and
149 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
(ns status-im.common.privacy.view | ||
(:require-macros [legacy.status-im.utils.slurp :refer [slurp]]) | ||
(:require [quo.core :as quo] | ||
[react-native.gesture :as gesture])) | ||
[react-native.gesture :as gesture] | ||
[status-im.contexts.settings.common.header :as header] | ||
[utils.i18n :as i18n])) | ||
|
||
(def privacy-statement-text (slurp "resources/privacy.mdwn")) | ||
|
||
(defn privacy-statement | ||
[] | ||
[gesture/scroll-view {:margin 20} | ||
[gesture/scroll-view {:style {:margin 20}} | ||
[quo/text privacy-statement-text]]) | ||
|
||
(defn view | ||
[] | ||
[quo/overlay {:type :shell} | ||
[header/view {:title (i18n/label :t/privacy-policy)}] | ||
[gesture/scroll-view {:style {:padding-horizontal 20}} | ||
[quo/text privacy-statement-text]]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
(ns status-im.common.terms.view | ||
(:require-macros [legacy.status-im.utils.slurp :refer [slurp]]) | ||
(:require [quo.core :as quo] | ||
[react-native.gesture :as gesture])) | ||
[react-native.gesture :as gesture] | ||
[status-im.contexts.settings.common.header :as header] | ||
[utils.i18n :as i18n])) | ||
|
||
(def terms-of-use-text (slurp "resources/terms-of-use.mdwn")) | ||
|
||
(defn terms-of-use | ||
[] | ||
[gesture/scroll-view {:margin 20} | ||
[gesture/scroll-view {:style {:margin 20}} | ||
[quo/text terms-of-use-text]]) | ||
|
||
(defn view | ||
[] | ||
[quo/overlay {:type :shell} | ||
[header/view {:title (i18n/label :t/terms-of-service)}] | ||
[gesture/scroll-view {:style {:padding-horizontal 20}} | ||
[quo/text terms-of-use-text]]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(ns status-im.contexts.settings.about.style) | ||
|
||
(def category-spacing {:padding-bottom 12}) | ||
|
||
(def app-info-container | ||
{:padding-horizontal 20 | ||
:padding-top 8 | ||
:padding-bottom 16 | ||
:row-gap 16}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
(ns status-im.contexts.settings.about.view | ||
(:require [quo.core :as quo] | ||
[react-native.core :as rn] | ||
[status-im.constants :as constants] | ||
[status-im.contexts.settings.about.style :as style] | ||
[status-im.contexts.settings.common.header :as header] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn- open-link | ||
[url] | ||
(rf/dispatch [:browser.ui/open-url url])) | ||
|
||
(defn- copy | ||
[data item-name] | ||
(rf/dispatch [:share/copy-text-and-show-toast | ||
{:text-to-copy data | ||
:post-copy-message (str item-name | ||
" " | ||
(i18n/label :t/sharing-copied-to-clipboard))}])) | ||
|
||
(def about-data | ||
[{:app-info? true} | ||
{:category-label (i18n/label :t/website) | ||
:items [{:title "status.app" | ||
:on-press #(open-link constants/status-app-url) | ||
:blur? true | ||
:action :arrow | ||
:action-props {:icon :i/external}}]} | ||
{:category-label (i18n/label :t/github-repos) | ||
:items [{:title "status-mobile" | ||
:on-press #(open-link constants/status-mobile-url) | ||
:blur? true | ||
:action :arrow | ||
:action-props {:icon :i/external}} | ||
{:title "status-go" | ||
:on-press #(open-link constants/status-go-url) | ||
:blur? true | ||
:action :arrow | ||
:action-props {:icon :i/external}} | ||
{:title "go-waku" | ||
:on-press #(open-link constants/go-waku-url) | ||
:blur? true | ||
:action :arrow | ||
:action-props {:icon :i/external}}]} | ||
{:category-label (i18n/label :t/documents) | ||
:items [{:title (i18n/label :t/privacy-policy) | ||
:on-press #(rf/dispatch [:open-modal :screen/settings.privacy-policy]) | ||
:blur? true | ||
:action :arrow} | ||
{:title (i18n/label :t/terms-of-service) | ||
:on-press #(rf/dispatch [:open-modal :screen/settings.terms-of-use]) | ||
:blur? true | ||
:action :arrow}]}]) | ||
|
||
(defn info-item | ||
[{:keys [title info]}] | ||
[quo/data-item | ||
{:size :default | ||
:status :default | ||
:right-icon :i/copy | ||
:card? true | ||
:blur? true | ||
:title title | ||
:on-press #(copy info title) | ||
:subtitle info | ||
:subtitle-type :default | ||
:subtitle-text-props {:number-of-lines 1 | ||
:ellipsize-mode :middle}}]) | ||
|
||
(defn- app-info | ||
[] | ||
(let [app-version (rf/sub [:get-app-short-version]) | ||
commit-hash (rf/sub [:get-commit-hash]) | ||
node-version (rf/sub [:get-app-node-version])] | ||
[rn/view {:style style/app-info-container} | ||
[info-item {:title (i18n/label :t/version) :info app-version}] | ||
[info-item {:title (i18n/label :t/app-commit) :info commit-hash}] | ||
[info-item {:title (i18n/label :t/node-version) :info node-version}]])) | ||
|
||
(defn category | ||
[{:keys [app-info? category-label items]}] | ||
(if app-info? | ||
[app-info] | ||
[quo/category | ||
{:label category-label | ||
:list-type :settings | ||
:container-style style/category-spacing | ||
:blur? true | ||
:data items}])) | ||
|
||
(defn view | ||
[] | ||
[quo/overlay {:type :shell} | ||
[header/view {:title (i18n/label :t/about)}] | ||
[rn/flat-list | ||
{:data about-data | ||
:shows-vertical-scroll-indicator false | ||
:render-fn category | ||
:bounces false | ||
:over-scroll-mode :never}]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns status-im.contexts.settings.common.header | ||
(:require [quo.core :as quo] | ||
[react-native.core :as rn] | ||
[react-native.safe-area :as safe-area] | ||
[status-im.common.events-helper :as events-helper])) | ||
|
||
(defn view | ||
[{:keys [title]}] | ||
[rn/view {:style {:padding-top (safe-area/get-top)}} | ||
[quo/page-nav | ||
{:background :blur | ||
:icon-name :i/arrow-left | ||
:on-press events-helper/navigate-back}] | ||
[quo/page-top {:title title}]]) |
Oops, something went wrong.