chore(wallet): move bridge to its own folder (#19414)

This commit is contained in:
Jamie Caprani 2024-03-28 19:42:43 +00:00 committed by GitHub
parent ed824bdb06
commit 88d1a17a94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 35 additions and 36 deletions

View File

@ -78,15 +78,14 @@
;; status-go will consider all possible addresses and the user will see the ;; status-go will consider all possible addresses and the user will see the
;; incorrect highest permission role. ;; incorrect highest permission role.
{:db (update db :communities/permissions-checks-for-selection dissoc community-id)} {:db (update db :communities/permissions-checks-for-selection dissoc community-id)}
(let [{:keys [checking?]} (get-in db [:communities/permissions-checks-for-selection community-id])] {:db (assoc-in db [:communities/permissions-checks-for-selection community-id :checking?] true)
{:db (assoc-in db [:communities/permissions-checks-for-selection community-id :checking?] true) :fx [[:json-rpc/call
:fx [[:json-rpc/call [{:method :wakuext_checkPermissionsToJoinCommunity
[{:method :wakuext_checkPermissionsToJoinCommunity :params [{:communityId community-id :addresses addresses}]
:params [{:communityId community-id :addresses addresses}] :on-success [:communities/check-permissions-to-join-during-selection-success
:on-success [:communities/check-permissions-to-join-during-selection-success community-id]
community-id] :on-error [:communities/check-permissions-to-join-during-selection-failure
:on-error [:communities/check-permissions-to-join-during-selection-failure community-id addresses]}]]]}))
community-id addresses]}]]]})))
;; This event should be used to check permissions temporarily because it won't ;; This event should be used to check permissions temporarily because it won't
;; mutate the state `:communities/permissions-check` (used by many other ;; mutate the state `:communities/permissions-check` (used by many other

View File

@ -1,4 +0,0 @@
(ns status-im.contexts.wallet.account.bridge-send.style)
(def bridge-send-wrapper
{:flex 1})

View File

@ -1,5 +0,0 @@
(ns status-im.contexts.wallet.account.bridge-to.style)
(def content-container
{:padding-horizontal 8})

View File

@ -0,0 +1,5 @@
(ns status-im.contexts.wallet.bridge.bridge-to.style)
(def content-container
{:padding-horizontal 8})

View File

@ -1,11 +1,11 @@
(ns status-im.contexts.wallet.account.bridge-to.view (ns status-im.contexts.wallet.bridge.bridge-to.view
(:require (:require
[clojure.string :as string] [clojure.string :as string]
[quo.core :as quo] [quo.core :as quo]
[quo.foundations.resources :as quo.resources] [quo.foundations.resources :as quo.resources]
[quo.theme] [quo.theme]
[react-native.core :as rn] [react-native.core :as rn]
[status-im.contexts.wallet.account.bridge-to.style :as style] [status-im.contexts.wallet.bridge.bridge-to.style :as style]
[status-im.contexts.wallet.common.account-switcher.view :as account-switcher] [status-im.contexts.wallet.common.account-switcher.view :as account-switcher]
[status-im.contexts.wallet.common.utils :as utils] [status-im.contexts.wallet.common.utils :as utils]
[utils.i18n :as i18n] [utils.i18n :as i18n]

View File

@ -0,0 +1,4 @@
(ns status-im.contexts.wallet.bridge.input-amount.style)
(def bridge-send-wrapper
{:flex 1})

View File

@ -1,8 +1,8 @@
(ns status-im.contexts.wallet.account.bridge-send.view (ns status-im.contexts.wallet.bridge.input-amount.view
(:require (:require
[quo.theme] [quo.theme]
[react-native.core :as rn] [react-native.core :as rn]
[status-im.contexts.wallet.account.bridge-send.style :as style] [status-im.contexts.wallet.bridge.input-amount.style :as style]
[status-im.contexts.wallet.send.input-amount.view :as input-amount] [status-im.contexts.wallet.send.input-amount.view :as input-amount]
[utils.i18n :as i18n] [utils.i18n :as i18n]
[utils.re-frame :as rf])) [utils.re-frame :as rf]))
@ -11,7 +11,7 @@
[] []
[rn/view {:style style/bridge-send-wrapper} [rn/view {:style style/bridge-send-wrapper}
[input-amount/view [input-amount/view
{:current-screen-id :screen/wallet.bridge-send {:current-screen-id :screen/wallet.bridge-input-amount
:button-one-label (i18n/label :t/confirm-bridge) :button-one-label (i18n/label :t/confirm-bridge)
:button-one-props {:icon-left :i/bridge} :button-one-props {:icon-left :i/bridge}
:on-navigate-back (fn [] :on-navigate-back (fn []

View File

@ -1,4 +1,4 @@
(ns status-im.contexts.wallet.account.bridge.style) (ns status-im.contexts.wallet.bridge.select-asset.style)
(def input-container (def input-container
{:padding-horizontal 20 {:padding-horizontal 20

View File

@ -1,9 +1,9 @@
(ns status-im.contexts.wallet.account.bridge.view (ns status-im.contexts.wallet.bridge.select-asset.view
(:require (:require
[quo.core :as quo] [quo.core :as quo]
[react-native.core :as rn] [react-native.core :as rn]
[reagent.core :as reagent] [reagent.core :as reagent]
[status-im.contexts.wallet.account.bridge.style :as style] [status-im.contexts.wallet.bridge.select-asset.style :as style]
[status-im.contexts.wallet.common.account-switcher.view :as account-switcher] [status-im.contexts.wallet.common.account-switcher.view :as account-switcher]
[status-im.contexts.wallet.common.asset-list.view :as asset-list] [status-im.contexts.wallet.common.asset-list.view :as asset-list]
[utils.i18n :as i18n] [utils.i18n :as i18n]
@ -28,4 +28,4 @@
:on-token-press (fn [token] :on-token-press (fn [token]
(rf/dispatch [:wallet/bridge-select-token (rf/dispatch [:wallet/bridge-select-token
{:token token {:token token
:stack-id :screen/wallet.bridge}]))}]]))) :stack-id :screen/wallet.bridge-select-asset}]))}]])))

View File

@ -245,12 +245,12 @@
(rf/reg-event-fx :wallet/start-bridge (rf/reg-event-fx :wallet/start-bridge
(fn [{:keys [db]}] (fn [{:keys [db]}]
{:db (assoc-in db [:wallet :ui :send :tx-type] :bridge) {:db (assoc-in db [:wallet :ui :send :tx-type] :bridge)
:fx [[:dispatch [:open-modal :screen/wallet.bridge]]]})) :fx [[:dispatch [:open-modal :screen/wallet.bridge-select-asset]]]}))
(rf/reg-event-fx :wallet/select-bridge-network (rf/reg-event-fx :wallet/select-bridge-network
(fn [{:keys [db]} [{:keys [network-chain-id stack-id]}]] (fn [{:keys [db]} [{:keys [network-chain-id stack-id]}]]
{:db (assoc-in db [:wallet :ui :send :bridge-to-chain-id] network-chain-id) {:db (assoc-in db [:wallet :ui :send :bridge-to-chain-id] network-chain-id)
:fx [[:dispatch [:navigate-to-within-stack [:screen/wallet.bridge-send stack-id]]]]})) :fx [[:dispatch [:navigate-to-within-stack [:screen/wallet.bridge-input-amount stack-id]]]]}))
(rf/reg-event-fx (rf/reg-event-fx
:wallet/get-ethereum-chains :wallet/get-ethereum-chains

View File

@ -55,13 +55,13 @@
[status-im.contexts.syncing.scan-sync-code-page.view :as scan-sync-code-page] [status-im.contexts.syncing.scan-sync-code-page.view :as scan-sync-code-page]
[status-im.contexts.syncing.setup-syncing.view :as settings-setup-syncing] [status-im.contexts.syncing.setup-syncing.view :as settings-setup-syncing]
[status-im.contexts.syncing.syncing-devices-list.view :as settings-syncing] [status-im.contexts.syncing.syncing-devices-list.view :as settings-syncing]
[status-im.contexts.wallet.account.bridge-send.view :as wallet-bridge-send]
[status-im.contexts.wallet.account.bridge-to.view :as wallet-bridge-to]
[status-im.contexts.wallet.account.bridge.view :as wallet-bridge]
[status-im.contexts.wallet.account.view :as wallet-accounts] [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-address-to-watch.confirm-address.view :as
wallet-confirm-address-to-watch] 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-address-to-watch.view :as wallet-add-address-to-watch]
[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.collectible.view :as wallet-collectible]
[status-im.contexts.wallet.create-account.edit-derivation-path.view :as wallet-edit-derivation-path] [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 [status-im.contexts.wallet.create-account.new-keypair.backup-recovery-phrase.view :as
@ -361,18 +361,18 @@
{:name :screen/wallet.confirm-address-to-watch {:name :screen/wallet.confirm-address-to-watch
:component wallet-confirm-address-to-watch/view} :component wallet-confirm-address-to-watch/view}
{:name :screen/wallet.bridge {:name :screen/wallet.bridge-select-asset
:options {:insets {:top? true} :options {:insets {:top? true}
:modalPresentationStyle :overCurrentContext} :modalPresentationStyle :overCurrentContext}
:component wallet-bridge/view} :component wallet-bridge-select-asset/view}
{:name :screen/wallet.bridge-to {:name :screen/wallet.bridge-to
:options {:insets {:top? true}} :options {:insets {:top? true}}
:component wallet-bridge-to/view} :component wallet-bridge-to/view}
{:name :screen/wallet.bridge-send {:name :screen/wallet.bridge-input-amount
:options {:insets {:top? true}} :options {:insets {:top? true}}
:component wallet-bridge-send/view} :component wallet-bridge-input-amount/view}
{:name :screen/wallet.edit-derivation-path {:name :screen/wallet.edit-derivation-path
:component wallet-edit-derivation-path/view} :component wallet-edit-derivation-path/view}