feat: finish enable notifications (#18084)

This commit is contained in:
BalogunofAfrica 2023-12-12 13:46:01 +01:00 committed by GitHub
parent 0dd63490f8
commit f1bcc6259a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 51 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -47,6 +47,7 @@
:no-contacts-to-invite-dark (js/require "../resources/images/ui2/no-contacts-to-invite-dark.png")
:no-notifications-light (js/require "../resources/images/ui2/no-notifications-light.png")
:no-notifications-dark (js/require "../resources/images/ui2/no-notifications-dark.png")
:notifications (js/require "../resources/images/ui2/notifications.png")
:welcome-illustration (js/require "../resources/images/ui2/welcome_illustration.png")})
(def ui-themed
@ -138,7 +139,11 @@
(js/require "../resources/videos2/biometrics_04.mp4")]
:generate-keys [(js/require "../resources/videos2/generating_keys_01.mp4")
(js/require "../resources/videos2/generating_keys_02.mp4")
(js/require "../resources/videos2/generating_keys_03.mp4")]})
(js/require "../resources/videos2/generating_keys_03.mp4")]
:notifications [(js/require "../resources/videos2/notifications_01.mp4")
(js/require "../resources/videos2/notifications_02.mp4")
(js/require "../resources/videos2/notifications_03.mp4")
(js/require "../resources/videos2/notifications_04.mp4")]})
(def services
{:latamex (js/require "../resources/images/services/Latamex.png")

View File

@ -1,22 +1,19 @@
(ns status-im2.contexts.onboarding.enable-notifications.style
(:require
[quo.foundations.colors :as colors]))
(ns status-im2.contexts.onboarding.enable-notifications.style)
(def default-margin 20)
(defn page-container
[insets]
{:flex 1
:padding-top (:top insets)})
{:flex 1
:justify-content :space-between
:padding-top (:top insets)})
(def page-illustration
{:flex 1
:background-color colors/danger-50
:align-items :center
:margin-horizontal default-margin
:border-radius 20
:margin-top default-margin
:justify-content :center})
(defn page-illustration
[width]
{:flex 1
:width width})
(def page-heading {:z-index 1})
(defn buttons
[insets]

View File

@ -4,6 +4,9 @@
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.safe-area :as safe-area]
[status-im2.common.parallax.view :as parallax]
[status-im2.common.parallax.whitelist :as whitelist]
[status-im2.common.resources :as resources]
[status-im2.contexts.onboarding.enable-notifications.style :as style]
[status-im2.contexts.shell.jump-to.utils :as shell.utils]
[taoensso.timbre :as log]
@ -35,7 +38,7 @@
(rf/dispatch [:navigate-to-within-stack
[:welcome :enable-notifications]]))
:type :primary
:before :i/notifications
:icon-left :i/notifications
:accessibility-label :enable-notifications-button
:customization-color profile-color}
(i18n/label :t/intro-wizard-title6)]
@ -50,16 +53,36 @@
:container-style {:margin-top 12}}
(i18n/label :t/maybe-later)]]))
(defn enable-notifications
(defn enable-notifications-parallax
[]
(let [stretch (if rn/small-screen? -40 -25)]
[parallax/video
{:layers (:notifications resources/parallax-video)
:stretch stretch}]))
(defn enable-notifications-simple
[]
(let [width (:width (rn/get-window))]
[rn/image
{:resize-mode :contain
:style (style/page-illustration width)
:source (resources/get-image :notifications)}]))
(defn f-enable-notifications
[]
(let [insets (safe-area/get-insets)]
[rn/view {:style (style/page-container insets)}
[quo/page-nav
{:background :blur
:icon-name :i/arrow-left
:on-press #(rf/dispatch [:navigate-back-within-stack :enable-biometrics])}]
[page-title]
[rn/view {:style style/page-illustration}
[quo/text
"Illustration here"]]
[rn/view {:style style/page-heading}
[quo/page-nav
{:background :blur
:icon-name :i/arrow-left
:on-press #(rf/dispatch [:navigate-back-within-stack :enable-biometrics])}]
[page-title]]
(if whitelist/whitelisted?
[enable-notifications-parallax]
[enable-notifications-simple])
[enable-notification-buttons {:insets insets}]]))
(defn view
[]
[:f> f-enable-notifications])

View File

@ -210,7 +210,7 @@
:animations (merge transitions/new-to-status-modal-animations
transitions/push-animations-for-transparent-background)
:modalPresentationStyle :overCurrentContext}
:component enable-notifications/enable-notifications}
:component enable-notifications/view}
{:name :identifiers
:component identifiers/view

View File

@ -494,7 +494,7 @@
"empty-chat-description-community": "It's been quiet here for the last {{quiet-hours}}.",
"empty-chat-description-public-share-this": "share this chat.",
"enable": "Enable",
"enable-notifications-sub-title": "Receive notifications when somebody sends you a message or crypto to your wallet",
"enable-notifications-sub-title": "Receive notifications about your new messages or wallet transactions",
"encrypt-with-password": "Encrypt with password",
"ending-not-allowed": "{{ending}} ending is not allowed",
"ends-with-space": "Cannot end with space",