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 ;;;; Networks
(def ^:private networks (def ^:private networks
{:ethereum "#758EEB" {:ethereum "#758EEB"
:mainnet "#758EEB"
:optimism "#E76E6E" :optimism "#E76E6E"
:arbitrum "#6BD5F0" :arbitrum "#6BD5F0"
:zkSync "#9FA0FE" :zkSync "#9FA0FE"

View File

@ -1,6 +1,7 @@
(ns status-im.common.qr-codes.view (ns status-im.common.qr-codes.view
(:require (:require
[quo.core :as quo] [quo.core :as quo]
[status-im.constants :as constants]
[utils.image-server :as image-server] [utils.image-server :as image-server]
[utils.re-frame :as rf])) [utils.re-frame :as rf]))
@ -43,9 +44,10 @@
(defn get-network-short-name-url (defn get-network-short-name-url
[network] [network]
(case network (case network
:ethereum "eth:" :ethereum (str constants/mainnet-short-name ":")
:optimism "opt:" :mainnet (str constants/mainnet-short-name ":")
:arbitrum "arb1:" :optimism (str constants/optimism-short-name ":")
:arbitrum (str constants/arbitrum-short-name ":")
(str (name network) ":"))) (str (name network) ":")))
(defn- get-qr-data-for-wallet-multichain (defn- get-qr-data-for-wallet-multichain
@ -66,7 +68,7 @@
- customization-color: Custom color for the QR code component. - customization-color: Custom color for the QR code component.
- unblur-on-android?: [Android only] disables blur for this component. - unblur-on-android?: [Android only] disables blur for this component.
- full-name: User full name. - full-name: User full name.
Depending on the `type`, different properties are accepted: Depending on the `type`, different properties are accepted:
`:profile` `:profile`
- profile-picture: map ({:source image-source}) or any image source. - profile-picture: map ({:source image-source}) or any image source.

View File

@ -34,7 +34,8 @@
[selected-networks] [selected-networks]
(let [on-save (fn [chain-ids] (let [on-save (fn [chain-ids]
(rf/dispatch [:hide-bottom-sheet]) (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 [] sheet-content (fn []
[network-preferences/view [network-preferences/view
{:blur? true {:blur? true
@ -52,7 +53,7 @@
wallet-type (reagent/atom :legacy) wallet-type (reagent/atom :legacy)
;; Design team is yet to confirm the default selected networks here. Should be the current ;; 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 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-settings-press #(open-preferences selected-networks)
on-legacy-press #(reset! wallet-type :legacy) on-legacy-press #(reset! wallet-type :legacy)
on-multichain-press #(reset! wallet-type :multichain)] on-multichain-press #(reset! wallet-type :multichain)]

View File

@ -93,7 +93,7 @@
layer-2-networks)}] layer-2-networks)}]
[quo/bottom-actions [quo/bottom-actions
{:actions :one-action {:actions :one-action
:button-one-label (i18n/label :t/update) :button-one-label (i18n/label :t/display)
:button-one-props {:disabled? (= @state :default) :button-one-props {:disabled? (= @state :default)
:on-press (fn [] :on-press (fn []
(let [chain-ids (map :chain-id current-networks)] (let [chain-ids (map :chain-id current-networks)]

View File

@ -2565,5 +2565,6 @@
"max": "Max: {{number}}", "max": "Max: {{number}}",
"key-name-error-length": "Key name too long", "key-name-error-length": "Key name too long",
"key-name-error-emoji": "Emojis are not allowed", "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"
} }