column widths.
This commit is contained in:
@@ -24,23 +24,22 @@
|
|||||||
[:span.icon
|
[:span.icon
|
||||||
[:i.fa.fa-sort]]))
|
[:i.fa.fa-sort]]))
|
||||||
|
|
||||||
(defn invoice-table [{:keys [id invoices status on-params-change]}]
|
(defn invoice-table [{:keys [id invoices status on-params-change vendors]}]
|
||||||
(let [state (reagent/atom {})]
|
(let [state (reagent/atom {})]
|
||||||
(fn []
|
(fn []
|
||||||
(let [{:keys [sort-by asc]} @state]
|
(let [{:keys [sort-by asc]} @state]
|
||||||
[:table {:class "table", :style {:width "100%"}}
|
[:table.table.is-fullwidth
|
||||||
[:thead
|
[:thead
|
||||||
[:tr
|
[:tr
|
||||||
[:th {:on-click (fn [e] (on-params-change (swap! state toggle-sort-by "vendor")))} "Vendor"
|
[:th {:on-click (fn [e] (on-params-change (swap! state toggle-sort-by "vendor"))) :style {:width "25%" :cursor "pointer"}} "Vendor"
|
||||||
(sort-icon "vendor" sort-by asc)
|
(sort-icon "vendor" sort-by asc)]
|
||||||
]
|
[:th {:on-click (fn [e] (on-params-change (swap! state toggle-sort-by "company"))) :style {:width "25%" :cursor "pointer"}} "Company"
|
||||||
[:th {:on-click (fn [e] (on-params-change (swap! state toggle-sort-by "company")))} "Company"
|
|
||||||
(sort-icon "company" sort-by asc)]
|
(sort-icon "company" sort-by asc)]
|
||||||
[:th {:on-click (fn [e] (on-params-change (swap! state toggle-sort-by "invoice-number")))} "Invoice #"
|
[:th {:on-click (fn [e] (on-params-change (swap! state toggle-sort-by "invoice-number"))) :style {:width "18%" :cursor "pointer"}} "Invoice #"
|
||||||
(sort-icon "invoice-number" sort-by asc)]
|
(sort-icon "invoice-number" sort-by asc)]
|
||||||
[:th {:on-click (fn [e] (on-params-change (swap! state toggle-sort-by "date")))} "Date"
|
[:th {:on-click (fn [e] (on-params-change (swap! state toggle-sort-by "date"))) :style {:width "16%" :cursor "pointer"}} "Date"
|
||||||
(sort-icon "date" sort-by asc)]
|
(sort-icon "date" sort-by asc)]
|
||||||
[:th {:on-click (fn [e] (on-params-change (swap! state toggle-sort-by "total")))} "Amount"
|
[:th {:on-click (fn [e] (on-params-change (swap! state toggle-sort-by "total"))) :style {:width "16%" :cursor "pointer"}} "Amount"
|
||||||
(sort-icon "total" sort-by asc)]]]
|
(sort-icon "total" sort-by asc)]]]
|
||||||
[:tbody
|
[:tbody
|
||||||
(if (:loading @status)
|
(if (:loading @status)
|
||||||
|
|||||||
Reference in New Issue
Block a user