Selected state

This commit is contained in:
Ajay Sivan 2024-07-26 11:43:49 +05:30
parent 542836bc2a
commit 5ca02206b5
No known key found for this signature in database
GPG Key ID: 5F9AC120AE59597A
1 changed files with 12 additions and 10 deletions

View File

@ -8,16 +8,18 @@
(defn- render-account-item
[{:keys [color address] :as account} _ _ {:keys [selected-account-address]}]
[quo/account-item
{:type :tag
:token-props {:symbol "SNT"
:value "1,000"}
:account-props (assoc account :customization-color color)
:customization-color color
:state (if (= address selected-account-address) :selected :default)
:on-press (fn []
(rf/dispatch [:wallet/switch-current-viewing-account address])
(rf/dispatch [:hide-bottom-sheet]))}])
(let [state (if (= address selected-account-address) :selected :default)]
[quo/account-item
{:type (if (= state :selected) :default :tag)
:token-props {:symbol "SNT"
:value "1,000"}
:account-props (assoc account :customization-color color)
:customization-color color
:state state
:on-press
(fn []
(rf/dispatch [:wallet/switch-current-viewing-account address])
(rf/dispatch [:hide-bottom-sheet]))}]))
(defn view
[{:keys [show-token-balance? token-symbol]}]