simple quo groups (#16857)

This commit is contained in:
flexsurfer 2023-08-03 19:00:07 +02:00 committed by GitHub
parent 109061a112
commit d9b54c47d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 12 deletions

View File

@ -106,7 +106,8 @@
[status-im2.contexts.quo-preview.wallet.network-amount :as network-amount] [status-im2.contexts.quo-preview.wallet.network-amount :as network-amount]
[status-im2.contexts.quo-preview.wallet.network-bridge :as network-bridge] [status-im2.contexts.quo-preview.wallet.network-bridge :as network-bridge]
[status-im2.contexts.quo-preview.wallet.account-card :as account-card] [status-im2.contexts.quo-preview.wallet.account-card :as account-card]
[status-im2.contexts.quo-preview.wallet.token-input :as token-input])) [status-im2.contexts.quo-preview.wallet.token-input :as token-input]
[reagent.core :as reagent]))
(def screens-categories (def screens-categories
{:foundations [{:name :shadows {:foundations [{:name :shadows
@ -427,6 +428,22 @@
[quo/button {:on-press #(theme/set-theme :light)} "Set light theme"] [quo/button {:on-press #(theme/set-theme :light)} "Set light theme"]
[quo/button {:on-press #(theme/set-theme :dark)} "Set dark theme"]]) [quo/button {:on-press #(theme/set-theme :dark)} "Set dark theme"]])
(defn category-view
[]
(let [open? (reagent/atom false)]
(fn [category]
[rn/view {:style {:margin-vertical 8}}
[quo/dropdown {:selected @open? :on-change #(swap! open? not) :type :grey}
(clojure.core/name (key category))]
(when @open?
(for [{:keys [name]} (val category)]
^{:key name}
[quo/button
{:type :outline
:container-style {:margin-vertical 8}
:on-press #(re-frame/dispatch [:navigate-to name])}
(clojure.core/name name)]))])))
(defn main-screen (defn main-screen
[] []
(fn [] (fn []
@ -440,17 +457,7 @@
[rn/view [rn/view
(map (fn [category] (map (fn [category]
^{:key (get category 0)} ^{:key (get category 0)}
[rn/view {:style {:margin-vertical 8}} [category-view category])
[quo/text
{:weight :semi-bold
:size :heading-2}
(clojure.core/name (key category))]
(for [{:keys [name]} (val category)]
^{:key name}
[quo/button
{:container-style {:margin-vertical 8}
:on-press #(re-frame/dispatch [:navigate-to name])}
(clojure.core/name name)])])
(sort screens-categories))]])) (sort screens-categories))]]))
(def main-screens (def main-screens