Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(swap): update icon and don't show contract address for eth on confirmation screen #21410

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added resources/images/icons2/20x20/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons2/20x20/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/quo/components/buttons/wallet_ctas/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
:accessibility-label :receive}]
(when swap-action
[action-button
{:icon :i/swap
{:icon :i/transaction
:text (i18n/label :t/swap)
:on-press swap-action
:theme theme
Expand Down
16 changes: 9 additions & 7 deletions src/quo/components/wallet/summary_info/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@

(defn- view-internal
[{:keys [type account-props token-props networks? values]}]
(let [theme (quo.theme/use-theme)]
(let [theme (quo.theme/use-theme)
address (or (:address account-props) (:address token-props))]
[rn/view
{:style (style/container networks? theme)}
[rn/view
Expand Down Expand Up @@ -89,12 +90,13 @@
(get-in account-props [:status-account :name])]
[rn/view
{:style (style/dot-divider theme)}]])
[text/text
{:size (when (not= type :account) :paragraph-2)
:weight (when (= type :account) :semi-bold)
:style {:color (when (not= type :account)
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))}}
(or (:address account-props) (:address token-props))]]]]
(when address
[text/text
{:size (when (not= type :account) :paragraph-2)
:weight (when (= type :account) :semi-bold)
:style {:color (when (not= type :account)
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))}}
address])]]]
(when networks?
[:<>
[rn/view
Expand Down
2 changes: 1 addition & 1 deletion src/quo/components/wallet/transaction_summary/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

(def transaction-icon
{:send :i/send
:swap :i/swap
:swap :i/transaction
:bridge :i/bridge})

(defn transaction-header
Expand Down
2 changes: 1 addition & 1 deletion src/quo/components/wallet/wallet_activity/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
(def transaction-icon
{:receive :i/receive
:send :i/send
:swap :i/swap
:swap :i/transaction
:bridge :i/bridge
:buy :i/buy
:destroy :i/destroy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
:title "floating button page"
:description "press right icon to swap button type"
:text-align :left
:right-side [{:icon-name :i/swap
:right-side [{:icon-name :i/transaction
:on-press #(swap! slide? not)}]
:background :blur
:icon-name :i/close
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/contexts/wallet/common/token_value/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

(defn- action-swap
[{:keys [token asset-to-receive token-symbol testnet-mode?]}]
{:icon :i/swap
{:icon :i/transaction
:accessibility-label :swap
:label (i18n/label :t/swap)
:disabled? testnet-mode?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
:values (send-utils/network-values-for-ui network-values)
:token-props {:token token-symbol
:label (str amount " " token-symbol)
:address (address-utils/get-shortened-compressed-key token-address)
:address (when token-address
(address-utils/get-shortened-compressed-key token-address))
:size 32}}]]))

(defn- pay-section
Expand All @@ -98,7 +99,8 @@
:label (i18n/label :t/pay)
:token-symbol pay-token-symbol
:amount pay-amount
:token-address pay-token-address
:token-address (when-not (address-utils/zero-address? pay-token-address)
pay-token-address)
:network network-name
:theme theme}]))

Expand All @@ -117,7 +119,8 @@
:label (i18n/label :t/receive)
:token-symbol receive-token-symbol
:amount receive-amount
:token-address receive-token-address
:token-address (when-not (address-utils/zero-address? receive-token-address)
receive-token-address)
:network network-name
:theme theme}]))

Expand Down
4 changes: 4 additions & 0 deletions src/utils/address.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
(def regx-eip-3770-address #"^(?:(?:eth:|arb1:|oeth:)(?=:|))*0x[0-9a-fA-F]{40}$")
(def regx-metamask-address #"^ethereum:(0x[0-9a-fA-F]{40})(?:@(0x1|0xa|0xa4b1))?$")
(def regx-address-contains #"(?i)0x[a-fA-F0-9]{40}")
(def zero-address "0x0000000000000000000000000000000000000000")

(defn normalized-hex
[hex]
Expand Down Expand Up @@ -137,3 +138,6 @@
(metamask-address? address)
(metamask-address->eth-address address)))

(defn zero-address?
[address]
(= address zero-address))