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

@@ -101,7 +101,9 @@
[:a {:class "button is-danger is-block is-bold" :href (bidi/path-for routes/routes :index)}
[:span {:class "compose"} "Back"]]]]]
[:div {:class "column messages hero is-fullheight", :id "message-feed"}
^{:key (str "active-page-" (:name @company))} [pages/active-page ap]]]
^{:key (str "active-page-" (:name @company))}
[:div.inbox-messages
[pages/active-page ap]]]]
[:footer {:class "footer"}
[:div {:class "container"}
[:div {:class "content has-text-centered"}
@@ -181,7 +183,9 @@
[:a {:class "button is-danger is-block is-bold" :href (bidi/path-for routes/routes :new-invoice)}
[:span {:class "compose"} "New Invoice"]]]]]
[:div {:class "column messages hero is-fullheight", :id "message-feed"}
^{:key (str "active-page-" (:name @company))} [pages/active-page ap]]]
^{:key (str "active-page-" (:name @company))}
[:div.inbox-messages
[pages/active-page ap]]]]
[:footer {:class "footer"}
[:div {:class "container"}
[:div {:class "content has-text-centered"}

View File

@@ -52,7 +52,7 @@
(defmethod active-page :invoices []
[(with-meta
(fn []
[:div {:class "inbox-messages"}
[:div
[:h1.title "All invoices"]])
{:component-did-mount (fn []
(go

View File

@@ -10,8 +10,5 @@
[bidi.bidi :as bidi]))
(defn admin-page []
[:div {:class "inbox-messages"}
[:div.hero
[:div.hero-body
[:div.container
[:h1.title "Admin"]]]]])
[:div
[:h1.title "Admin"]])

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]))})])

View File

@@ -93,7 +93,7 @@
(fn []
(let [invoice-page (re-frame/subscribe [::invoice-page])
status (re-frame/subscribe [::subs/status])]
[:div {:class "inbox-messages"}
[:div
[:h1.title "Upload invoices"]
[dropzone]

View File

@@ -3,10 +3,7 @@
[auto-ap.routes :as routes]))
(defn index-page []
[:div {:class "inbox-messages"}
[:div.hero
[:div.hero-body
[:div.container
[:h1.title "Dashboard"]
[:h2.subtitle "To get started, "
[:a {:href (bidi/path-for routes/routes :import-invoices)} "Import some invoices"]]]]]])
[:div
[:h1.title "Dashboard"]
[:h2.subtitle "To get started, "
[:a {:href (bidi/path-for routes/routes :import-invoices)} "Import some invoices"]]])

View File

@@ -10,10 +10,7 @@
[bidi.bidi :as bidi]))
(defn login-page []
[:div {:class "inbox-messages"}
[:div.hero
[:div.hero-body
[:div.container
[:h1.title "Login"]
[:h2.subtitle "To get started, "
[:a {:href login-url} "Login with Google"]]]]]])
[:div
[:h1.title "Login"]
[:h2.subtitle "To get started, "
[:a {:href login-url} "Login with Google"]]])

View File

@@ -5,7 +5,7 @@
(defn new-invoice-page []
(let [form-data (re-frame/subscribe [::subs/new-invoice-form])]
[:div {:class "inbox-messages"}
[:div
[:form
[:h1.title "New Invoice"]
[:div.field

View File

@@ -9,10 +9,10 @@
(fn []
(let [invoices (re-frame/subscribe [::subs/unpaid-invoices])
status (re-frame/subscribe [::subs/status])]
[:div {:class "inbox-messages"}
[:div
[:h1.title "Paid invoices"]
(if (:loading @status)
[:div {:class "inbox-messages"}
[:div
[:h1.title
[:i.fa.fa-spin.fa-spinner]]]
[:table {:class "table", :style {:width "100%"}}