[#10899] Enable notifications during onboarding

This commit is contained in:
andrey 2020-07-03 14:24:07 +02:00
parent 3800f3f7da
commit f2fb1739c0
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
11 changed files with 49 additions and 18 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -49,7 +49,7 @@
(defn button [{:keys [on-press disabled type theme before after
haptic-feedback haptic-type on-long-press on-press-start
accessibility-label loading border-radius]
accessibility-label loading border-radius style]
:or {theme :main
type :primary
haptic-feedback true
@ -83,7 +83,7 @@
{:on-press-start (fn []
(optional-haptic)
(on-press-start))}))
[rn/view {:style (style-container type)}
[rn/view {:style (merge (style-container type) style)}
(when before
[rn/view
[icons/icon before {:color icon-color}]])

View File

@ -11,7 +11,8 @@
[status-im.constants :as constants]
[status-im.ethereum.eip55 :as eip55]
[status-im.ethereum.core :as ethereum]
[status-im.ui.components.bottom-sheet.core :as bottom-sheet]))
[status-im.ui.components.bottom-sheet.core :as bottom-sheet]
[status-im.utils.platform :as platform]))
(fx/defn pair* [_ password]
{:hardwallet/pair {:password password}})
@ -120,7 +121,8 @@
{:db (update db :hardwallet dissoc
:multiaccount-wallet-address
:multiaccount-whisper-public-key)}
(navigation/navigate-to-cofx :welcome nil)))
(navigation/navigate-to-cofx (if platform/android?
:notifications-settings :welcome) nil)))
(fx/defn recovery-no-key
{:events [:keycard.recovery.no-key.ui/generate-key-pressed]}
@ -187,7 +189,8 @@
{})
(if (= flow :import)
(navigation/navigate-replace :keycard-recovery-success nil)
(navigation/navigate-to-cofx :welcome nil))))))
(navigation/navigate-to-cofx (if platform/android?
:notifications-settings :welcome) nil))))))
(fx/defn on-generate-and-load-key-success
{:events [:hardwallet.callback/on-generate-and-load-key-success]

View File

@ -141,7 +141,8 @@
[{:keys [db] :as cofx}]
(fx/merge cofx
{:db (dissoc db :intro-wizard)}
(navigation/navigate-to-cofx :welcome nil)))
(navigation/navigate-to-cofx (if platform/android?
:notifications-settings :welcome) nil)))
(fx/defn init-key-generation
[{:keys [db] :as cofx}]

View File

@ -92,7 +92,8 @@
{:db (update db :hardwallet dissoc :flow)}
(if (= :import flow)
(navigation/navigate-to-cofx :intro-stack {:screen :keycard-recovery-success})
(navigation/navigate-to-cofx :welcome nil))))))
(navigation/navigate-to-cofx (if platform/android?
:notifications-settings :welcome) nil))))))
(fx/defn initialize-dapp-permissions
{:events [::initialize-dapp-permissions]}

View File

@ -38,7 +38,8 @@
:onboarding-phone (js/require "../resources/images/ui/onboarding-phone.png")
:theme-dark (js/require "../resources/images/ui/theme-dark.png")
:theme-light (js/require "../resources/images/ui/theme-light.png")
:theme-system (js/require "../resources/images/ui/theme-system.png")})
:theme-system (js/require "../resources/images/ui/theme-system.png")
:notifications (js/require "../resources/images/ui/notifications.png")})
(defn get-theme-image [k]
(get ui (when (colors/dark?) (keyword (str (name k) "-dark"))) (get ui k)))

View File

@ -1,9 +1,29 @@
(ns status-im.ui.screens.notifications-settings.views
(:require [status-im.ui.components.colors :as colors]
[status-im.ui.components.react :as react]
[status-im.ui.components.topbar :as topbar]))
[status-im.react-native.resources :as resources]
[quo.core :as quo]
[re-frame.core :as re-frame]
[status-im.i18n :as i18n]))
(defn notifications-settings []
[react/view {:flex 1 :background-color colors/white}
[topbar/topbar {:title :t/notifications}]])
[react/view {:flex 1 :background-color colors/white
:align-items :center :padding-bottom 16}
[react/text {:style {:margin-top 72 :margin-bottom 16
:typography :header}}
(i18n/label :t/private-notifications)]
[react/text {:style {:color colors/gray :text-align :center :margin-horizontal 24}}
(i18n/label :t/private-notifications-descr)]
[react/view {:flex 1 :align-items :center :justify-content :center}
[react/image {:source (resources/get-image :notifications)
:style {:width 118
:height 118}}]]
[quo/button {:on-press #(do (re-frame/dispatch
[:multiaccounts.ui/notifications-switched true])
(re-frame/dispatch [:navigate-to :welcome]))
:accessibility-label :enable-notifications}
(i18n/label :t/intro-wizard-title6)]
[quo/button {:type :secondary :style {:margin-top 8}
:accessibility-label :maybe-later
:on-press #(re-frame/dispatch [:navigate-to :welcome])}
(i18n/label :t/maybe-later)]])

View File

@ -19,7 +19,8 @@
[status-im.ui.components.tabbar.core :as tabbar]
[status-im.ui.screens.routing.core :as navigation]
[status-im.utils.platform :as platform]
[status-im.ui.screens.chat.image.preview.views :as image-preview]))
[status-im.ui.screens.chat.image.preview.views :as image-preview]
[status-im.ui.screens.notifications-settings.views :as notifications-settings]))
(defonce main-stack (navigation/create-stack))
(defonce bottom-tabs (navigation/create-bottom-tabs))
@ -95,4 +96,8 @@
:component qr-scanner/qr-scanner}
{:name :image-preview
:insets {:top false}
:component image-preview/preview-image}]]))
:component image-preview/preview-image}
{:name :notifications-settings
:back-handler :noop
:insets {:bottom true}
:component notifications-settings/notifications-settings}]]))

View File

@ -17,7 +17,6 @@
[status-im.ui.screens.dapps-permissions.views :as dapps-permissions]
[status-im.ui.screens.privacy-and-security-settings.views :as privacy-and-security]
[status-im.ui.screens.language-settings.views :as language-settings]
[status-im.ui.screens.notifications-settings.views :as notifications-settings]
[status-im.ui.screens.sync-settings.views :as sync-settings]
[status-im.ui.screens.advanced-settings.views :as advanced-settings]
[status-im.ui.screens.help-center.views :as help-center]
@ -86,8 +85,6 @@
:component appearance/appearance}
{:name :language-settings
:component language-settings/language-settings}
{:name :notifications-settings
:component notifications-settings/notifications-settings}
{:name :sync-settings
:component sync-settings/sync-settings}
{:name :advanced-settings

View File

@ -1160,5 +1160,8 @@
"add-new-contact": "Add new contact",
"you-dont-have-contacts": "You dont have any contacts yet.",
"set-max": "Set max",
"continue-anyway": "Continue anyway"
"continue-anyway": "Continue anyway",
"private-notifications": "Private notifications",
"private-notifications-descr": "Status will notify you about new messages. You can edit your notification preferences later in settings.",
"maybe-later": "Maybe later"
}