From e2071dc96878fcdac01253b2bc6b2fd4bd5ad61a Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Wed, 16 Sep 2020 13:37:43 +0200 Subject: [PATCH] [Fixes: #11170] Move some pn settings to advanced Signed-off-by: Andrea Maria Piana --- .../ui/screens/advanced_settings/views.cljs | 8 ++++++++ .../screens/notifications_settings/views.cljs | 19 +++++++++++++++---- src/status_im/ui/screens/routing/main.cljs | 4 ++++ translations/en.json | 5 +++-- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/status_im/ui/screens/advanced_settings/views.cljs b/src/status_im/ui/screens/advanced_settings/views.cljs index efdad27d65..aa26ebb1a1 100644 --- a/src/status_im/ui/screens/advanced_settings/views.cljs +++ b/src/status_im/ui/screens/advanced_settings/views.cljs @@ -2,6 +2,7 @@ (:require [re-frame.core :as re-frame] [status-im.i18n :as i18n] [quo.core :as quo] + [status-im.utils.platform :as platform] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] [status-im.ui.components.topbar :as topbar]) @@ -55,6 +56,13 @@ :on-press #(re-frame/dispatch [:navigate-to :bootnodes-settings]) :chevron true} + (when platform/ios? + {:size :small + :title (i18n/label :t/notification-settings) + :accessibility-label :advanced-notification-settings + :on-press + #(re-frame/dispatch [:navigate-to :notifications-advanced-settings]) + :chevron true}) {:size :small :title (i18n/label :t/waku-enabled) :accessibility-label :waku-enabled-settings-switch diff --git a/src/status_im/ui/screens/notifications_settings/views.cljs b/src/status_im/ui/screens/notifications_settings/views.cljs index 9120551474..13dbe3ed65 100644 --- a/src/status_im/ui/screens/notifications_settings/views.cljs +++ b/src/status_im/ui/screens/notifications_settings/views.cljs @@ -15,9 +15,7 @@ (defn notifications-settings [] (let [{:keys [remote-push-notifications-enabled? - send-push-notifications? push-notifications-block-mentions? - push-notifications-server-enabled? push-notifications-from-contacts-only?]} @(re-frame/subscribe [:multiaccount])] [react/view {:flex 1} @@ -26,7 +24,7 @@ :content-container-style {:padding-vertical 8}} [quo/list-item {:size :small - :title (i18n/label :t/notifications) + :title (i18n/label :t/show-notifications) :accessibility-label :notifications-button :active remote-push-notifications-enabled? :on-press #(re-frame/dispatch [::notifications/switch (not remote-push-notifications-enabled?)]) @@ -52,7 +50,17 @@ (not push-notifications-block-mentions?)) :on-press #(re-frame/dispatch [::notifications/switch-block-mentions (not push-notifications-block-mentions?)]) - :accessory :switch}] + :accessory :switch}]]])) + +(defn notifications-advanced-settings [] + (let [{:keys [remote-push-notifications-enabled? + send-push-notifications? + push-notifications-server-enabled?]} + @(re-frame/subscribe [:multiaccount])] + [react/view {:flex 1} + [topbar/topbar {:title :t/notification-settings}] + [react/scroll-view {:style {:flex 1} + :content-container-style {:padding-vertical 8}} [quo/list-item {:size :small :title (i18n/label :t/send-push-notifications) @@ -61,6 +69,9 @@ :on-press #(re-frame/dispatch [::notifications/switch-send-push-notifications (not send-push-notifications?)]) :accessory :switch}] + [quo/list-footer + (i18n/label :t/send-push-notifications-description)] + [quo/separator {:style {:margin-vertical 8}}] [quo/list-item {:size :small :title (i18n/label :t/push-notifications-server-enabled) diff --git a/src/status_im/ui/screens/routing/main.cljs b/src/status_im/ui/screens/routing/main.cljs index 872578f33a..1343cc4f21 100644 --- a/src/status_im/ui/screens/routing/main.cljs +++ b/src/status_im/ui/screens/routing/main.cljs @@ -115,6 +115,10 @@ :back-handler :noop :insets {:bottom true} :component notifications-settings/notifications-settings} + {:name :notifications-advanced-settings + :back-handler :noop + :insets {:bottom true} + :component notifications-settings/notifications-advanced-settings} {:name :notifications-onboarding :back-handler :noop :insets {:bottom true} diff --git a/translations/en.json b/translations/en.json index 81dadfdc7d..215081b4c3 100644 --- a/translations/en.json +++ b/translations/en.json @@ -790,13 +790,14 @@ "not-keycard-text": "The card you used is not a Keycard. You need to purchase a Keycard to use it", "not-keycard-title": "Not a Keycard", "notifications": "Notifications", - "notifications-settings": "Notifications", - "notification-settings": "Notification settings", + "show-notifications": "Show notifications", + "notification-settings": "Notifications", "notifications-servers": "Notification servers", "notifications-preferences": "Notification preferences", "notifications-switch": "Show notifications", "notifications-non-contacts": "Notifications from non-contacts", "send-push-notifications": "Send push notifications", + "send-push-notifications-description": "When disabled, the person receiving your messages won't be notified of their arrival", "push-notifications-server-enabled": "Server enabled", "push-notifications-servers": "Push notification servers", "allow-mention-notifications": "Show @ mentions",