Skip to content

Commit a37081f

Browse files
committed
Refactors
1 parent 78ea31f commit a37081f

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/status_im/contexts/shell/share/wallet/view.cljs

+7-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848
[props]
4949
(let [{:keys [account width index]} props
5050
selected-networks (reagent/atom [:ethereum :optimism :arbitrum])
51-
wallet-type (reagent/atom :legacy)]
51+
wallet-type (reagent/atom :legacy)
52+
on-settings-press #(open-preferences selected-networks)
53+
on-legacy-press #(reset! wallet-type :legacy)
54+
on-multichain-press #(reset! wallet-type :multichain)]
5255
(fn []
5356
(let [share-title (str (:name account) " " (i18n/label :t/address))
5457
qr-url (utils/get-wallet-qr {:wallet-type @wallet-type
@@ -72,9 +75,9 @@
7275
:full-name (:name account)
7376
:customization-color (:color account)
7477
:emoji (:emoji account)
75-
:on-multichain-press #(reset! wallet-type :multichain)
76-
:on-legacy-press #(reset! wallet-type :legacy)
77-
:on-settings-press #(open-preferences selected-networks)}]]]))))
78+
:on-multichain-press on-multichain-press
79+
:on-legacy-press on-legacy-press
80+
:on-settings-press on-settings-press}]]]))))
7881

7982
(def wallet-qr-code-item (memoize wallet-qr-code-item-internal))
8083

src/status_im/contexts/wallet/share_address/view.cljs

+11-8
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@
4848

4949
(defn view
5050
[]
51-
(let [padding-top (:top (safe-area/get-insets))
52-
wallet-type (reagent/atom :legacy)
53-
;; Design team is yet to confirm the default selected networks here.
54-
;; Should be the current selected for the account or all the networks always
55-
selected-networks (reagent/atom [:ethereum :optimism :arbitrum])]
51+
(let [padding-top (:top (safe-area/get-insets))
52+
wallet-type (reagent/atom :legacy)
53+
;; Design team is yet to confirm the default selected networks here. Should be the current
54+
;; selected for the account or all the networks always
55+
selected-networks (reagent/atom [:ethereum :optimism :arbitrum])
56+
on-settings-press #(open-preferences selected-networks)
57+
on-legacy-press #(reset! wallet-type :legacy)
58+
on-multichain-press #(reset! wallet-type :multichain)]
5659
(fn []
5760
(let [{:keys [address color emoji watch-only?]
5861
:as account} (rf/sub [:wallet/current-viewing-account])
@@ -97,6 +100,6 @@
97100
:full-name (:name account)
98101
:customization-color color
99102
:emoji emoji
100-
:on-legacy-press #(reset! wallet-type :legacy)
101-
:on-multichain-press #(reset! wallet-type :multichain)
102-
:on-settings-press #(open-preferences selected-networks)}]]]]))))
103+
:on-legacy-press on-legacy-press
104+
:on-multichain-press on-multichain-press
105+
:on-settings-press on-settings-press}]]]]))))

0 commit comments

Comments
 (0)