greatly simplifying how states are handled.
This commit is contained in:
@@ -146,7 +146,7 @@
|
||||
:enter-class "appear"
|
||||
:exit-class "disappear"}
|
||||
|
||||
(into [:div.test ]
|
||||
(into [:span.test ]
|
||||
(r/children (r/current-component)))]])
|
||||
|
||||
(defn body []
|
||||
@@ -155,26 +155,32 @@
|
||||
(fn [consume]
|
||||
(let [{:strs [column-count status]} (js->clj consume)]
|
||||
(r/as-element
|
||||
(if (:loading status)
|
||||
[:tbody
|
||||
(for [i (range 40)]
|
||||
^{: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]]]]]])
|
||||
])]
|
||||
(into [:tbody]
|
||||
(cond (= :loading (:state status))
|
||||
[:tbody
|
||||
(for [i (range 40)]
|
||||
^{: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]]]]]])
|
||||
])]
|
||||
(= :error (:state status))
|
||||
[: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]
|
||||
|
||||
children)))))]))
|
||||
children)))))]))
|
||||
|
||||
(defn sortable-header-cell [{:keys [style class sort-key sort-name asc]}]
|
||||
(let [children (r/children (r/current-component))]
|
||||
|
||||
Reference in New Issue
Block a user