Skip to content

Commit

Permalink
simple quo groups
Browse files Browse the repository at this point in the history
  • Loading branch information
flexsurfer committed Aug 3, 2023
1 parent b0e4520 commit 56f9323
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/status_im2/contexts/quo_preview/main.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
[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.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
{:foundations [{:name :shadows
Expand Down Expand Up @@ -427,6 +428,22 @@
[quo/button {:on-press #(theme/set-theme :light)} "Set light 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
[]
(fn []
Expand All @@ -440,17 +457,7 @@
[rn/view
(map (fn [category]
^{:key (get category 0)}
[rn/view {:style {:margin-vertical 8}}
[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)])])
[category-view category])
(sort screens-categories))]]))

(def main-screens
Expand Down

0 comments on commit 56f9323

Please sign in to comment.