Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple quo groups #16857

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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