Skip to content

Commit cb79382

Browse files
fix(swap): update swap icon and don't show contract address for eth swaps
Signed-off-by: Brian Sztamfater <[email protected]>
1 parent 7688269 commit cb79382

File tree

10 files changed

+24
-15
lines changed

10 files changed

+24
-15
lines changed
999 Bytes
Loading
1.37 KB
Loading

src/quo/components/buttons/wallet_ctas/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
:accessibility-label :receive}]
4949
(when swap-action
5050
[action-button
51-
{:icon :i/swap
51+
{:icon :i/transaction
5252
:text (i18n/label :t/swap)
5353
:on-press swap-action
5454
:theme theme

src/quo/components/wallet/summary_info/view.cljs

+9-7
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060

6161
(defn- view-internal
6262
[{:keys [type account-props token-props networks? values]}]
63-
(let [theme (quo.theme/use-theme)]
63+
(let [theme (quo.theme/use-theme)
64+
address (or (:address account-props) (:address token-props))]
6465
[rn/view
6566
{:style (style/container networks? theme)}
6667
[rn/view
@@ -89,12 +90,13 @@
8990
(get-in account-props [:status-account :name])]
9091
[rn/view
9192
{:style (style/dot-divider theme)}]])
92-
[text/text
93-
{:size (when (not= type :account) :paragraph-2)
94-
:weight (when (= type :account) :semi-bold)
95-
:style {:color (when (not= type :account)
96-
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))}}
97-
(or (:address account-props) (:address token-props))]]]]
93+
(when address
94+
[text/text
95+
{:size (when (not= type :account) :paragraph-2)
96+
:weight (when (= type :account) :semi-bold)
97+
:style {:color (when (not= type :account)
98+
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))}}
99+
address])]]]
98100
(when networks?
99101
[:<>
100102
[rn/view

src/quo/components/wallet/transaction_summary/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
(def transaction-icon
1919
{:send :i/send
20-
:swap :i/swap
20+
:swap :i/transaction
2121
:bridge :i/bridge})
2222

2323
(defn transaction-header

src/quo/components/wallet/wallet_activity/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(def transaction-icon
2424
{:receive :i/receive
2525
:send :i/send
26-
:swap :i/swap
26+
:swap :i/transaction
2727
:bridge :i/bridge
2828
:buy :i/buy
2929
:destroy :i/destroy

src/status_im/contexts/preview/status_im/common/floating_button_page/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
:title "floating button page"
2626
:description "press right icon to swap button type"
2727
:text-align :left
28-
:right-side [{:icon-name :i/swap
28+
:right-side [{:icon-name :i/transaction
2929
:on-press #(swap! slide? not)}]
3030
:background :blur
3131
:icon-name :i/close

src/status_im/contexts/wallet/common/token_value/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
(defn- action-swap
5050
[{:keys [token asset-to-receive token-symbol testnet-mode?]}]
51-
{:icon :i/swap
51+
{:icon :i/transaction
5252
:accessibility-label :swap
5353
:label (i18n/label :t/swap)
5454
:disabled? testnet-mode?

src/status_im/contexts/wallet/swap/swap_confirmation/view.cljs

+6-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
:values (send-utils/network-values-for-ui network-values)
8181
:token-props {:token token-symbol
8282
:label (str amount " " token-symbol)
83-
:address (address-utils/get-shortened-compressed-key token-address)
83+
:address (when token-address
84+
(address-utils/get-shortened-compressed-key token-address))
8485
:size 32}}]]))
8586

8687
(defn- pay-section
@@ -98,7 +99,8 @@
9899
:label (i18n/label :t/pay)
99100
:token-symbol pay-token-symbol
100101
:amount pay-amount
101-
:token-address pay-token-address
102+
:token-address (when-not (address-utils/zero-address? pay-token-address)
103+
pay-token-address)
102104
:network network-name
103105
:theme theme}]))
104106

@@ -117,7 +119,8 @@
117119
:label (i18n/label :t/receive)
118120
:token-symbol receive-token-symbol
119121
:amount receive-amount
120-
:token-address receive-token-address
122+
:token-address (when-not (address-utils/zero-address? receive-token-address)
123+
receive-token-address)
121124
:network network-name
122125
:theme theme}]))
123126

src/utils/address.cljs

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
(def regx-eip-3770-address #"^(?:(?:eth:|arb1:|oeth:)(?=:|))*0x[0-9a-fA-F]{40}$")
1111
(def regx-metamask-address #"^ethereum:(0x[0-9a-fA-F]{40})(?:@(0x1|0xa|0xa4b1))?$")
1212
(def regx-address-contains #"(?i)0x[a-fA-F0-9]{40}")
13+
(def zero-address "0x0000000000000000000000000000000000000000")
1314

1415
(defn normalized-hex
1516
[hex]
@@ -137,3 +138,6 @@
137138
(metamask-address? address)
138139
(metamask-address->eth-address address)))
139140

141+
(defn zero-address?
142+
[address]
143+
(= address zero-address))

0 commit comments

Comments
 (0)