only clickable at the right moment.

This commit is contained in:
Bryce Covert
2018-05-14 09:50:53 -07:00
parent 70766c6d4b
commit c2a5808d0c

View File

@@ -88,11 +88,17 @@
(def unpaid-invoices-page
(with-meta
(fn []
(let [checked (:checked @(re-frame/subscribe [::invoice-page]))]
(let [checked (:checked @(re-frame/subscribe [::invoice-page]))
current-company @(re-frame/subscribe [::subs/company])]
[:div
[:h1.title "Unpaid invoices"]
[:div.is-pulled-right
[:button.button.is-primary {:on-click (dispatch-event [::print-checks ])} "Print check(s)"]]
(when current-company
[:button.button.is-primary {:on-click (dispatch-event [::print-checks ])
:disabled (if (seq checked)
""
"disabled")
} "Print check(s)"])]
[invoice-table {:id :unpaid
:params (re-frame/subscribe [::params])