adding new invoices has validation.
This commit is contained in:
@@ -21,13 +21,21 @@
|
||||
[:footer.modal-card-foot
|
||||
foot])]])
|
||||
|
||||
(defn action-modal [{:keys [title action-text id save-event]} & rest]
|
||||
(defn action-modal [{:keys [title action-text id save-event can-submit?] :or {can-submit? true}} & rest]
|
||||
(let [{:keys [visible? saving?]} @(re-frame/subscribe [::subs/modal-state id])]
|
||||
(when visible?
|
||||
(-> [modal {:title title
|
||||
:foot [:a.button.is-primary {:on-click (fn []
|
||||
:foot [:button.button.is-primary {:on-click (fn []
|
||||
(re-frame/dispatch [::events/modal-status id {:saving? true}])
|
||||
(re-frame/dispatch save-event))
|
||||
:disabled (cond saving?
|
||||
"disabled"
|
||||
|
||||
(not can-submit?)
|
||||
"disabled"
|
||||
|
||||
:else
|
||||
"")
|
||||
:class (when saving?
|
||||
"is-loading")}
|
||||
[:span action-text]]
|
||||
|
||||
Reference in New Issue
Block a user