Adding reminders view
This commit is contained in:
39
src/cljs/auto_ap/views/pages/admin/reminders.cljs
Normal file
39
src/cljs/auto_ap/views/pages/admin/reminders.cljs
Normal file
@@ -0,0 +1,39 @@
|
||||
(ns auto-ap.views.pages.admin.reminders
|
||||
(:require-macros [cljs.core.async.macros :refer [go]])
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[reagent.core :as reagent]
|
||||
[auto-ap.subs :as subs]
|
||||
[auto-ap.events.admin.reminders :as events]
|
||||
[auto-ap.views.utils :refer [login-url dispatch-value-change dispatch-event]]
|
||||
[cljs.reader :as edn]
|
||||
[auto-ap.routes :as routes]
|
||||
[bidi.bidi :as bidi]))
|
||||
(defn reminders-table []
|
||||
(let [reminders (or @(re-frame/subscribe [::subs/reminders]) [])]
|
||||
[:table {:class "table", :style {:width "100%"}}
|
||||
[:thead
|
||||
[:tr
|
||||
[:th "Vendor"]
|
||||
[:th "Scheduled Date"]
|
||||
[:th "Status"]]]
|
||||
[:tbody (for [{:keys [id vendor-name scheduled sent]} reminders]
|
||||
^{:key id}
|
||||
[:tr
|
||||
[:td vendor-name]
|
||||
[:td (.toString scheduled)]
|
||||
[:td (when sent
|
||||
[:span [:span.icon [:i.fa.fa-check]] "Sent " (.toString sent)]) ]])]]))
|
||||
|
||||
|
||||
(defn admin-reminders-page []
|
||||
[(with-meta
|
||||
(fn []
|
||||
[:div {:class "inbox-messages"}
|
||||
[:div.hero
|
||||
[:div.hero-body
|
||||
[:div.container
|
||||
[:div
|
||||
[:h1.title "Reminders"]
|
||||
[reminders-table]]]]]])
|
||||
{:component-did-mount (fn []
|
||||
(re-frame/dispatch [::events/mounted]))})])
|
||||
Reference in New Issue
Block a user