fix: select asset screen render function (#20086)

fix: select asset screen render function (#20086)
This commit is contained in:
Omar Basem 2024-05-17 21:59:13 +04:00 committed by GitHub
parent 47428368fd
commit 9d302d8192
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 26 additions and 28 deletions

View File

@ -3,7 +3,6 @@
[clojure.string :as string]
[quo.core :as quo]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.contexts.wallet.common.account-switcher.view :as account-switcher]
[status-im.contexts.wallet.common.asset-list.view :as asset-list]
[status-im.contexts.wallet.common.collectibles-tab.view :as collectibles-tab]
@ -59,10 +58,10 @@
(defn view
[]
(let [selected-tab (reagent/atom (:id (first tabs-data)))
search-text (reagent/atom "")
on-change-text #(reset! search-text %)
on-change-tab #(reset! selected-tab %)
(let [[selected-tab set-selected-tab] (rn/use-state (:id (first tabs-data)))
[search-text set-search-text] (rn/use-state "")
on-change-text #(set-search-text %)
on-change-tab #(set-selected-tab %)
on-close (fn []
(rf/dispatch [:wallet/clean-selected-token])
(rf/dispatch [:wallet/clean-selected-collectible])
@ -70,7 +69,6 @@
(rn/use-unmount (fn []
(rf/dispatch [:wallet/clean-selected-token])
(rf/dispatch [:wallet/clean-selected-collectible])))
(fn []
[rn/safe-area-view {:style style/container}
[account-switcher/view
{:icon-name :i/arrow-left
@ -88,4 +86,4 @@
:margin-vertical 8}
:data tabs-data
:on-change on-change-tab}]
[tab-view @search-text @selected-tab on-change-text]])))
[tab-view search-text selected-tab on-change-text]]))