Handle displaying notice/alert flashes

This commit is contained in:
Andrew Tomaka 2024-08-01 21:34:25 -04:00
parent a3a09e845f
commit 76918fff3e
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
2 changed files with 14 additions and 0 deletions

View file

@ -2,6 +2,12 @@
@tailwind components;
@tailwind utilities;
.msg-notice {
@apply bg-green-300 text-green-900;
}
.msg-alert {
@apply bg-red-300 text-red-900;
}
/*
@layer components {

View file

@ -22,6 +22,14 @@
</ul>
</nav>
<% if flash.any? %>
<% flash.each do |type, msg| %>
<div class="py-2 px-4 font-bold msg-<%= type %>">
<%= msg %>
</div>
<% end %>
<% end %>
<main class="container mx-auto mt-28 px-5 flex">
<%= yield %>
</main>