mirror of
https://github.com/status-im/status-mobile.git
synced 2025-03-01 08:40:50 +00:00
chore(wallet): some minor cleanups: move sheets to appropriate level, remove unused rf event, improve one rf event api (#18895)
This commit is contained in:
parent
0be66e28c1
commit
191c876f47
@ -7,8 +7,8 @@
|
|||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
[status-im.contexts.shell.share.style :as style]
|
[status-im.contexts.shell.share.style :as style]
|
||||||
[status-im.contexts.shell.share.wallet.style :as wallet-style]
|
[status-im.contexts.shell.share.wallet.style :as wallet-style]
|
||||||
[status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences]
|
|
||||||
[status-im.contexts.wallet.common.utils :as utils]
|
[status-im.contexts.wallet.common.utils :as utils]
|
||||||
|
[status-im.contexts.wallet.sheets.network-preferences.view :as network-preferences]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.image-server :as image-server]
|
[utils.image-server :as image-server]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
(ns status-im.contexts.wallet.common.account-switcher.view
|
(ns status-im.contexts.wallet.common.account-switcher.view
|
||||||
(:require [quo.core :as quo]
|
(:require [quo.core :as quo]
|
||||||
[status-im.contexts.wallet.common.sheets.account-options.view :as account-options]
|
[status-im.contexts.wallet.sheets.account-options.view :as account-options]
|
||||||
[status-im.contexts.wallet.common.sheets.network-filter.view :as network-filter]
|
[status-im.contexts.wallet.sheets.network-filter.view :as network-filter]
|
||||||
[status-im.contexts.wallet.common.sheets.select-account.view :as select-account]
|
[status-im.contexts.wallet.sheets.select-account.view :as select-account]
|
||||||
[status-im.feature-flags :as ff]
|
[status-im.feature-flags :as ff]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
||||||
|
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.select-account.style)
|
|
||||||
|
|
||||||
(def list-container
|
|
||||||
{:margin-horizontal 8})
|
|
@ -10,10 +10,10 @@
|
|||||||
[status-im.common.emoji-picker.utils :as emoji-picker.utils]
|
[status-im.common.emoji-picker.utils :as emoji-picker.utils]
|
||||||
[status-im.common.standard-authentication.core :as standard-auth]
|
[status-im.common.standard-authentication.core :as standard-auth]
|
||||||
[status-im.constants :as constants]
|
[status-im.constants :as constants]
|
||||||
[status-im.contexts.wallet.common.sheets.account-origin.view :as account-origin]
|
|
||||||
[status-im.contexts.wallet.common.utils :as utils]
|
[status-im.contexts.wallet.common.utils :as utils]
|
||||||
[status-im.contexts.wallet.create-account.style :as style]
|
[status-im.contexts.wallet.create-account.style :as style]
|
||||||
[status-im.contexts.wallet.create-account.utils :as create-account.utils]
|
[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.i18n :as i18n]
|
||||||
[utils.re-frame :as rf]
|
[utils.re-frame :as rf]
|
||||||
[utils.responsiveness :refer [iphone-11-Pro-20-pixel-from-width]]
|
[utils.responsiveness :refer [iphone-11-Pro-20-pixel-from-width]]
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
[status-im.contexts.wallet.common.screen-base.create-or-edit-account.view
|
[status-im.contexts.wallet.common.screen-base.create-or-edit-account.view
|
||||||
:as create-or-edit-account]
|
:as create-or-edit-account]
|
||||||
[status-im.contexts.wallet.common.sheets.network-preferences.view
|
|
||||||
:as network-preferences]
|
|
||||||
[status-im.contexts.wallet.common.sheets.remove-account.view :as remove-account]
|
|
||||||
[status-im.contexts.wallet.edit-account.style :as style]
|
[status-im.contexts.wallet.edit-account.style :as style]
|
||||||
|
[status-im.contexts.wallet.sheets.network-preferences.view
|
||||||
|
:as network-preferences]
|
||||||
|
[status-im.contexts.wallet.sheets.remove-account.view :as remove-account]
|
||||||
[status-im.feature-flags :as ff]
|
[status-im.feature-flags :as ff]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
[status-im.common.home.top-nav.view :as common.top-nav]
|
[status-im.common.home.top-nav.view :as common.top-nav]
|
||||||
[status-im.contexts.wallet.common.sheets.network-filter.view :as network-filter]
|
|
||||||
[status-im.contexts.wallet.home.style :as style]
|
[status-im.contexts.wallet.home.style :as style]
|
||||||
[status-im.contexts.wallet.home.tabs.view :as tabs]
|
[status-im.contexts.wallet.home.tabs.view :as tabs]
|
||||||
|
[status-im.contexts.wallet.sheets.network-filter.view :as network-filter]
|
||||||
[status-im.feature-flags :as ff]
|
[status-im.feature-flags :as ff]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
||||||
|
@ -45,20 +45,13 @@
|
|||||||
(update-in [:wallet :ui :send] dissoc :route)
|
(update-in [:wallet :ui :send] dissoc :route)
|
||||||
(update-in [:wallet :ui :send] dissoc :loading-suggested-routes?))}))
|
(update-in [:wallet :ui :send] dissoc :loading-suggested-routes?))}))
|
||||||
|
|
||||||
(rf/reg-event-fx :wallet/select-send-account-address
|
|
||||||
(fn [{:keys [db]} [{:keys [address stack-id]}]]
|
|
||||||
{:db (-> db
|
|
||||||
(assoc-in [:wallet :ui :send :send-account-address] address)
|
|
||||||
(update-in [:wallet :ui :send] dissoc :to-address))
|
|
||||||
:fx [[:dispatch [:navigate-to-within-stack [:wallet-select-asset stack-id]]]]}))
|
|
||||||
|
|
||||||
(rf/reg-event-fx :wallet/clean-send-address
|
(rf/reg-event-fx :wallet/clean-send-address
|
||||||
(fn [{:keys [db]}]
|
(fn [{:keys [db]}]
|
||||||
{:db (update-in db [:wallet :ui :send] dissoc :recipient :to-address)}))
|
{:db (update-in db [:wallet :ui :send] dissoc :recipient :to-address)}))
|
||||||
|
|
||||||
(rf/reg-event-fx
|
(rf/reg-event-fx
|
||||||
:wallet/select-send-address
|
:wallet/select-send-address
|
||||||
(fn [{:keys [db]} [{:keys [address token recipient stack-id]}]]
|
(fn [{:keys [db]} [{:keys [address token? recipient stack-id]}]]
|
||||||
(let [[prefix to-address] (utils/split-prefix-and-address address)
|
(let [[prefix to-address] (utils/split-prefix-and-address address)
|
||||||
test-net? (get-in db [:profile/profile :test-networks-enabled?])
|
test-net? (get-in db [:profile/profile :test-networks-enabled?])
|
||||||
goerli-enabled? (get-in db [:profile/profile :is-goerli-enabled?])
|
goerli-enabled? (get-in db [:profile/profile :is-goerli-enabled?])
|
||||||
@ -73,7 +66,7 @@
|
|||||||
(assoc-in [:wallet :ui :send :selected-networks] selected-networks))
|
(assoc-in [:wallet :ui :send :selected-networks] selected-networks))
|
||||||
:fx [[:dispatch
|
:fx [[:dispatch
|
||||||
[:navigate-to-within-stack
|
[:navigate-to-within-stack
|
||||||
(if token
|
(if token?
|
||||||
[:wallet-send-input-amount stack-id]
|
[:wallet-send-input-amount stack-id]
|
||||||
[:wallet-select-asset stack-id])]]]})))
|
[:wallet-select-asset stack-id])]]]})))
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
{:account-props (assoc account :customization-color color)
|
{:account-props (assoc account :customization-color color)
|
||||||
:on-press #(rf/dispatch [:wallet/select-send-address
|
:on-press #(rf/dispatch [:wallet/select-send-address
|
||||||
{:address address
|
{:address address
|
||||||
|
:token? false
|
||||||
:recipient account
|
:recipient account
|
||||||
:stack-id :wallet-select-address}])}])
|
:stack-id :wallet-select-address}])}])
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@
|
|||||||
(when-not ens
|
(when-not ens
|
||||||
(rf/dispatch [:wallet/select-send-address
|
(rf/dispatch [:wallet/select-send-address
|
||||||
{:address address
|
{:address address
|
||||||
|
:token? false
|
||||||
:recipient local-suggestion
|
:recipient local-suggestion
|
||||||
:stack-id :wallet-select-address}]))))
|
:stack-id :wallet-select-address}]))))
|
||||||
:active-state? false}]
|
:active-state? false}]
|
||||||
@ -156,7 +157,7 @@
|
|||||||
:disabled? (not valid-ens-or-address?)
|
:disabled? (not valid-ens-or-address?)
|
||||||
:on-press #(rf/dispatch [:wallet/select-send-address
|
:on-press #(rf/dispatch [:wallet/select-send-address
|
||||||
{:address @input-value
|
{:address @input-value
|
||||||
:token token
|
:token? (some? token)
|
||||||
:stack-id
|
:stack-id
|
||||||
:wallet-select-address}])
|
:wallet-select-address}])
|
||||||
:customization-color color}
|
:customization-color color}
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
[react-native.safe-area :as safe-area]
|
[react-native.safe-area :as safe-area]
|
||||||
[react-native.share :as share]
|
[react-native.share :as share]
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
[status-im.contexts.wallet.common.sheets.network-preferences.view :as network-preferences]
|
|
||||||
[status-im.contexts.wallet.common.utils :as utils]
|
[status-im.contexts.wallet.common.utils :as utils]
|
||||||
[status-im.contexts.wallet.share-address.style :as style]
|
[status-im.contexts.wallet.share-address.style :as style]
|
||||||
|
[status-im.contexts.wallet.sheets.network-preferences.view :as network-preferences]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.image-server :as image-server]
|
[utils.image-server :as image-server]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.account-options.style)
|
(ns status-im.contexts.wallet.sheets.account-options.style)
|
||||||
|
|
||||||
(def drawer-section-label
|
(def drawer-section-label
|
||||||
{:padding-horizontal 20
|
{:padding-horizontal 20
|
@ -1,4 +1,4 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.account-options.view
|
(ns status-im.contexts.wallet.sheets.account-options.view
|
||||||
(:require [oops.core :as oops]
|
(:require [oops.core :as oops]
|
||||||
[quo.core :as quo]
|
[quo.core :as quo]
|
||||||
[quo.foundations.colors :as colors]
|
[quo.foundations.colors :as colors]
|
||||||
@ -9,9 +9,9 @@
|
|||||||
[react-native.gesture :as gesture]
|
[react-native.gesture :as gesture]
|
||||||
[react-native.platform :as platform]
|
[react-native.platform :as platform]
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
[status-im.contexts.wallet.common.sheets.account-options.style :as style]
|
|
||||||
[status-im.contexts.wallet.common.sheets.remove-account.view :as remove-account]
|
|
||||||
[status-im.contexts.wallet.common.utils :as utils]
|
[status-im.contexts.wallet.common.utils :as utils]
|
||||||
|
[status-im.contexts.wallet.sheets.account-options.style :as style]
|
||||||
|
[status-im.contexts.wallet.sheets.remove-account.view :as remove-account]
|
||||||
[status-im.feature-flags :as ff]
|
[status-im.feature-flags :as ff]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
@ -1,4 +1,4 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.account-origin.style
|
(ns status-im.contexts.wallet.sheets.account-origin.style
|
||||||
(:require [react-native.platform :as platform]))
|
(:require [react-native.platform :as platform]))
|
||||||
|
|
||||||
(def header-container
|
(def header-container
|
@ -1,10 +1,10 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.account-origin.view
|
(ns status-im.contexts.wallet.sheets.account-origin.view
|
||||||
(:require
|
(:require
|
||||||
[quo.core :as quo]
|
[quo.core :as quo]
|
||||||
[quo.theme]
|
[quo.theme]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[status-im.constants :as const]
|
[status-im.constants :as const]
|
||||||
[status-im.contexts.wallet.common.sheets.account-origin.style :as style]
|
[status-im.contexts.wallet.sheets.account-origin.style :as style]
|
||||||
[utils.i18n :as i18n]))
|
[utils.i18n :as i18n]))
|
||||||
|
|
||||||
(defn- header
|
(defn- header
|
@ -1,4 +1,4 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.network-filter.view
|
(ns status-im.contexts.wallet.sheets.network-filter.view
|
||||||
(:require
|
(:require
|
||||||
[quo.core :as quo]
|
[quo.core :as quo]
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
@ -1,4 +1,4 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.network-preferences.style
|
(ns status-im.contexts.wallet.sheets.network-preferences.style
|
||||||
(:require [quo.foundations.colors :as colors]))
|
(:require [quo.foundations.colors :as colors]))
|
||||||
|
|
||||||
(def blur
|
(def blur
|
@ -1,11 +1,11 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.network-preferences.view
|
(ns status-im.contexts.wallet.sheets.network-preferences.view
|
||||||
(:require [quo.core :as quo]
|
(:require [quo.core :as quo]
|
||||||
[quo.foundations.colors :as colors]
|
[quo.foundations.colors :as colors]
|
||||||
[quo.theme :as quo.theme]
|
[quo.theme :as quo.theme]
|
||||||
[react-native.blur :as blur]
|
[react-native.blur :as blur]
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
[status-im.contexts.wallet.common.sheets.network-preferences.style :as style]
|
|
||||||
[status-im.contexts.wallet.common.utils :as utils]
|
[status-im.contexts.wallet.common.utils :as utils]
|
||||||
|
[status-im.contexts.wallet.sheets.network-preferences.style :as style]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.remove-account.style)
|
(ns status-im.contexts.wallet.sheets.remove-account.style)
|
||||||
|
|
||||||
(def desc-container
|
(def desc-container
|
||||||
{:padding-horizontal 20
|
{:padding-horizontal 20
|
@ -1,12 +1,12 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.remove-account.view
|
(ns status-im.contexts.wallet.sheets.remove-account.view
|
||||||
(:require
|
(:require
|
||||||
[quo.core :as quo]
|
[quo.core :as quo]
|
||||||
[quo.theme]
|
[quo.theme]
|
||||||
[react-native.clipboard :as clipboard]
|
[react-native.clipboard :as clipboard]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
[status-im.contexts.wallet.common.sheets.remove-account.style :as style]
|
|
||||||
[status-im.contexts.wallet.common.utils :as utils]
|
[status-im.contexts.wallet.common.utils :as utils]
|
||||||
|
[status-im.contexts.wallet.sheets.remove-account.style :as style]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
(ns status-im.contexts.wallet.sheets.select-account.style)
|
||||||
|
|
||||||
|
(def list-container
|
||||||
|
{:margin-horizontal 8})
|
@ -1,8 +1,8 @@
|
|||||||
(ns status-im.contexts.wallet.common.sheets.select-account.view
|
(ns status-im.contexts.wallet.sheets.select-account.view
|
||||||
(:require [quo.core :as quo]
|
(:require [quo.core :as quo]
|
||||||
quo.theme
|
quo.theme
|
||||||
[react-native.gesture :as gesture]
|
[react-native.gesture :as gesture]
|
||||||
[status-im.contexts.wallet.common.sheets.select-account.style :as style]
|
[status-im.contexts.wallet.sheets.select-account.style :as style]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user