chore: add basic flow for wallet development to begin

This commit is contained in:
Jamie Caprani 2023-08-09 14:45:48 +02:00 committed by GitHub
parent 016b38f15c
commit 6b4b9d99f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 179 additions and 19 deletions

View File

@ -31,7 +31,7 @@
"
[{:keys [icon new-notifications? notification-indicator counter-label
on-press pass-through? icon-color-anim accessibility-label test-ID
customization-color]
customization-color on-long-press]
:or {customization-color :blue}}]
(let [icon-animated-style (reanimated/apply-animations-to-style
{:tint-color icon-color-anim}
@ -47,6 +47,7 @@
:border-radius 10})]
[rn/touchable-without-feedback
{:test-ID test-ID
:on-long-press on-long-press ;;NOTE - this is temporary while supporting old wallet
:on-press on-press
:on-press-in #(toggle-background-color background-color false pass-through?)
:on-press-out #(toggle-background-color background-color true pass-through?)

View File

@ -31,6 +31,10 @@
(assoc :test-ID stack-id
:icon icon
:icon-color-anim icon-color
;NOTE temporary use of on long press while we support old wallet
:on-long-press #(when (= stack-id :wallet-stack)
(swap! state/load-new-wallet? not)
(animation/bottom-tab-on-press stack-id true))
:on-press #(animation/bottom-tab-on-press stack-id true)
:accessibility-label (str (name stack-id) "-tab")
:customization-color customization-color))]))

View File

@ -1,6 +1,7 @@
(ns status-im2.contexts.shell.jump-to.components.home-stack.view
(:require [react-native.reanimated :as reanimated]
[status-im.ui.screens.wallet.accounts.views :as wallet.accounts]
[status-im2.contexts.wallet.home.view :as wallet-new]
[status-im2.contexts.chat.home.view :as chat]
[status-im2.contexts.shell.jump-to.state :as state]
[status-im2.contexts.shell.jump-to.utils :as utils]
@ -29,7 +30,10 @@
(case stack-id
:communities-stack [:f> communities/home]
:chats-stack [:f> chat/home]
:wallet-stack [wallet.accounts/accounts-overview-old]
;NOTE temporary while we support old wallet
:wallet-stack (if @state/load-new-wallet?
[wallet-new/view]
[wallet.accounts/accounts-overview-old])
:browser-stack [browser.stack/browser-stack]
[:<>])])

View File

@ -16,3 +16,6 @@
(def load-chats-stack? (reagent/atom false))
(def load-wallet-stack? (reagent/atom false))
(def load-browser-stack? (reagent/atom false))
;NOTE temporary while we support old wallet
(def load-new-wallet? (reagent/atom false))

View File

