File tree 1 file changed +19
-12
lines changed
src/status_im2/contexts/quo_preview
1 file changed +19
-12
lines changed Original file line number Diff line number Diff line change 106
106
[status-im2.contexts.quo-preview.wallet.network-amount :as network-amount]
107
107
[status-im2.contexts.quo-preview.wallet.network-bridge :as network-bridge]
108
108
[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]))
110
111
111
112
(def screens-categories
112
113
{:foundations [{:name :shadows
427
428
[quo/button {:on-press #(theme/set-theme :light )} " Set light theme" ]
428
429
[quo/button {:on-press #(theme/set-theme :dark )} " Set dark theme" ]])
429
430
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
+
430
447
(defn main-screen
431
448
[]
432
449
(fn []
440
457
[rn/view
441
458
(map (fn [category]
442
459
^{: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])
454
461
(sort screens-categories))]]))
455
462
456
463
(def main-screens
You can’t perform that action at this time.
0 commit comments