Skip to content

Commit 56f9323

Browse files
committed
simple quo groups
1 parent b0e4520 commit 56f9323

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

src/status_im2/contexts/quo_preview/main.cljs

+19-12
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@
106106
[status-im2.contexts.quo-preview.wallet.network-amount :as network-amount]
107107
[status-im2.contexts.quo-preview.wallet.network-bridge :as network-bridge]
108108
[status-im2.contexts.quo-preview.wallet.account-card :as account-card]
109-
[status-im2.contexts.quo-preview.wallet.token-input :as token-input]))
109+
[status-im2.contexts.quo-preview.wallet.token-input :as token-input]
110+
[reagent.core :as reagent]))
110111

111112
(def screens-categories
112113
{:foundations [{:name :shadows
@@ -427,6 +428,22 @@
427428
[quo/button {:on-press #(theme/set-theme :light)} "Set light theme"]
428429
[quo/button {:on-press #(theme/set-theme :dark)} "Set dark theme"]])
429430

431+
(defn category-view
432+
[]
433+
(let [open? (reagent/atom false)]
434+
(fn [category]
435+
[rn/view {:style {:margin-vertical 8}}
436+
[quo/dropdown {:selected @open? :on-change #(swap! open? not) :type :grey}
437+
(clojure.core/name (key category))]
438+
(when @open?
439+
(for [{:keys [name]} (val category)]
440+
^{:key name}
441+
[quo/button
442+
{:type :outline
443+
:container-style {:margin-vertical 8}
444+
:on-press #(re-frame/dispatch [:navigate-to name])}
445+
(clojure.core/name name)]))])))
446+
430447
(defn main-screen
431448
[]
432449
(fn []
@@ -440,17 +457,7 @@
440457
[rn/view
441458
(map (fn [category]
442459
^{:key (get category 0)}
443-
[rn/view {:style {:margin-vertical 8}}
444-
[quo/text
445-
{:weight :semi-bold
446-
:size :heading-2}
447-
(clojure.core/name (key category))]
448-
(for [{:keys [name]} (val category)]
449-
^{:key name}
450-
[quo/button
451-
{:container-style {:margin-vertical 8}
452-
:on-press #(re-frame/dispatch [:navigate-to name])}
453-
(clojure.core/name name)])])
460+
[category-view category])
454461
(sort screens-categories))]]))
455462

456463
(def main-screens

0 commit comments

Comments
 (0)