Improve app-db styling

This commit is contained in:
Daniel Compton 2017-12-04 14:54:18 +13:00
parent 86054ec1ad
commit 9b1d77dc00
2 changed files with 19 additions and 1 deletions

View File

@ -143,3 +143,21 @@
(boolean? data)
(nil? data))) [:div {:style {:margin "10px 0"}} (prn-str data)]
@expanded? (jsonml->hiccup (cljs-devtools-header data) (conj path 0)))]])))
(defn simple-render [data]
(let [expanded? (r/atom true) #_(rf/subscribe [:app-db/node-expanded? path])]
(fn [data]
[:div
{:class (str/join " " ["re-frame-trace--object"
(when @expanded? "expanded")])}
#_[:span {:class "toggle"
:on-click #(rf/dispatch [:app-db/toggle-expansion path])}
[:button.expansion-button (if @expanded? "▼ " "▶ ")]]
[:div #_{:style {:margin-left 20}}
(cond
(and @expanded?
(or (string? data)
(number? data)
(boolean? data)
(nil? data))) [:div {:style {:margin "10px 0"}} (prn-str data)]
@expanded? (jsonml->hiccup (cljs-devtools-header data) (conj [] 0)))]])))

View File

@ -14,7 +14,7 @@
input-error (r/atom false)]
(fn []
[:div {:style {:flex "1 1 auto" :display "flex" :flex-direction "column"}}
[:div.panel-content-scrollable {:style {:margin-left "10px"}}
[:div.panel-content-scrollable
[re-com/input-text
:model search-string
:on-change (fn [input-string] (rf/dispatch [:app-db/search-string input-string]))