fix: Wrong UI for network preferences bottom sheet (#19475)

fix: Wrong UI for network preferences bottom sheet (#19475)
This commit is contained in:
Omar Basem 2024-04-02 22:24:55 +04:00 committed by GitHub
parent 8c67ce0b75
commit 68402ae669
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 8 deletions

View File

@ -245,6 +245,7 @@
;;;; Networks
(def ^:private networks
{:ethereum "#758EEB"
:mainnet "#758EEB"
:optimism "#E76E6E"
:arbitrum "#6BD5F0"
:zkSync "#9FA0FE"

View File

@ -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]))
@ -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
@ -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.

View File

@ -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
@ -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)]

View File

@ -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)]

View File

@ -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"
}