@ -0,0 +1,15 @@
(ns status-im2.contexts.wallet.account.view
(:require [react-native.core :as rn]
[quo2.core :as quo]
[utils.re-frame :as rf]))
(defn view
[]
[rn/view
{:style {:flex 1
:align-items :center
:justify-content :center}}
[quo/text {} "ACCOUNTS PAGE"]
[quo/divider-label]
[quo/button {:on-press #(rf/dispatch [:navigate-back])}
"NAVIGATE BACK"]])

View File

@ -0,0 +1,16 @@
(ns status-im2.contexts.wallet.collectible.view
(:require [react-native.core :as rn]
[quo2.core :as quo]
[re-frame.core :as rf]))
(defn view
[]
[rn/view
{:style {:flex 1
:align-items :center
:justify-content :center}}
[quo/text {} "COLLECTIBLES PAGE"]
[quo/divider-label]
[quo/button {:on-press #(rf/dispatch [:navigate-back])}
"NAVIGATE BACK"]])

View File

@ -0,0 +1,16 @@
(ns status-im2.contexts.wallet.create-account.view
(:require [react-native.core :as rn]
[quo2.core :as quo]
[re-frame.core :as rf]))
(defn view
[]
[rn/view
{:style {:flex 1
:align-items :center
:justify-content :center}}
[quo/text {} "CREATE ACCOUNT"]
[quo/divider-label]
[quo/button {:on-press #(rf/dispatch [:navigate-back])}
"NAVIGATE BACK"]])

View File

@ -0,0 +1,38 @@
(ns status-im2.contexts.wallet.home.view
(:require [react-native.core :as rn]
[quo2.core :as quo]
[react-native.safe-area :as safe-area]
[utils.re-frame :as rf]))
(defn wallet-temporary-navigation
[]
[rn/view
{:style {:flex 1
:align-items :center
:justify-content :center}}
[quo/text {} "TEMPORARY NAVIGATION"]
[quo/button {:on-press #(rf/dispatch [:navigate-to :wallet-accounts])}
"Navigate to Account"]
[quo/button {:on-press #(rf/dispatch [:navigate-to :wallet-create-account])}
"Create Account"]
[quo/button {:on-press #(rf/dispatch [:navigate-to :wallet-saved-addresses])}
"Saved Addresses"]
[quo/button {:on-press #(rf/dispatch [:navigate-to :wallet-collectibles])}
"Collectibles"]])
(defn view
[]
(let [top (safe-area/get-top)]
[rn/view
{:style {:margin-top top
:flex 1
:align-items :center
:justify-content :center}}
[quo/button
{:icon-only? true
:type :grey
:on-press (fn [] (rf/dispatch [:show-bottom-sheet {:content wallet-temporary-navigation}]))
:container-style {:position :absolute
:top 20
:right 20}} :i/options]
[quo/text {} "New Wallet Home"]]))

View File

@ -0,0 +1,15 @@
(ns status-im2.contexts.wallet.saved-address.view
(:require [react-native.core :as rn]
[quo2.core :as quo]
[re-frame.core :as rf]))
(defn view
[]
[rn/view
{:style {:flex 1
:align-items :center
:justify-content :center}}
[quo/text {} "SAVED ADDRESS"]
[quo/button {:on-press #(rf/dispatch [:navigate-back])}
"NAVIGATE BACK"]])

View File

@ -0,0 +1,18 @@
(ns status-im2.contexts.wallet.saved-addresses.view
(:require [react-native.core :as rn]
[quo2.core :as quo]
[re-frame.core :as rf]))
(defn view
[]
[rn/view
{:style {:flex 1
:align-items :center
:justify-content :center}}
[quo/text {} "SAVED ADDRESSES"]
[quo/button {:on-press #(rf/dispatch [:navigate-to :wallet-saved-address])}
"NAVIGATE TO SAVED ADDRESS"]
[quo/divider-label]
[quo/button {:on-press #(rf/dispatch [:navigate-back])}
"NAVIGATE BACK"]])

View File

@ -0,0 +1,6 @@
(ns status-im2.contexts.wallet.send.view
(:require [react-native.core :as rn]))
(defn view
[]
[rn/view])

View File

@ -1,12 +1,14 @@
(ns status-im2.navigation.screens
(:require
[status-im2.config :as config]
[status-im2.contexts.shell.activity-center.view :as activity-center]
[status-im2.contexts.add-new-contact.views :as add-new-contact]
[status-im2.contexts.chat.group-details.view :as group-details]
[status-im2.contexts.chat.lightbox.view :as lightbox]
[status-im2.contexts.chat.messages.view :as chat]
[status-im2.contexts.chat.new-chat.view :as new-chat]
[status-im2.contexts.chat.photo-selector.view :as photo-selector]
[status-im2.contexts.chat.camera.view :as camera-screen]
[status-im2.contexts.communities.actions.request-to-join.view :as join-menu]
[status-im2.contexts.communities.discover.view :as communities.discover]
[status-im2.contexts.communities.overview.view :as communities.overview]
[status-im2.contexts.onboarding.intro.view :as intro]
@ -20,23 +22,27 @@
[status-im2.contexts.onboarding.sign-in.view :as sign-in]
[status-im2.contexts.onboarding.generating-keys.view :as generating-keys]
[status-im2.contexts.onboarding.enter-seed-phrase.view :as enter-seed-phrase]
[status-im2.contexts.profile.profiles.view :as profiles]
[status-im2.contexts.quo-preview.main :as quo.preview]
[status-im2.contexts.shell.jump-to.view :as shell]
[status-im2.contexts.syncing.scan-sync-code-page.view :as scan-sync-code-page]
[status-im2.contexts.syncing.syncing-devices-list.view :as settings-syncing]
[status-im2.contexts.syncing.how-to-pair.view :as how-to-pair]
[status-im2.contexts.syncing.find-sync-code.view :as find-sync-code]
[status-im2.navigation.options :as options]
[status-im2.contexts.chat.group-details.view :as group-details]
[status-im.ui.screens.screens :as old-screens]
[status-im2.contexts.communities.actions.request-to-join.view :as join-menu]
[status-im2.contexts.syncing.setup-syncing.view :as settings-setup-syncing]
[status-im2.contexts.shell.share.view :as share]
[status-im2.contexts.onboarding.syncing.results.view :as syncing-results]
[status-im2.contexts.onboarding.syncing.progress.view :as syncing-devices]
[status-im2.contexts.chat.new-chat.view :as new-chat]
[status-im2.navigation.transitions :as transitions]))
[status-im2.navigation.transitions :as transitions]
[status-im2.contexts.profile.profiles.view :as profiles]
[status-im2.contexts.quo-preview.main :as quo.preview]
[status-im2.contexts.shell.activity-center.view :as activity-center]
[status-im2.contexts.shell.jump-to.view :as shell]
[status-im2.contexts.shell.share.view :as share]
[status-im2.contexts.syncing.how-to-pair.view :as how-to-pair]
[status-im2.contexts.syncing.find-sync-code.view :as find-sync-code]
[status-im2.contexts.syncing.scan-sync-code-page.view :as scan-sync-code-page]
[status-im2.contexts.syncing.setup-syncing.view :as settings-setup-syncing]
[status-im2.contexts.syncing.syncing-devices-list.view :as settings-syncing]
[status-im2.contexts.wallet.account.view :as wallet-accounts]
[status-im2.contexts.wallet.collectible.view :as wallet-collectibles]
[status-im2.contexts.wallet.create-account.view :as wallet-create-account]
[status-im2.contexts.wallet.saved-address.view :as wallet-saved-address]
[status-im2.contexts.wallet.saved-addresses.view :as wallet-saved-addresses]
[status-im2.contexts.wallet.send.view :as wallet-send]
[status-im.ui.screens.screens :as old-screens]
[status-im2.navigation.options :as options]))
(defn screens
[]
@ -232,7 +238,25 @@
:options {:theme :dark
:layout options/onboarding-transparent-layout
:animations transitions/push-animations-for-transparent-background}
:component welcome/view}]
:component welcome/view}
{:name :wallet-accounts
:component wallet-accounts/view}
{:name :wallet-collectibles
:component wallet-collectibles/view}
{:name :wallet-create-account
:component wallet-create-account/view}
{:name :wallet-saved-address
:component wallet-saved-address/view}
{:name :wallet-saved-addresses
:component wallet-saved-addresses/view}
{:name :wallet-send
:component wallet-send/view}]
(when config/quo-preview-enabled?
quo.preview/screens)