-
Notifications
You must be signed in to change notification settings - Fork 987
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add identifiers screen to onboarding-flow
- Loading branch information
Showing
9 changed files
with
162 additions
and
62 deletions.
There are no files selected for viewing
61 changes: 47 additions & 14 deletions
61
src/status_im2/contexts/onboarding/common/background/view.cljs
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,23 +1,56 @@ | ||
(ns status-im2.contexts.onboarding.common.background.view | ||
(:require [react-native.core :as rn] | ||
[react-native.blur :as blur] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf] | ||
[status-im2.common.resources :as resources] | ||
[reagent.core :as reagent] | ||
[status-im2.contexts.onboarding.common.carousel.view :as carousel] | ||
[status-im2.contexts.onboarding.common.background.style :as style] | ||
[status-im2.contexts.onboarding.common.carousel.animation :as carousel.animation])) | ||
|
||
(def header-text | ||
[{:text (i18n/label :t/join-decentralised-communities) | ||
:sub-text (i18n/label :t/participate-in-the-metaverse)} | ||
{:text (i18n/label :t/chat-with-friends) | ||
:sub-text (i18n/label :t/with-full-encryption)} | ||
{:text (i18n/label :t/own-your-crypto) | ||
:sub-text (i18n/label :t/use-the-multichain-wallet)} | ||
{:text (i18n/label :t/discover-web3) | ||
:sub-text (i18n/label :t/explore-the-decentralized-web)}]) | ||
|
||
(defn background-image | ||
[content-width] | ||
[rn/image | ||
{:style {:resize-mode :stretch | ||
:width content-width} | ||
:source (resources/get-image :onboarding-illustration)}]) | ||
|
||
(defn view | ||
[dark-overlay?] | ||
[:f> | ||
(fn [] | ||
(let [animate? (not dark-overlay?)] | ||
(when animate? (carousel.animation/initialize-animation)) | ||
[rn/view | ||
{:style style/background-container} | ||
[carousel/view animate?] | ||
(when dark-overlay? | ||
[blur/view | ||
{:style style/background-blur-overlay | ||
:blur-amount 30 | ||
:blur-radius 25 | ||
:blur-type :transparent | ||
:overlay-color :transparent}])]))]) | ||
(let [view-id (rf/sub [:view-id]) | ||
progress (reagent/atom nil) | ||
paused (reagent/atom nil)] | ||
[:f> | ||
(fn [] | ||
(carousel.animation/initialize-animation progress paused) | ||
(let [animate? (not dark-overlay?)] | ||
(fn [] | ||
[rn/view | ||
{:style style/background-container} | ||
[carousel/view | ||
{:animate? animate? | ||
:progress progress | ||
:paused paused | ||
:header-text header-text | ||
:header-background true | ||
:content background-image | ||
:paused? (not= view-id :intro)}] | ||
(when dark-overlay? | ||
[blur/view | ||
{:style style/background-blur-overlay | ||
:blur-amount 30 | ||
:blur-radius 25 | ||
:blur-type :transparent | ||
:overlay-color :transparent}])])))])) | ||
|
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
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,15 @@ | ||
(ns status-im2.contexts.onboarding.identifiers.style) | ||
|
||
(def page-container | ||
{:flex 1}) | ||
|
||
(def content-container | ||
{:position :absolute | ||
:width "100%" | ||
:top 160 | ||
:bottom 0 | ||
:left 0}) | ||
|
||
(def card-style | ||
{:margin-horizontal 20 | ||
:margin-bottom :auto}) |
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,62 @@ | ||
(ns status-im2.contexts.onboarding.identifiers.view | ||
(:require [react-native.core :as rn] | ||
[clojure.string :as string] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf] | ||
[quo2.core :as quo] | ||
[quo2.foundations.colors :as colors] | ||
[reagent.core :as reagent] | ||
|
||
[status-im2.contexts.onboarding.identifiers.style :as style] | ||
[status-im2.contexts.onboarding.common.background.view :as background] | ||
[status-im2.contexts.onboarding.common.carousel.view :as carousel] | ||
[status-im2.contexts.onboarding.common.carousel.animation :as carousel.animation])) | ||
|
||
(def header-text | ||
[{:text (i18n/label :t/unique-identifiers) | ||
:sub-text (i18n/label :t/your-identifiers)} | ||
{:text (i18n/label :t/identicon-ring) | ||
:sub-text (i18n/label :t/identicon-ring-explanation)} | ||
{:text (i18n/label :t/chat-key-title) | ||
:sub-text (i18n/label :t/chat-key-description)} | ||
{:text (i18n/label :t/emojihash) | ||
:sub-text (i18n/label :t/emojihash-description)}]) | ||
|
||
(defn view | ||
[] | ||
(let [progress (reagent/atom nil) | ||
paused (reagent/atom nil) | ||
{:keys [emoji-hash display-name profile-picture compressed-key]} (rf/sub [:multiaccount]) | ||
{:keys [color]} (rf/sub [:onboarding-2/profile]) | ||
emoji-string (string/join emoji-hash)] | ||
[:f> | ||
(fn [] | ||
(carousel.animation/initialize-animation progress paused) | ||
(fn [] | ||
[:<> | ||
[background/view true] | ||
[rn/view {:style style/page-container} | ||
[carousel/view | ||
{:animate? true | ||
:progress progress | ||
:paused paused | ||
:header-text header-text | ||
|
||
:paused? false}] | ||
[rn/view {:style style/content-container} | ||
[quo/profile-card | ||
{:profile-picture profile-picture | ||
:name display-name | ||
:hash compressed-key | ||
:customization-color color | ||
:emoji-hash emoji-string | ||
:show-emoji-hash? true | ||
:show-user-hash? true | ||
:card-style style/card-style}] | ||
[quo/button | ||
{:accessibility-label :skip-identifiers | ||
:on-press #(rf/dispatch [:navigate-to :enable-notifications]) | ||
:override-background-color colors/white-opa-5 | ||
:style {:justify-self :flex-end | ||
:margin-bottom 46 | ||
:margin-horizontal 20}} (i18n/label :t/skip)]]]]))])) |
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
Oops, something went wrong.