Skip to content

Commit

Permalink
fix: Wrong UI for network preferences bottom sheet (#19475)
Browse files Browse the repository at this point in the history
fix: Wrong UI for network preferences bottom sheet (#19475)
  • Loading branch information
OmarBasem authored Apr 2, 2024
1 parent 8c67ce0 commit 68402ae
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/quo/foundations/colors.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
;;;; Networks
(def ^:private networks
{:ethereum "#758EEB"
:mainnet "#758EEB"
:optimism "#E76E6E"
:arbitrum "#6BD5F0"
:zkSync "#9FA0FE"
Expand Down
10 changes: 6 additions & 4 deletions src/status_im/common/qr_codes/view.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns status-im.common.qr-codes.view
(:require
[quo.core :as quo]
[status-im.constants :as constants]
[utils.image-server :as image-server]
[utils.re-frame :as rf]))

Expand Down Expand Up @@ -43,9 +44,10 @@
(defn get-network-short-name-url
[network]
(case network
:ethereum "eth:"
:optimism "opt:"
:arbitrum "arb1:"
:ethereum (str constants/mainnet-short-name ":")
:mainnet (str constants/mainnet-short-name ":")
:optimism (str constants/optimism-short-name ":")
:arbitrum (str constants/arbitrum-short-name ":")
(str (name network) ":")))

(defn- get-qr-data-for-wallet-multichain
Expand All @@ -66,7 +68,7 @@
- customization-color: Custom color for the QR code component.
- unblur-on-android?: [Android only] disables blur for this component.
- full-name: User full name.
Depending on the `type`, different properties are accepted:
`:profile`
- profile-picture: map ({:source image-source}) or any image source.
Expand Down
5 changes: 3 additions & 2 deletions src/status_im/contexts/wallet/account/share_address/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
[selected-networks]
(let [on-save (fn [chain-ids]
(rf/dispatch [:hide-bottom-sheet])
(reset! selected-networks (map utils/id->network chain-ids)))
(reset! selected-networks (map #(if (= % 1) :mainnet (utils/id->network %))
chain-ids)))
sheet-content (fn []
[network-preferences/view
{:blur? true
Expand All @@ -52,7 +53,7 @@
wallet-type (reagent/atom :legacy)
;; Design team is yet to confirm the default selected networks here. Should be the current
;; selected for the account or all the networks always
selected-networks (reagent/atom [:ethereum :optimism :arbitrum])
selected-networks (reagent/atom [:mainnet :optimism :arbitrum])
on-settings-press #(open-preferences selected-networks)
on-legacy-press #(reset! wallet-type :legacy)
on-multichain-press #(reset! wallet-type :multichain)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
layer-2-networks)}]
[quo/bottom-actions
{:actions :one-action
:button-one-label (i18n/label :t/update)
:button-one-label (i18n/label :t/display)
:button-one-props {:disabled? (= @state :default)
:on-press (fn []
(let [chain-ids (map :chain-id current-networks)]
Expand Down
3 changes: 2 additions & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2565,5 +2565,6 @@
"max": "Max: {{number}}",
"key-name-error-length": "Key name too long",
"key-name-error-emoji": "Emojis are not allowed",
"key-name-error-special-char": "Special characters are not allowed"
"key-name-error-special-char": "Special characters are not allowed",
"display": "Display"
}

0 comments on commit 68402ae

Please sign in to comment.