better warning behavior.A

This commit is contained in:
Bryce Covert
2020-04-20 08:12:30 -07:00
parent 773ae19f5c
commit 01c776a72e
3 changed files with 49 additions and 23 deletions

View File

@@ -3,7 +3,7 @@
[reagent.core :as r]
[auto-ap.events :as events]
[auto-ap.subs :as subs]
[auto-ap.views.utils :refer [with-keys]]))
[auto-ap.views.utils :refer [with-keys appearing]]))
(defn modal [{:keys [title foot hide-event class]} & body]
[:div.modal.is-active (cond-> {}
@@ -43,9 +43,15 @@
]
:id id
:hide-event [::events/modal-status id {:visible? false}]}
(when error-message
[:div.notification.is-warning error-message])
(when warning
[:div.notification.is-info warning])]
[appearing {:visible? error-message
:timeout 200
:enter-class "appear"
:exit-class "disappear"}
[:div.notification.is-warning error-message]]
[appearing {:visible? warning
:timeout 200
:enter-class "appear"
:exit-class "disappear"}
[:div.notification.is-info warning]]]
(into (r/children (r/current-component)))
(into [(when saving? [:div.is-overlay {:style {"backgroundColor" "rgba(150,150,150, 0.5)"}}])]))])))