big updates for re-org.

This commit is contained in:
Bryce Covert
2017-12-19 22:00:46 -08:00
parent b1414ebe60
commit 2af3752041
12 changed files with 456 additions and 356 deletions

View File

@@ -0,0 +1,34 @@
(ns auto-ap.views.pages.paid-invoices
(:require [re-frame.core :as re-frame]
[auto-ap.subs :as subs]
[auto-ap.events :as events]))
(def paid-invoices-page
(with-meta
(fn []
(let [invoices (re-frame/subscribe [::subs/unpaid-invoices])
status (re-frame/subscribe [::subs/status])]
[:div {:class "inbox-messages"}
[:h1.title "Paid invoices"]
(if (:loading @status)
[:div {:class "inbox-messages"}
[:h1.title
[:i.fa.fa-spin.fa-spinner]]]
[:table {:class "table", :style {:width "100%"}}
[:thead
[:tr
[:th "Vendor"]
[:th "Customer"]
[:th "Invoice #"]
[:th "Date"]
[:th "Amount"]]]
[:tbody (for [{:keys [company invoice-number date total id vendor] :as i} @invoices]
^{:key (str company "-" invoice-number "-" date "-" total "-" id)}
[:tr
[:td vendor]
[:td company]
[:td invoice-number]
[:td date]
[:td total]])]])]))
{:component-will-mount #(re-frame/dispatch-sync [::events/view-unpaid-invoices]) }))