Skip to content

Commit 6b026fc

Browse files
committed
Fixes; test updates
1 parent a8d3b9e commit 6b026fc

File tree

8 files changed

+36
-24
lines changed

8 files changed

+36
-24
lines changed

src/quo/components/wallet/summary_info/component_spec.cljs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,11 @@
5555
:arbitrum 25}
5656
:account-props status-account-props}])
5757
(h/is-null (h/query-by-label-text :networks))))
58+
59+
(h/describe "Wallet: network summary info"
60+
(h/test "Type of `network` title renders"
61+
(h/render-with-theme-provider [summary-info/view
62+
{:type :network
63+
:network-props {:full-name "Ethereum"
64+
:network-name :ethereum}}])
65+
(h/is-truthy (h/get-by-text "Ethereum"))))

src/quo/components/wallet/summary_info/schema.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[:map
88
[:type [:enum :status-account :saved-account :account :user :token]]
99
[:account-props {:optional true} [:maybe :map]]
10+
[:network-props {:optional true} [:maybe :map]]
1011
[:token-props {:optional true} [:maybe :map]]
11-
[:networks? {:optional true} [:maybe :boolean]]
12-
[:values {:optional true} [:maybe :map]]]]]
12+
[:networks-to-show {:optional true} [:maybe :map]]]]]
1313
:any])

src/quo/components/wallet/summary_info/style.cljs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@
3939
:height 32
4040
:flex-direction :row
4141
:align-items :center})
42+
43+
(def network-icon
44+
{:width 32
45+
:height 32})

src/quo/components/wallet/summary_info/view.cljs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@
3434
:arbitrum "ARB"
3535
:base "ETH"})
3636

37-
(defn prnt
38-
[data]
39-
(js/console.log "DATA: " (clj->js data))
40-
data)
41-
4237
(defn networks
4338
[networks-to-show theme]
4439
(->> networks-to-show
@@ -52,13 +47,12 @@
5247
:divider? (not= (dec i) (-> networks-to-show keys count))
5348
:theme theme}])))
5449
(remove nil?)
55-
(prnt)
5650
(into [rn/view
5751
{:style style/networks-container
5852
:accessibility-label :networks}])))
5953

6054
(defn- view-internal
61-
[{:keys [type account-props token-props networks-to-show]}]
55+
[{:keys [type account-props network-props token-props networks-to-show]}]
6256
(let [theme (quo.theme/use-theme)
6357
address (or (:address account-props) (:address token-props))]
6458
[rn/view
@@ -73,16 +67,26 @@
7367
(assoc account-props
7468
:size :size-32
7569
:neutral? true)]
70+
:network [rn/image
71+
{:source (resources/get-network (:network-name network-props))
72+
:style style/network-icon}]
7673
[user-avatar/user-avatar account-props])
7774
[rn/view {:style {:margin-left 8}}
78-
(when (not= type :account)
79-
[text/text {:weight :semi-bold} (or (:name account-props) (:label token-props))])
75+
(when (not (some #{type} [:account :network]))
76+
[text/text
77+
{:weight :semi-bold}
78+
(or (:name account-props) (:label token-props))])
79+
(when (= type :network)
80+
[text/text
81+
{:weight :semi-bold}
82+
(:full-name network-props)])
8083
[rn/view
8184
{:style {:flex-direction :row
8285
:align-items :center}}
8386
(when (= type :user)
8487
[:<>
85-
[rn/view {:style {:margin-right 4}} [account-avatar/view (:status-account account-props)]]
88+
[rn/view {:style {:margin-right 4}}
89+
[account-avatar/view (:status-account account-props)]]
8690
[text/text
8791
{:size :paragraph-2
8892
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}}

src/status_im/contexts/wallet/send/transaction_confirmation/view.cljs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@
163163
:accessibility-label accessibility-label}
164164
label]
165165
[quo/summary-info
166-
{:type :network
167-
:network :ethereum}]])))
166+
{:type :network
167+
:network-props network}]])))
168168

169169
(defn- data-item
170170
[{:keys [title subtitle]}]
@@ -348,5 +348,5 @@
348348
:account-to? true
349349
:theme theme}]
350350
[network-summary
351-
{:label (i18n/label :t/on)
351+
{:label (i18n/label :t/on-capitalized)
352352
:theme theme}]]]]))

src/status_im/contexts/wallet/sheets/buy_network_selection/view.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{:size :paragraph-2
2525
:weight :medium
2626
:style style/on}
27-
(i18n/label :t/on-uppercase)]
27+
(i18n/label :t/on-capitalized)]
2828
[quo/context-tag
2929
{:type :network
3030
:network-logo (:logo-url provider)

src/status_im/subs/wallet/networks.cljs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@
7676
:wallet/send-selected-network
7777
:<- [:wallet/wallet-send]
7878
(fn [{:keys [to-values-by-chain]}]
79-
(let [network-name (-> to-values-by-chain
80-
keys
81-
first
82-
network-utils/id->network)]
83-
(if (= network-name :mainnet)
84-
:ethereum
85-
network-name))))
79+
(-> to-values-by-chain
80+
keys
81+
first
82+
network-utils/get-network-details)))

translations/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,6 @@
18921892
"on-keycard": "On Keycard",
18931893
"on-status-tree": "On Status tree",
18941894
"on-the-web": "On the web",
1895-
"on-uppercase": "On",
18961895
"once-enabled-share-metadata": "Once enabled, links posted in the chat may share your metadata with the site",
18971896
"one-day": "One day",
18981897
"one-month": "One month",

0 commit comments

Comments
 (0)