From 7eb08ea7304b13aaf2aa6370ff8619b2db95a454 Mon Sep 17 00:00:00 2001 From: Jamie Caprani Date: Tue, 9 Apr 2024 15:13:41 +0100 Subject: [PATCH] chore(wallet): move add-account funcitonality into its own folder --- .../add_address_to_watch/component_spec.cljs | 4 ++-- .../confirm_address/component_spec.cljs | 4 ++-- .../confirm_address/style.cljs | 2 +- .../confirm_address/view.cljs | 4 ++-- .../add_address_to_watch}/events.cljs | 2 +- .../add_address_to_watch/style.cljs | 2 +- .../add_address_to_watch/view.cljs | 4 ++-- .../path_format_sheet/view.cljs | 2 +- .../edit_derivation_path/style.cljs | 3 ++- .../edit_derivation_path/view.cljs | 8 +++---- .../create_account/events.cljs | 2 +- .../create_account/events_test.cljs | 4 ++-- .../backup_recovery_phrase/style.cljs | 2 +- .../backup_recovery_phrase/view.cljs | 5 ++-- .../new_keypair/check_your_backup/style.cljs | 2 +- .../new_keypair/check_your_backup/view.cljs | 4 ++-- .../new_keypair/keypair_name/style.cljs | 2 +- .../new_keypair/keypair_name/view.cljs | 4 ++-- .../create_account/select_keypair/style.cljs | 2 +- .../create_account/select_keypair/view.cljs | 4 ++-- .../create_account/style.cljs | 2 +- .../create_account/utils.cljs | 2 +- .../create_account/view.cljs | 6 ++--- .../events.cljs} | 2 +- .../contexts/wallet/common/wizard/events.cljs | 22 +++++++++++++++++ src/status_im/contexts/wallet/events.cljs | 2 -- .../contexts/wallet/events_test.cljs | 18 +++++++------- .../events.cljs} | 2 +- .../wallet/{send => }/save_address/style.cljs | 2 +- .../wallet/{send => }/save_address/view.cljs | 4 ++-- src/status_im/core_spec.cljs | 4 ++-- src/status_im/events.cljs | 6 +++-- src/status_im/navigation/screens.cljs | 24 ++++++++++--------- 33 files changed, 94 insertions(+), 68 deletions(-) rename src/status_im/contexts/wallet/{ => add_account}/add_address_to_watch/component_spec.cljs (89%) rename src/status_im/contexts/wallet/{ => add_account}/add_address_to_watch/confirm_address/component_spec.cljs (70%) rename src/status_im/contexts/wallet/{ => add_account}/add_address_to_watch/confirm_address/style.cljs (59%) rename src/status_im/contexts/wallet/{ => add_account}/add_address_to_watch/confirm_address/view.cljs (94%) rename src/status_im/contexts/wallet/{accounts/add_account/address_to_watch => add_account/add_address_to_watch}/events.cljs (97%) rename src/status_im/contexts/wallet/{ => add_account}/add_address_to_watch/style.cljs (78%) rename src/status_im/contexts/wallet/{ => add_account}/add_address_to_watch/view.cljs (98%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/edit_derivation_path/path_format_sheet/view.cljs (94%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/edit_derivation_path/style.cljs (92%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/edit_derivation_path/view.cljs (96%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/events.cljs (97%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/events_test.cljs (94%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/new_keypair/backup_recovery_phrase/style.cljs (93%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/new_keypair/backup_recovery_phrase/view.cljs (95%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/new_keypair/check_your_backup/style.cljs (85%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/new_keypair/check_your_backup/view.cljs (96%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/new_keypair/keypair_name/style.cljs (70%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/new_keypair/keypair_name/view.cljs (95%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/select_keypair/style.cljs (64%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/select_keypair/view.cljs (96%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/style.cljs (91%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/utils.cljs (93%) rename src/status_im/contexts/wallet/{ => add_account}/create_account/view.cljs (97%) rename src/status_im/contexts/wallet/{events/collectibles.cljs => collectible/events.cljs} (99%) create mode 100644 src/status_im/contexts/wallet/common/wizard/events.cljs rename src/status_im/contexts/wallet/{events/saved_addresses.cljs => save_address/events.cljs} (96%) rename src/status_im/contexts/wallet/{send => }/save_address/style.cljs (92%) rename src/status_im/contexts/wallet/{send => }/save_address/view.cljs (96%) diff --git a/src/status_im/contexts/wallet/add_address_to_watch/component_spec.cljs b/src/status_im/contexts/wallet/add_account/add_address_to_watch/component_spec.cljs similarity index 89% rename from src/status_im/contexts/wallet/add_address_to_watch/component_spec.cljs rename to src/status_im/contexts/wallet/add_account/add_address_to_watch/component_spec.cljs index c12b109dfed4..a833efc92708 100644 --- a/src/status_im/contexts/wallet/add_address_to_watch/component_spec.cljs +++ b/src/status_im/contexts/wallet/add_account/add_address_to_watch/component_spec.cljs @@ -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])) diff --git a/src/status_im/contexts/wallet/add_address_to_watch/confirm_address/component_spec.cljs b/src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/component_spec.cljs similarity index 70% rename from src/status_im/contexts/wallet/add_address_to_watch/confirm_address/component_spec.cljs rename to src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/component_spec.cljs index 5c08c18ee5c3..fe06b24e06a8 100644 --- a/src/status_im/contexts/wallet/add_address_to_watch/confirm_address/component_spec.cljs +++ b/src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/component_spec.cljs @@ -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" diff --git a/src/status_im/contexts/wallet/add_address_to_watch/confirm_address/style.cljs b/src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/style.cljs similarity index 59% rename from src/status_im/contexts/wallet/add_address_to_watch/confirm_address/style.cljs rename to src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/style.cljs index e807808a27a2..155ba5987c21 100644 --- a/src/status_im/contexts/wallet/add_address_to_watch/confirm_address/style.cljs +++ b/src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/style.cljs @@ -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}) diff --git a/src/status_im/contexts/wallet/add_address_to_watch/confirm_address/view.cljs b/src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/view.cljs similarity index 94% rename from src/status_im/contexts/wallet/add_address_to_watch/confirm_address/view.cljs rename to src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/view.cljs index c9cb8b3c4fc2..b1a2b5c81420 100644 --- a/src/status_im/contexts/wallet/add_address_to_watch/confirm_address/view.cljs +++ b/src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/view.cljs @@ -1,4 +1,4 @@ -(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] @@ -6,7 +6,7 @@ [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] diff --git a/src/status_im/contexts/wallet/accounts/add_account/address_to_watch/events.cljs b/src/status_im/contexts/wallet/add_account/add_address_to_watch/events.cljs similarity index 97% rename from src/status_im/contexts/wallet/accounts/add_account/address_to_watch/events.cljs rename to src/status_im/contexts/wallet/add_account/add_address_to_watch/events.cljs index 2900c20ef254..1720011cc1df 100644 --- a/src/status_im/contexts/wallet/accounts/add_account/address_to_watch/events.cljs +++ b/src/status_im/contexts/wallet/add_account/add_address_to_watch/events.cljs @@ -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.contexts.wallet.common.utils :as utils] [taoensso.timbre :as log] diff --git a/src/status_im/contexts/wallet/add_address_to_watch/style.cljs b/src/status_im/contexts/wallet/add_account/add_address_to_watch/style.cljs similarity index 78% rename from src/status_im/contexts/wallet/add_address_to_watch/style.cljs rename to src/status_im/contexts/wallet/add_account/add_address_to_watch/style.cljs index 4b8e3a6f0076..a97933ce2e18 100644 --- a/src/status_im/contexts/wallet/add_address_to_watch/style.cljs +++ b/src/status_im/contexts/wallet/add_account/add_address_to_watch/style.cljs @@ -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}) diff --git a/src/status_im/contexts/wallet/add_address_to_watch/view.cljs b/src/status_im/contexts/wallet/add_account/add_address_to_watch/view.cljs similarity index 98% rename from src/status_im/contexts/wallet/add_address_to_watch/view.cljs rename to src/status_im/contexts/wallet/add_account/add_address_to_watch/view.cljs index 0de89e906a45..07bf00c3d966 100644 --- a/src/status_im/contexts/wallet/add_address_to_watch/view.cljs +++ b/src/status_im/contexts/wallet/add_account/add_address_to_watch/view.cljs @@ -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] @@ -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] diff --git a/src/status_im/contexts/wallet/create_account/edit_derivation_path/path_format_sheet/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/edit_derivation_path/path_format_sheet/view.cljs similarity index 94% rename from src/status_im/contexts/wallet/create_account/edit_derivation_path/path_format_sheet/view.cljs rename to src/status_im/contexts/wallet/add_account/create_account/edit_derivation_path/path_format_sheet/view.cljs index 6475f4b334d2..469434ed1c63 100644 --- a/src/status_im/contexts/wallet/create_account/edit_derivation_path/path_format_sheet/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/edit_derivation_path/path_format_sheet/view.cljs @@ -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] diff --git a/src/status_im/contexts/wallet/create_account/edit_derivation_path/style.cljs b/src/status_im/contexts/wallet/add_account/create_account/edit_derivation_path/style.cljs similarity index 92% rename from src/status_im/contexts/wallet/create_account/edit_derivation_path/style.cljs rename to src/status_im/contexts/wallet/add_account/create_account/edit_derivation_path/style.cljs index f9ce232cc9a3..d5f6c1c25234 100644 --- a/src/status_im/contexts/wallet/create_account/edit_derivation_path/style.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/edit_derivation_path/style.cljs @@ -1,6 +1,7 @@ -(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 [top] {:flex 1 diff --git a/src/status_im/contexts/wallet/create_account/edit_derivation_path/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/edit_derivation_path/view.cljs similarity index 96% rename from src/status_im/contexts/wallet/create_account/edit_derivation_path/view.cljs rename to src/status_im/contexts/wallet/add_account/create_account/edit_derivation_path/view.cljs index 1dbd641faba9..4973bbe1333f 100644 --- a/src/status_im/contexts/wallet/create_account/edit_derivation_path/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/edit_derivation_path/view.cljs @@ -1,4 +1,4 @@ -(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 [clojure.string :as string] [quo.core :as quo] @@ -7,10 +7,10 @@ [react-native.core :as rn] [react-native.safe-area :as safe-area] [reagent.core :as reagent] - [status-im.contexts.wallet.common.utils :as utils] - [status-im.contexts.wallet.create-account.edit-derivation-path.path-format-sheet.view :as + [status-im.contexts.wallet.add-account.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] + [status-im.contexts.wallet.add-account.create-account.edit-derivation-path.style :as style] + [status-im.contexts.wallet.common.utils :as utils] [utils.i18n :as i18n] [utils.re-frame :as rf] [utils.security.core :as security])) diff --git a/src/status_im/contexts/wallet/create_account/events.cljs b/src/status_im/contexts/wallet/add_account/create_account/events.cljs similarity index 97% rename from src/status_im/contexts/wallet/create_account/events.cljs rename to src/status_im/contexts/wallet/add_account/create_account/events.cljs index 07ae02ae89cd..3f4d912e8cba 100644 --- a/src/status_im/contexts/wallet/create_account/events.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/events.cljs @@ -1,4 +1,4 @@ -(ns status-im.contexts.wallet.create-account.events +(ns status-im.contexts.wallet.add-account.create-account.events (:require [camel-snake-kebab.extras :as cske] [status-im.contexts.wallet.data-store :as data-store] [utils.re-frame :as rf] diff --git a/src/status_im/contexts/wallet/create_account/events_test.cljs b/src/status_im/contexts/wallet/add_account/create_account/events_test.cljs similarity index 94% rename from src/status_im/contexts/wallet/create_account/events_test.cljs rename to src/status_im/contexts/wallet/add_account/create_account/events_test.cljs index 4ced4d4b3815..b1d9b9647cd9 100644 --- a/src/status_im/contexts/wallet/create_account/events_test.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/events_test.cljs @@ -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 {}}}} diff --git a/src/status_im/contexts/wallet/create_account/new_keypair/backup_recovery_phrase/style.cljs b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/style.cljs similarity index 93% rename from src/status_im/contexts/wallet/create_account/new_keypair/backup_recovery_phrase/style.cljs rename to src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/style.cljs index 28a87186974c..fcae25100061 100644 --- a/src/status_im/contexts/wallet/create_account/new_keypair/backup_recovery_phrase/style.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/style.cljs @@ -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] diff --git a/src/status_im/contexts/wallet/create_account/new_keypair/backup_recovery_phrase/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/view.cljs similarity index 95% rename from src/status_im/contexts/wallet/create_account/new_keypair/backup_recovery_phrase/view.cljs rename to src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/view.cljs index 752150d97852..d2f8369f7c85 100644 --- a/src/status_im/contexts/wallet/create_account/new_keypair/backup_recovery_phrase/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/view.cljs @@ -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] @@ -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])) diff --git a/src/status_im/contexts/wallet/create_account/new_keypair/check_your_backup/style.cljs b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/check_your_backup/style.cljs similarity index 85% rename from src/status_im/contexts/wallet/create_account/new_keypair/check_your_backup/style.cljs rename to src/status_im/contexts/wallet/add_account/create_account/new_keypair/check_your_backup/style.cljs index 39d689230063..2e4ef3631872 100644 --- a/src/status_im/contexts/wallet/create_account/new_keypair/check_your_backup/style.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/check_your_backup/style.cljs @@ -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 diff --git a/src/status_im/contexts/wallet/create_account/new_keypair/check_your_backup/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/check_your_backup/view.cljs similarity index 96% rename from src/status_im/contexts/wallet/create_account/new_keypair/check_your_backup/view.cljs rename to src/status_im/contexts/wallet/add_account/create_account/new_keypair/check_your_backup/view.cljs index 62916c48c03b..9d443f24fa2a 100644 --- a/src/status_im/contexts/wallet/create_account/new_keypair/check_your_backup/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/check_your_backup/view.cljs @@ -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])) diff --git a/src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/style.cljs b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/keypair_name/style.cljs similarity index 70% rename from src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/style.cljs rename to src/status_im/contexts/wallet/add_account/create_account/new_keypair/keypair_name/style.cljs index d5792ba0a1b7..e59b907d2566 100644 --- a/src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/style.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/keypair_name/style.cljs @@ -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 diff --git a/src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/keypair_name/view.cljs similarity index 95% rename from src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs rename to src/status_im/contexts/wallet/add_account/create_account/new_keypair/keypair_name/view.cljs index 8d44dce83902..a30a8489ccbb 100644 --- a/src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/new_keypair/keypair_name/view.cljs @@ -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])) diff --git a/src/status_im/contexts/wallet/create_account/select_keypair/style.cljs b/src/status_im/contexts/wallet/add_account/create_account/select_keypair/style.cljs similarity index 64% rename from src/status_im/contexts/wallet/create_account/select_keypair/style.cljs rename to src/status_im/contexts/wallet/add_account/create_account/select_keypair/style.cljs index 61fa431ebdb1..739201f3f91f 100644 --- a/src/status_im/contexts/wallet/create_account/select_keypair/style.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/select_keypair/style.cljs @@ -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}) diff --git a/src/status_im/contexts/wallet/create_account/select_keypair/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs similarity index 96% rename from src/status_im/contexts/wallet/create_account/select_keypair/view.cljs rename to src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs index bedd8c83f926..89f2831efb7f 100644 --- a/src/status_im/contexts/wallet/create_account/select_keypair/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs @@ -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])) diff --git a/src/status_im/contexts/wallet/create_account/style.cljs b/src/status_im/contexts/wallet/add_account/create_account/style.cljs similarity index 91% rename from src/status_im/contexts/wallet/create_account/style.cljs rename to src/status_im/contexts/wallet/add_account/create_account/style.cljs index e381c88b11a1..bd2d3afb510d 100644 --- a/src/status_im/contexts/wallet/create_account/style.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/style.cljs @@ -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])) diff --git a/src/status_im/contexts/wallet/create_account/utils.cljs b/src/status_im/contexts/wallet/add_account/create_account/utils.cljs similarity index 93% rename from src/status_im/contexts/wallet/create_account/utils.cljs rename to src/status_im/contexts/wallet/add_account/create_account/utils.cljs index 7af9ddb1e8ed..844ed6a6af43 100644 --- a/src/status_im/contexts/wallet/create_account/utils.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/utils.cljs @@ -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]}] diff --git a/src/status_im/contexts/wallet/create_account/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/view.cljs similarity index 97% rename from src/status_im/contexts/wallet/create_account/view.cljs rename to src/status_im/contexts/wallet/add_account/create_account/view.cljs index c03586d60cda..43219cc93249 100644 --- a/src/status_im/contexts/wallet/create_account/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/view.cljs @@ -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] @@ -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] [status-im.feature-flags :as ff] [utils.i18n :as i18n] diff --git a/src/status_im/contexts/wallet/events/collectibles.cljs b/src/status_im/contexts/wallet/collectible/events.cljs similarity index 99% rename from src/status_im/contexts/wallet/events/collectibles.cljs rename to src/status_im/contexts/wallet/collectible/events.cljs index 3ba508aef770..40f6ef9a8507 100644 --- a/src/status_im/contexts/wallet/events/collectibles.cljs +++ b/src/status_im/contexts/wallet/collectible/events.cljs @@ -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] diff --git a/src/status_im/contexts/wallet/common/wizard/events.cljs b/src/status_im/contexts/wallet/common/wizard/events.cljs new file mode 100644 index 000000000000..92948592e3b2 --- /dev/null +++ b/src/status_im/contexts/wallet/common/wizard/events.cljs @@ -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]])]]}))) diff --git a/src/status_im/contexts/wallet/events.cljs b/src/status_im/contexts/wallet/events.cljs index be8d07f885cf..c8693dd3d454 100644 --- a/src/status_im/contexts/wallet/events.cljs +++ b/src/status_im/contexts/wallet/events.cljs @@ -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] diff --git a/src/status_im/contexts/wallet/events_test.cljs b/src/status_im/contexts/wallet/events_test.cljs index 7568e4438b4e..59c4a7ffc4cd 100644 --- a/src/status_im/contexts/wallet/events_test.cljs +++ b/src/status_im/contexts/wallet/events_test.cljs @@ -1,11 +1,11 @@ (ns status-im.contexts.wallet.events-test (:require - [cljs.test :refer-macros [deftest is testing]] - matcher-combinators.test - [status-im.constants :as constants] - [status-im.contexts.wallet.db :as db] - [status-im.contexts.wallet.events :as events] - [status-im.contexts.wallet.events.collectibles :as collectibles])) + [cljs.test :refer-macros [deftest is testing]] + matcher-combinators.test + [status-im.constants :as constants] + [status-im.contexts.wallet.collectible.events :as collectible-events] + [status-im.contexts.wallet.db :as db] + [status-im.contexts.wallet.events :as events])) (def address "0x2f88d65f3cb52605a54a833ae118fb1363acccd2") @@ -47,7 +47,7 @@ :accounts {"0x1" {:collectibles (list collectible-1 collectible-2)} "0x2" {:collectibles (list collectible-3)} "0x3" {}}}} - result-db (:db (collectibles/flush-collectibles {:db db}))] + result-db (:db (collectible-events/flush-collectibles {:db db}))] (is (match? result-db expected-db))))) @@ -60,7 +60,7 @@ (let [expected-db {:wallet {:accounts {"0x1" {} "0x2" {"some other stuff" "with any value"} "0x3" {}}}} - effects (collectibles/clear-stored-collectibles {:db db}) + effects (collectible-events/clear-stored-collectibles {:db db}) result-db (:db effects)] (is (match? result-db expected-db)))))) @@ -72,7 +72,7 @@ :image-url "https://..."} expected-db {:wallet {:last-collectible-details {:description "Pandaria" :image-url "https://..."}}} - effects (collectibles/store-last-collectible-details {:db db} [last-collectible]) + effects (collectible-events/store-last-collectible-details {:db db} [last-collectible]) result-db (:db effects)] (is (match? result-db expected-db))))) diff --git a/src/status_im/contexts/wallet/events/saved_addresses.cljs b/src/status_im/contexts/wallet/save_address/events.cljs similarity index 96% rename from src/status_im/contexts/wallet/events/saved_addresses.cljs rename to src/status_im/contexts/wallet/save_address/events.cljs index 24123737ef86..4cdf02294d91 100644 --- a/src/status_im/contexts/wallet/events/saved_addresses.cljs +++ b/src/status_im/contexts/wallet/save_address/events.cljs @@ -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])) diff --git a/src/status_im/contexts/wallet/send/save_address/style.cljs b/src/status_im/contexts/wallet/save_address/style.cljs similarity index 92% rename from src/status_im/contexts/wallet/send/save_address/style.cljs rename to src/status_im/contexts/wallet/save_address/style.cljs index 1243076f2219..f218adef558f 100644 --- a/src/status_im/contexts/wallet/send/save_address/style.cljs +++ b/src/status_im/contexts/wallet/save_address/style.cljs @@ -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 diff --git a/src/status_im/contexts/wallet/send/save_address/view.cljs b/src/status_im/contexts/wallet/save_address/view.cljs similarity index 96% rename from src/status_im/contexts/wallet/send/save_address/view.cljs rename to src/status_im/contexts/wallet/save_address/view.cljs index cbb4ac4f98ed..cb1b7ea10d1e 100644 --- a/src/status_im/contexts/wallet/send/save_address/view.cljs +++ b/src/status_im/contexts/wallet/save_address/view.cljs @@ -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] diff --git a/src/status_im/core_spec.cljs b/src/status_im/core_spec.cljs index 866c783af3be..50231a246b41 100644 --- a/src/status_im/core_spec.cljs +++ b/src/status_im/core_spec.cljs @@ -4,6 +4,6 @@ [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.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.send.input-amount.component-spec])) diff --git a/src/status_im/events.cljs b/src/status_im/events.cljs index 9f6dfcc3f56b..8a5dd73efa22 100644 --- a/src/status_im/events.cljs +++ b/src/status_im/events.cljs @@ -29,8 +29,10 @@ status-im.contexts.shell.qr-reader.events status-im.contexts.shell.share.events status-im.contexts.syncing.events - status-im.contexts.wallet.common.wizard - status-im.contexts.wallet.create-account.events + status-im.contexts.wallet.add-account.add-address-to-watch.events + status-im.contexts.wallet.add-account.create-account.events + status-im.contexts.wallet.collectible.events + status-im.contexts.wallet.common.wizard.events status-im.contexts.wallet.effects status-im.contexts.wallet.events status-im.contexts.wallet.send.events diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index 62643f91eaf0..c65055d5a3a3 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -60,24 +60,26 @@ [status-im.contexts.wallet.account.edit-account.view :as wallet-edit-account] [status-im.contexts.wallet.account.share-address.view :as wallet-share-address] [status-im.contexts.wallet.account.view :as wallet-accounts] - [status-im.contexts.wallet.add-address-to-watch.confirm-address.view :as + [status-im.contexts.wallet.add-account.add-address-to-watch.confirm-address.view :as wallet-confirm-address-to-watch] - [status-im.contexts.wallet.add-address-to-watch.view :as wallet-add-address-to-watch] + [status-im.contexts.wallet.add-account.add-address-to-watch.view :as wallet-add-address-to-watch] + [status-im.contexts.wallet.add-account.create-account.edit-derivation-path.view :as + wallet-edit-derivation-path] + [status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.view :as + wallet-backup-recovery-phrase] + [status-im.contexts.wallet.add-account.create-account.new-keypair.check-your-backup.view :as + wallet-check-your-backup] + [status-im.contexts.wallet.add-account.create-account.new-keypair.keypair-name.view :as + wallet-keypair-name] + [status-im.contexts.wallet.add-account.create-account.select-keypair.view :as wallet-select-keypair] + [status-im.contexts.wallet.add-account.create-account.view :as wallet-create-account] [status-im.contexts.wallet.bridge.bridge-to.view :as wallet-bridge-to] [status-im.contexts.wallet.bridge.input-amount.view :as wallet-bridge-input-amount] [status-im.contexts.wallet.bridge.select-asset.view :as wallet-bridge-select-asset] [status-im.contexts.wallet.collectible.view :as wallet-collectible] [status-im.contexts.wallet.common.scan-account.view :as wallet-scan-address] - [status-im.contexts.wallet.create-account.edit-derivation-path.view :as wallet-edit-derivation-path] - [status-im.contexts.wallet.create-account.new-keypair.backup-recovery-phrase.view :as - wallet-backup-recovery-phrase] - [status-im.contexts.wallet.create-account.new-keypair.check-your-backup.view :as - wallet-check-your-backup] - [status-im.contexts.wallet.create-account.new-keypair.keypair-name.view :as wallet-keypair-name] - [status-im.contexts.wallet.create-account.select-keypair.view :as wallet-select-keypair] - [status-im.contexts.wallet.create-account.view :as wallet-create-account] + [status-im.contexts.wallet.save-address.view :as wallet-save-address] [status-im.contexts.wallet.send.from.view :as wallet-select-from] - [status-im.contexts.wallet.send.save-address.view :as wallet-save-address] [status-im.contexts.wallet.send.select-address.view :as wallet-select-address] [status-im.contexts.wallet.send.select-asset.view :as wallet-select-asset] [status-im.contexts.wallet.send.select-collectible-amount.view :as wallet-select-collectible-amount]