diff options
author | Griffin Smith <grfn@gws.fyi> | 2021-12-24T19·26-0500 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2021-12-24T19·29+0000 |
commit | 15a9443e3668fc164b1a61095e6a5f22ae48f6f0 (patch) | |
tree | bbd82531d54e26211f913107e20d6c4e336a6ca4 /users/grfn/bbbg/src/bbbg/views/flash.clj | |
parent | 4c23a9c1d494d666ac82ab6e1d0ab0961e41bbad (diff) |
feat(grfn/bbbg): Add styling for flash messages r/3372
Change-Id: Ic8594217e6acceaad041dda8acf135bf7f3408e9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4585 Reviewed-by: grfn <grfn@gws.fyi> Autosubmit: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
Diffstat (limited to 'users/grfn/bbbg/src/bbbg/views/flash.clj')
-rw-r--r-- | users/grfn/bbbg/src/bbbg/views/flash.clj | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/users/grfn/bbbg/src/bbbg/views/flash.clj b/users/grfn/bbbg/src/bbbg/views/flash.clj index 7fcebd645509..a44b21d4cb24 100644 --- a/users/grfn/bbbg/src/bbbg/views/flash.clj +++ b/users/grfn/bbbg/src/bbbg/views/flash.clj @@ -1,7 +1,7 @@ (ns bbbg.views.flash (:require [clojure.spec.alpha :as s])) -(s/def :flash/type #{:success :error :warning}) +(s/def :flash/type #{:success :error :warning :info}) (s/def :flash/message string?) (s/def ::flash (s/keys :req [:flash/type :flash/message])) (s/fdef add-flash :args (s/cat :resp map? :flash ::flash) :ret map?) @@ -31,3 +31,9 @@ [:li.flash-message {:class (str "flash-" (-> message :flash/type name))} (:flash/message message)])]))) + +(def test-flash + {:flash/messages + (for [type [:success :error :warning :info]] + {:flash/type type + :flash/message (str "Sample " type " message")})}) |