fixing animations.

This commit is contained in:
Bryce Covert
2018-04-13 16:09:32 -07:00
parent 121a38f20d
commit c8e959bd40
11 changed files with 82 additions and 97 deletions

View File

@@ -25,56 +25,53 @@
[:td email]])]]))
(defn admin-companies-page []
[:div {:class "inbox-messages"}
[:div.hero
[:div.hero-body
[:div.container
(let [companies (re-frame/subscribe [::subs/companies])
editing-company (:company @(re-frame/subscribe [::subs/admin]))]
[:div
[:h1.title "Companies"]
[companies-table]
[:div
(let [companies (re-frame/subscribe [::subs/companies])
editing-company (:company @(re-frame/subscribe [::subs/admin]))]
[:div
[:h1.title "Companies"]
[companies-table]
(when editing-company
[:div.modal.is-active
[:div.modal-background {:on-click (fn [] (re-frame/dispatch [::events/edit nil]))}]
[:div.modal-card
[:header.modal-card-head
[:p.modal-card-title
(str "Edit " (:name editing-company))]
[:button.delete {:on-click (fn [] (re-frame/dispatch [::events/edit nil]))}]]
[:section.modal-card-body
[horizontal-field
[:label.label "Name"]
[:div.control
[bind-field
[:input.input {:type "text"
:field :name
:spec ::entity/name
:event ::events/change
:subscription editing-company}]]]]
(when editing-company
[:div.modal.is-active
[:div.modal-background {:on-click (fn [] (re-frame/dispatch [::events/edit nil]))}]
[:div.modal-card
[:header.modal-card-head
[:p.modal-card-title
(str "Edit " (:name editing-company))]
[:button.delete {:on-click (fn [] (re-frame/dispatch [::events/edit nil]))}]]
[:section.modal-card-body
[horizontal-field
[:label.label "Name"]
[:div.control
[bind-field
[:input.input {:type "text"
:field :name
:spec ::entity/name
:event ::events/change
:subscription editing-company}]]]]
[horizontal-field
[:label.label "Email"]
[:div.control
[bind-field
[:input.input {:type "email"
:field :email
:spec ::entity/name
:event ::events/change
:subscription editing-company}]]]]
(when (:saving? editing-company) [:div.is-overlay {:style {"backgroundColor" "rgba(150,150,150, 0.5)"}}])]
[:footer.modal-card-foot
[:a.button.is-primary {:on-click (fn [] (re-frame/dispatch [::events/save]))}
[:span "Save"]
(when (:saving? editing-company)
[:span.icon
[:i.fa.fa-spin.fa-spinner]])]]]])])]]]])
[horizontal-field
[:label.label "Email"]
[:div.control
[bind-field
[:input.input {:type "email"
:field :email
:spec ::entity/name
:event ::events/change
:subscription editing-company}]]]]
(when (:saving? editing-company) [:div.is-overlay {:style {"backgroundColor" "rgba(150,150,150, 0.5)"}}])]
[:footer.modal-card-foot
[:a.button.is-primary {:on-click (fn [] (re-frame/dispatch [::events/save]))}
[:span "Save"]
(when (:saving? editing-company)
[:span.icon
[:i.fa.fa-spin.fa-spinner]])]]]])])])

View File

@@ -31,12 +31,8 @@
(defn admin-reminders-page []
[(with-meta
(fn []
[:div {:class "inbox-messages"}
[:div.hero
[:div.hero-body
[:div.container
[:div
[:h1.title "Reminders"]
[reminders-table]]]]]])
[:div
[:h1.title "Reminders"]
[reminders-table]])
{:component-did-mount (fn []
(re-frame/dispatch [::events/mounted]))})])

View File

@@ -237,21 +237,18 @@
(defn admin-vendors-page []
[(with-meta
(fn []
[:div {:class "inbox-messages"}
[:div.hero
[:div.hero-body
[:div.container
(let [vendors (re-frame/subscribe [::subs/vendors])
editing-vendor (:vendor @(re-frame/subscribe [::subs/admin]))]
[:div
[:h1.title "Vendors"]
[vendors-table]
[:div.inbox-messages
(let [vendors (re-frame/subscribe [::subs/vendors])
editing-vendor (:vendor @(re-frame/subscribe [::subs/admin]))]
[:div
[:h1.title "Vendors"]
[vendors-table]
[:a.button.is-primary.is-large {:on-click (dispatch-event [::events/new])} "New vendor"]
[:a.button.is-primary.is-large {:on-click (dispatch-event [::events/new])} "New vendor"]
(when editing-vendor
[edit-dialog]
)])]]]])
(when editing-vendor
[edit-dialog]
)])])
{:component-did-mount (fn []
(re-frame/dispatch [::events/mounted]))})])