so many small tweaks due to the fact that the grid was slow.
This commit is contained in:
@@ -119,13 +119,12 @@
|
||||
(mapv (fn [c]
|
||||
[:div.level-item c]) children))]]))))]))
|
||||
|
||||
(defn table []
|
||||
(r/create-class {:reagent-render
|
||||
(fn [{:keys [fullwidth]}]
|
||||
(into
|
||||
[:table.table.compact.grid {:class (if fullwidth
|
||||
["is-fullwidth"])}]
|
||||
(r/children (r/current-component))))}))
|
||||
(defn table [{:keys [fullwidth]}]
|
||||
|
||||
(into
|
||||
[:table.table.compact.grid {:class (if fullwidth
|
||||
["is-fullwidth"])}]
|
||||
(r/children (r/current-component))))
|
||||
|
||||
(defn header []
|
||||
(into
|
||||
@@ -138,13 +137,17 @@
|
||||
(r/children (r/current-component))))
|
||||
|
||||
(defn row [{:keys [class]}]
|
||||
(into [:tr {:class class}]
|
||||
(r/children (r/current-component))))
|
||||
(apply r/create-element "tr" #js {:className class}
|
||||
(map r/as-element (r/children (r/current-component)))))
|
||||
|
||||
(defn button-cell [params]
|
||||
(apply r/create-element "td" #js {"style" #js {"overflow" "visible"}}
|
||||
(map r/as-element (r/children (r/current-component)))))
|
||||
|
||||
(defn cell [params]
|
||||
[:td params
|
||||
(into [:span.test ]
|
||||
(r/children (r/current-component)))])
|
||||
(apply r/create-element "td" #js {}
|
||||
(map r/as-element (r/children (r/current-component))))
|
||||
)
|
||||
|
||||
(defn body []
|
||||
(let [children (r/children (r/current-component))]
|
||||
@@ -153,29 +156,28 @@
|
||||
(let [{:strs [column-count status]} (js->clj consume)]
|
||||
(r/as-element
|
||||
(cond (= :loading (:state status))
|
||||
[:tbody
|
||||
(for [i (range 40)]
|
||||
^{:key "loading-body"}
|
||||
[:tbody.test
|
||||
(for [i (range 20)]
|
||||
^{:key i}
|
||||
[:tr
|
||||
(for [x (range column-count)]
|
||||
^{:key x}
|
||||
[:td #_{:col-span column-count}
|
||||
[appearing {:visible? true
|
||||
:timeout 1000
|
||||
:enter-class "appear"
|
||||
:exit-class "disappear"}
|
||||
[:div.test
|
||||
[:div.ph-item
|
||||
[:div.ph-row
|
||||
[:div.ph-col-12.big]]]]]])
|
||||
])]
|
||||
[:div
|
||||
[:div.ph-item
|
||||
[:div.ph-row
|
||||
[:div.ph-col-12.big]]]]])])]
|
||||
|
||||
(= :error (:state status))
|
||||
^{:key "error-body"}
|
||||
[:tbody [:tr [:td.has-text-centered {:col-span column-count}
|
||||
"An unexpected error has occured. "
|
||||
(-> status :error first :message)
|
||||
" Please try refreshing the page."]]]
|
||||
:else
|
||||
(into [:tbody]
|
||||
(into ^{:key "main-body"}
|
||||
[:tbody]
|
||||
|
||||
children)))))]))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user