✏️ Add labels for network prefs

This commit is contained in:
Shivek Khurana 2024-04-23 15:26:45 +02:00
parent 75086209f7
commit 48930d0b81
No known key found for this signature in database
GPG Key ID: 6BBA04C82FA07036
3 changed files with 36 additions and 7 deletions

View File

@ -41,7 +41,9 @@
{:content
(fn []
[network-preferences/view
{:selected-networks (->> selected-networks
{:title (i18n/label :t/add-network-preferences)
:description (i18n/label :t/network-preferences-save-address-description)
:selected-networks (->> selected-networks
(map :network-name)
set)
:account {:address address}
@ -96,7 +98,6 @@
{:address address
:name address-label
:customization-color address-color
:on-success (fn [] (js/alert "Address Saved"))
:chain-short-names
(wallet-common-utils/short-names->network-preference-prefix
(map :short-name selected-networks-or-fallback))}]))
@ -135,3 +136,29 @@
{:selected-networks selected-networks-or-fallback
:set-selected-networks set-selected-networks}]]))
(comment
(rf/dispatch [:wallet/get-saved-addresses])
;; login
(do
(rf/dispatch [:profile/on-password-input-changed {:password " "}])
(rf/dispatch [:profile.login/login]))
(rf/ref-e)
;; set send-to address
(rf/reg-event-fx
:wallet-temp/set-to-address
(fn [{:keys [db]} [to-address]]
{:db (assoc-in db [:wallet :ui :send :to-address] to-address)}))
(rf/dispatch [:wallet-temp/set-to-address
"0x26fe3219384a55e4e89fdb0e4420b15439221428"])
(rf/dispatch [:navigate-to :screen/wallet.transaction-progress])
(rf/dispatch [:open-modal :screen/wallet.save-address])
)

View File

@ -10,7 +10,7 @@
[utils.re-frame :as rf]))
(defn- view-internal
[{:keys [selected-networks account watch-only?]}]
[{:keys [selected-networks account watch-only? title description]}]
(let [state (reagent/atom :default)
{:keys [color address
network-preferences-names]} (or account (rf/sub [:wallet/current-viewing-account]))
@ -50,10 +50,10 @@
:blur-amount 20
:blur-radius 25}])
[quo/drawer-top
{:title (i18n/label :t/network-preferences)
:description (if watch-only?
(i18n/label :t/network-preferences-desc-1)
(i18n/label :t/network-preferences-desc-2))
{:title (or title (i18n/label :t/network-preferences))
:description (or description (if watch-only?
(i18n/label :t/network-preferences-desc-1)
(i18n/label :t/network-preferences-desc-2)))
:blur? blur?}]
[quo/data-item
{:status :default

View File

@ -2445,6 +2445,8 @@
"network-preferences": "Network preferences",
"network-preferences-desc-1": "Select which networks this address is happy to receive funds on",
"network-preferences-desc-2": "Select which networks to receive funds on",
"add-network-preferences": "Add network preferences",
"network-preferences-save-address-description": "Only change if you know which networks the address owner is happy to to receive funds on.",
"layer-2": "Layer 2",
"manage-tokens": "Manage tokens",
"edit-derivation-path": "Edit derivation path",