can hide.
This commit is contained in:
@@ -86,8 +86,8 @@
|
||||
(fn [{:keys [visible?]} & children]
|
||||
[css-transition-group {:in visible? :class-names {:exitDone "bounce animated" :exit "fadeOutRight animated" :enter "fadeInRight animated"} :timeout 300 :onEnter (fn [] (reset! final-state true )) :onExited (fn [] (reset! final-state false))}
|
||||
(if (or @final-state visible?)
|
||||
[:aside {:class "column is-3 aside menu hero is-fullheight" :style {:height "100vh" :overflow "auto"}}
|
||||
[:div.sub-main {:style {:padding-bottom "80px"}}children ]]
|
||||
[:aside {:class "column is-3 aside menu" :style {:height "calc(100vh - 46px)" :overflow "auto"}}
|
||||
[:div.sub-main {} children ]]
|
||||
[:div])])))
|
||||
|
||||
(defn side-bar-layout [{:keys [side-bar main ap bottom right-side-bar right-side-bar-visible?]}]
|
||||
@@ -95,12 +95,12 @@
|
||||
client @(re-frame/subscribe [::subs/client])]
|
||||
[:div
|
||||
[navbar ap]
|
||||
[:div {:class "columns has-shadow", :style {:margin-bottom "0px" :height "100vh"} :id "mail-app" }
|
||||
[:div {:class "columns has-shadow", :style {:margin-bottom "0px" :height "calc(100vh - 46px)" } :id "mail-app" }
|
||||
[:aside {:class "column aside menu is-2 " }
|
||||
[:div.main.left-nav
|
||||
[:div side-bar
|
||||
]]]
|
||||
[:div {:class "column messages hero is-fullheight " :style { :overflow "auto" }, :id "message-feed"}
|
||||
[:div {:class "column messages hero " :style { :overflow "auto" }, :id "message-feed"}
|
||||
^{:key (str "active-page-" (:name client))}
|
||||
[:div.inbox-messages main]]
|
||||
[appearing-side-bar {:visible? right-side-bar-visible?} right-side-bar]]
|
||||
|
||||
@@ -37,6 +37,14 @@
|
||||
(defn stop-form [db form]
|
||||
(update db ::forms dissoc form))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::form-closing
|
||||
(fn [db [_ f]]
|
||||
|
||||
(-> db
|
||||
(assoc-in [:admin :adding-client?] false)
|
||||
(stop-form f))))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::new
|
||||
(fn [db [_ client-id]]
|
||||
@@ -99,6 +107,7 @@
|
||||
:on-error [::save-error]}}
|
||||
{:db new-client-form}))))
|
||||
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::save-complete
|
||||
(fn [db [_ client]]
|
||||
@@ -185,8 +194,13 @@
|
||||
[clients-table]])])
|
||||
|
||||
|
||||
(defn side-bar-form [_ children]
|
||||
[:div [:a.delete.is-pulled-right {:on-click (dispatch-event [::form-closing ::new-client])}] [:div children]])
|
||||
|
||||
(defn new-client-form []
|
||||
(let [{error :error new-client :data } @(re-frame/subscribe [::form ::new-client])]
|
||||
|
||||
[side-bar-form {}
|
||||
[:form
|
||||
[:h1.title.is-2 "Add client"]
|
||||
[:div.field
|
||||
@@ -234,14 +248,14 @@
|
||||
(for [location (:locations new-client)]
|
||||
^{:key location} [:li location ])]]]
|
||||
|
||||
[:section.section {:style {:padding-bottom "0.75em" :padding-top "0.75em"}}
|
||||
[:div {:style {:padding-bottom "0.75em" :padding-top "0.75em"}}
|
||||
[:h2.subtitle "Address"]
|
||||
[address-field {:field [:address]
|
||||
:event ::change-new
|
||||
:subscription new-client}]]
|
||||
|
||||
[:section.section {:style {:padding-bottom "0.75em" :padding-top "0.75em" :background "hsl(0, 0%, 96%)"}}
|
||||
[:h2.subtitle "Add bank account"]
|
||||
[:div {:style {:padding-bottom "0.75em" :padding-top "0.75em" :background "hsl(0, 0%, 96%)"}}
|
||||
[:label.label "General"]
|
||||
[horizontal-field
|
||||
nil
|
||||
@@ -361,7 +375,7 @@
|
||||
""
|
||||
"disabled")
|
||||
:on-click (dispatch-event [::save-new-client])
|
||||
:class (str @(re-frame/subscribe [::loading-class ::new-client]) (when error " animated shake"))} "Save"]]))
|
||||
:class (str @(re-frame/subscribe [::loading-class ::new-client]) (when error " animated shake"))} "Save"]]]))
|
||||
|
||||
(defn admin-clients-page []
|
||||
(let [{:keys [adding-client?]} @(re-frame/subscribe [::subs/admin])]
|
||||
|
||||
Reference in New Issue
Block a user