Skip to content

Commit

Permalink
chore(wallet): move add-account funcitonality into its own folder
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 committed Apr 8, 2024
1 parent 32098d2 commit 2e9303f
Show file tree
Hide file tree
Showing 33 changed files with 202 additions and 176 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns status-im.contexts.wallet.add-address-to-watch.component-spec
(ns status-im.contexts.wallet.add-account.add-address-to-watch.component-spec
(:require
[status-im.contexts.wallet.add-address-to-watch.view :as add-address-to-watch]
[status-im.contexts.wallet.add-account.add-address-to-watch.view :as add-address-to-watch]
status-im.contexts.wallet.events
[test-helpers.component :as h]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns status-im.contexts.wallet.add-address-to-watch.confirm-address.component-spec
(ns status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.component-spec
(:require
[status-im.contexts.wallet.add-address-to-watch.confirm-address.view :as confirm-address]
[status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.view :as confirm-address]
[test-helpers.component :as h]))

(h/describe "Add Watch Only Account Page"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.add-address-to-watch.confirm-address.style)
(ns status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.style)

(def container
{:flex 1})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(ns status-im.contexts.wallet.add-address-to-watch.confirm-address.view
(ns status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.view
(:require
[clojure.string :as string]
[quo.core :as quo]
[quo.foundations.colors :as colors]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.common.emoji-picker.utils :as emoji-picker.utils]
[status-im.contexts.wallet.add-address-to-watch.confirm-address.style :as style]
[status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.style :as style]
[status-im.contexts.wallet.common.screen-base.create-or-edit-account.view :as
create-or-edit-account]
[utils.i18n :as i18n]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.accounts.add-account.address-to-watch.events
(ns status-im.contexts.wallet.add-account.add-address-to-watch.events
(:require [clojure.string :as string]
[status-im.constants :as constants]
[taoensso.timbre :as log]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.add-address-to-watch.style)
(ns status-im.contexts.wallet.add-account.add-address-to-watch.style)

(def header-container {:padding-bottom 8})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.add-address-to-watch.view
(ns status-im.contexts.wallet.add-account.add-address-to-watch.view
(:require
[clojure.string :as string]
[quo.core :as quo]
Expand All @@ -7,7 +7,7 @@
[reagent.core :as reagent]
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.constants :as constants]
[status-im.contexts.wallet.add-address-to-watch.style :as style]
[status-im.contexts.wallet.add-account.add-address-to-watch.style :as style]
[status-im.contexts.wallet.common.validation :as validation]
[status-im.subs.wallet.add-account.address-to-watch]
[utils.debounce :as debounce]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns status-im.contexts.wallet.create-account.edit-derivation-path.component-spec
(ns status-im.contexts.wallet.add-account.create-account.edit-derivation-path.component-spec
(:require
[status-im.contexts.wallet.create-account.edit-derivation-path.view :as edit-derivation-path]
[status-im.contexts.wallet.add-account.create-account.edit-derivation-path.view :as
edit-derivation-path]
[test-helpers.component :as h]))

(def sub-mocks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.edit-derivation-path.path-format-sheet.view
(ns status-im.contexts.wallet.add-account.create-account.edit-derivation-path.path-format-sheet.view
(:require
[quo.core :as quo]
[status-im.constants :as constants]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.edit-derivation-path.style
(ns status-im.contexts.wallet.add-account.create-account.edit-derivation-path.style
(:require [quo.foundations.colors :as colors]))

(defn screen
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
(ns status-im.contexts.wallet.create-account.edit-derivation-path.view
(ns status-im.contexts.wallet.add-account.create-account.edit-derivation-path.view
(:require
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im.contexts.wallet.add-account.create-account.edit-derivation-path.path-format-sheet.view :as
path-format-sheet]
[status-im.contexts.wallet.add-account.create-account.edit-derivation-path.style :as style]
[status-im.contexts.wallet.common.temp :as temp]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.contexts.wallet.create-account.edit-derivation-path.path-format-sheet.view :as
path-format-sheet]
[status-im.contexts.wallet.create-account.edit-derivation-path.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.events
(ns status-im.contexts.wallet.add-account.create-account.events
(:require [status-im.contexts.wallet.data-store :as data-store]
[utils.re-frame :as rf]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns status-im.contexts.wallet.create-account.events-test
(ns status-im.contexts.wallet.add-account.create-account.events-test
(:require
[cljs.test :refer-macros [deftest is]]
matcher-combinators.test
[status-im.contexts.wallet.create-account.events :as events]))
[status-im.contexts.wallet.add-account.create-account.events :as events]))

(deftest confirm-account-origin
(let [db {:wallet {:ui {:create-account {}}}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.new-keypair.backup-recovery-phrase.style
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.style
(:require
[quo.foundations.colors :as colors]
[quo.theme :as quo.theme]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.new-keypair.backup-recovery-phrase.view
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.view
(:require
[clojure.string :as string]
[native-module.core :as native-module]
Expand All @@ -7,7 +7,8 @@
[react-native.blur :as blur]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.contexts.wallet.create-account.new-keypair.backup-recovery-phrase.style :as style]
[status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.style :as
style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.new-keypair.check-your-backup.style)
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.check-your-backup.style)

(def header-container
{:margin-horizontal 20
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(ns status-im.contexts.wallet.create-account.new-keypair.check-your-backup.view
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.check-your-backup.view
(:require
[quo.core :as quo]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.contexts.wallet.create-account.new-keypair.check-your-backup.style :as style]
[status-im.contexts.wallet.add-account.create-account.new-keypair.check-your-backup.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.new-keypair.keypair-name.style)
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.keypair-name.style)

(def header-container
{:margin-horizontal 20
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(ns status-im.contexts.wallet.create-account.new-keypair.keypair-name.view
(ns status-im.contexts.wallet.add-account.create-account.new-keypair.keypair-name.view
(:require
[quo.core :as quo]
[react-native.core :as rn]
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.common.validation.general :as validators]
[status-im.contexts.wallet.create-account.new-keypair.keypair-name.style :as style]
[status-im.contexts.wallet.add-account.create-account.new-keypair.keypair-name.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.select-keypair.style)
(ns status-im.contexts.wallet.add-account.create-account.select-keypair.style)

(def header-container
{:margin-bottom 8})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(ns status-im.contexts.wallet.create-account.select-keypair.view
(ns status-im.contexts.wallet.add-account.create-account.select-keypair.view
(:require
[clojure.string :as string]
[quo.core :as quo]
[react-native.core :as rn]
[status-im.constants :as constants]
[status-im.contexts.wallet.create-account.select-keypair.style :as style]
[status-im.contexts.wallet.add-account.create-account.select-keypair.style :as style]
[utils.address :as utils]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.style
(ns status-im.contexts.wallet.add-account.create-account.style
(:require
[quo.foundations.colors :as colors]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.utils)
(ns status-im.contexts.wallet.add-account.create-account.utils)

(defn prepare-new-keypair
[{:keys [new-keypair address account-name account-color emoji derivation-path]}]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.create-account.view
(ns status-im.contexts.wallet.add-account.create-account.view
(:require
[clojure.string :as string]
[quo.core :as quo]
Expand All @@ -11,9 +11,9 @@
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.common.standard-authentication.core :as standard-auth]
[status-im.constants :as constants]
[status-im.contexts.wallet.add-account.create-account.style :as style]
[status-im.contexts.wallet.add-account.create-account.utils :as create-account.utils]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.contexts.wallet.create-account.style :as style]
[status-im.contexts.wallet.create-account.utils :as create-account.utils]
[status-im.contexts.wallet.sheets.account-origin.view :as account-origin]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.events.collectibles
(ns status-im.contexts.wallet.collectible.events
(:require [camel-snake-kebab.extras :as cske]
[taoensso.timbre :as log]
[utils.ethereum.chain :as chain]
Expand Down
22 changes: 22 additions & 0 deletions src/status_im/contexts/wallet/common/wizard/events.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(ns status-im.contexts.wallet.common.wizard.events
(:require [status-im.contexts.wallet.send.flow-config :as wallet-flow]
[utils.re-frame :as rf]))

(defn- wizard-find-next-screen
[db flow-id current-screen]
(let [flow-config (case flow-id
:wallet-flow wallet-flow/steps
nil)]
(first (filter (fn [{:keys [skip-step? screen-id]}]
(and (not= screen-id current-screen)
(not (and (fn? skip-step?) (skip-step? db)))))
flow-config))))

(rf/reg-event-fx
:wallet/wizard-navigate-forward
(fn [{:keys [db]} [{:keys [current-screen flow-id start-flow?]}]]
(let [next-screen (wizard-find-next-screen db flow-id current-screen)]
{:fx [[:dispatch
(if start-flow?
[:open-modal (:screen-id next-screen)]
[:navigate-to-within-stack [(:screen-id next-screen) current-screen]])]]})))
2 changes: 0 additions & 2 deletions src/status_im/contexts/wallet/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
[react-native.background-timer :as background-timer]
[react-native.platform :as platform]
[status-im.constants :as constants]
[status-im.contexts.wallet.accounts.add-account.address-to-watch.events]
[status-im.contexts.wallet.common.utils :as utils]
[status-im.contexts.wallet.data-store :as data-store]
[status-im.contexts.wallet.db :as db]
[status-im.contexts.wallet.events.collectibles]
[status-im.contexts.wallet.item-types :as item-types]
[taoensso.timbre :as log]
[utils.collection]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.events.saved-addresses
(ns status-im.contexts.wallet.save-address.events
(:require
[status-im.constants :as constants]
[utils.re-frame :as rf]))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.send.save-address.style)
(ns status-im.contexts.wallet.save-address.style)

(def title-input-container
{:padding-horizontal 20
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
(ns status-im.contexts.wallet.send.save-address.view
(ns status-im.contexts.wallet.save-address.view
(:require
[clojure.string :as string]
[quo.core :as quo]
[quo.theme]
[react-native.core :as rn]
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.contexts.wallet.send.save-address.style :as style]
[status-im.contexts.wallet.save-address.style :as style]
[status-im.contexts.wallet.sheets.network-preferences.view
:as network-preferences]
[utils.i18n :as i18n]
Expand Down
16 changes: 8 additions & 8 deletions src/status_im/core_spec.cljs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(ns status-im.core-spec
(:require
[status-im.common.floating-button-page.component-spec]
[status-im.contexts.chat.messenger.messages.content.audio.component-spec]
[status-im.contexts.communities.actions.community-options.component-spec]
[status-im.contexts.shell.share.wallet.component-spec]
[status-im.contexts.wallet.add-address-to-watch.component-spec]
[status-im.contexts.wallet.add-address-to-watch.confirm-address.component-spec]
[status-im.contexts.wallet.create-account.edit-derivation-path.component-spec]
[status-im.contexts.wallet.send.input-amount.component-spec]))
[status-im.common.floating-button-page.component-spec]
[status-im.contexts.chat.messenger.messages.content.audio.component-spec]
[status-im.contexts.communities.actions.community-options.component-spec]
[status-im.contexts.shell.share.wallet.component-spec]
[status-im.contexts.wallet.add-account.add-address-to-watch.component-spec]
[status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.component-spec]
[status-im.contexts.wallet.add-account.create-account.edit-derivation-path.component-spec]
[status-im.contexts.wallet.send.input-amount.component-spec]))
Loading

0 comments on commit 2e9303f

Please sign in to comment.