Skip to content

Commit

Permalink
namespace the keys for the type set in [:wallet :ui :send :tx-type]
Browse files Browse the repository at this point in the history
  • Loading branch information
BalogunofAfrica committed May 17, 2024
1 parent 6a4cfc2 commit 4dacc9e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/status_im/contexts/wallet/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
{:db (-> db
(assoc-in [:wallet :ui :send :token] token)
(assoc-in [:wallet :ui :send :to-address] to-address)
(assoc-in [:wallet :ui :send :tx-type] :bridge))
(assoc-in [:wallet :ui :send :tx-type] :tx/bridge))
:fx [[:dispatch
[:wallet/wizard-navigate-forward
{:current-screen stack-id
Expand All @@ -259,7 +259,7 @@

(rf/reg-event-fx :wallet/start-bridge
(fn [{:keys [db]}]
{:db (assoc-in db [:wallet :ui :send :tx-type] :bridge)
{:db (assoc-in db [:wallet :ui :send :tx-type] :tx/bridge)
:fx [[:dispatch [:open-modal :screen/wallet.bridge-select-asset]]]}))

(rf/reg-event-fx :wallet/select-bridge-network
Expand Down
6 changes: 3 additions & 3 deletions src/status_im/contexts/wallet/send/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
amount-in (send-utils/amount-in-hex amount (if token token-decimal 0))
from-address wallet-address
disabled-from-chain-ids disabled-from-chain-ids
disabled-to-chain-ids (if (= transaction-type :bridge)
disabled-to-chain-ids (if (= transaction-type :tx/bridge)
(filter #(not= % bridge-to-chain-id) network-chain-ids)
(filter (fn [chain-id]
(not (some #(= chain-id %)
Expand All @@ -331,7 +331,7 @@
transaction-type-param (case transaction-type
:tx/collectible-erc-721 constants/send-type-erc-721-transfer
:tx/collectible-erc-1155 constants/send-type-erc-1155-transfer
:bridge constants/send-type-bridge
:tx/bridge constants/send-type-bridge
constants/send-type-transfer)
balances-per-chain (when token (:balances-per-chain token))
token-available-networks-for-suggested-routes
Expand Down Expand Up @@ -512,7 +512,7 @@
transaction-type-param (case transaction-type
:tx/collectible-erc-721 constants/send-type-erc-721-transfer
:tx/collectible-erc-1155 constants/send-type-erc-1155-transfer
:bridge constants/send-type-bridge
:tx/bridge constants/send-type-bridge
constants/send-type-transfer)
token (get-in db [:wallet :ui :send :token])
collectible (get-in db [:wallet :ui :send :collectible])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
:weight :semi-bold
:style style/title-container
:accessibility-label :send-label}
(if (= transaction-type :bridge)
(if (= transaction-type :tx/bridge)
(i18n/label :t/bridge)
(i18n/label :t/send))]
[quo/summary-tag
{:token (if collectible? "" token-display-name)
:label (str amount " " token-display-name)
:type (if collectible? :collectible :token)
:image-source (if collectible? image-url :eth)}]]
(if (= transaction-type :bridge)
(if (= transaction-type :tx/bridge)
(map-indexed
(fn [idx path]
(let [from-network (:from path)
Expand Down Expand Up @@ -98,7 +98,7 @@
:style style/title-container
:accessibility-label :send-label}
(i18n/label :t/to)]
(if (= transaction-type :bridge)
(if (= transaction-type :tx/bridge)
[quo/summary-tag
{:type :network
:image-source (:source to-network)
Expand All @@ -107,7 +107,7 @@
[quo/summary-tag
{:type :address
:label (utils/get-shortened-address to-address)}])]
(when (= transaction-type :bridge)
(when (= transaction-type :tx/bridge)
[rn/view
{:style {:flex-direction :row
:margin-top 4}}
Expand Down Expand Up @@ -198,7 +198,7 @@
{:amount (str max-fees)
:symbol currency-symbol})}]
[data-item
{:title (if (= transaction-type :bridge)
{:title (if (= transaction-type :tx/bridge)
(i18n/label :t/bridged-to
{:network (:abbreviated-name to-network)})
(i18n/label :t/user-gets {:name (utils/get-shortened-address to-address)}))
Expand Down Expand Up @@ -249,7 +249,7 @@
:footer (when (and route (seq route))
[standard-auth/slide-button
{:size :size-48
:track-text (if (= transaction-type :bridge)
:track-text (if (= transaction-type :tx/bridge)
(i18n/label :t/slide-to-bridge)
(i18n/label :t/slide-to-send))
:container-style {:z-index 2}
Expand Down Expand Up @@ -282,12 +282,12 @@
:theme theme}]
[user-summary
{:token-display-name token-display-name
:summary-type (if (= transaction-type :bridge)
:summary-type (if (= transaction-type :tx/bridge)
:status-account
:account)
:accessibility-label :summary-to-label
:label (i18n/label :t/to-capitalized)
:account-props (if (= transaction-type :bridge)
:account-props (if (= transaction-type :tx/bridge)
from-account-props
user-props)
:network-values to-values-by-chain
Expand Down

0 comments on commit 4dacc9e

Please sign in to comment.