[Fixes: #11170] Move some pn settings to advanced

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2020-09-16 13:37:43 +02:00
parent 1b1f3c4c9f
commit e2071dc968
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
4 changed files with 30 additions and 6 deletions

View File

@ -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

View File

@ -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)

View File

@ -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}

View File

@ -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",