fix flash messages

pull/105/head
Alex Turchyn 2 years ago
parent ac5d0c8cc3
commit 4977ee429c

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path>
<path d="M12 9v4"></path>
<path d="M12 16v.01"></path>
</svg>

After

Width:  |  Height:  |  Size: 414 B

@ -14,7 +14,7 @@
<body> <body>
<turbo-frame id="modal"></turbo-frame> <turbo-frame id="modal"></turbo-frame>
<%= render 'shared/navbar' %> <%= render 'shared/navbar' %>
<% if flash.present? %><% render 'shared/flash' %><% end %> <% if flash.present? %><%= render 'shared/flash' %><% end %>
<div class="max-w-6xl mx-auto px-4 md:px-2"> <div class="max-w-6xl mx-auto px-4 md:px-2">
<%= yield %> <%= yield %>
</div> </div>

@ -10,7 +10,7 @@
<%= stylesheet_pack_tag 'application', media: 'all' %> <%= stylesheet_pack_tag 'application', media: 'all' %>
</head> </head>
<body> <body>
<% if flash.present? %><% render 'shared/flash' %><% end %> <% if flash.present? %><%= render 'shared/flash' %><% end %>
<%= yield %> <%= yield %>
</body> </body>
</html> </html>

@ -1,11 +1,15 @@
<div id="flash" class="absolute top-0 w-full h-0"> <div id="flash" class="absolute top-0 w-full h-0">
<div class="max-w-xl mx-auto mt-1.5"> <div class="max-w-xl mx-auto mt-1.5">
<div class="alert py-3"> <div class="alert py-3">
<%= svg_icon('info_circle', class: 'stroke-info flex-shrink-0 w-6 h-6') %> <% if flash[:notice] %>
<%= svg_icon('info_circle', class: 'stroke-info flex-shrink-0 w-6 h-6') %>
<% else %>
<%= svg_icon('exclamation_circle', class: 'stroke-error flex-shrink-0 w-6 h-6') %>
<% end %>
<div> <div>
<span><%= flash[:notice] || flash[:alert] %></span> <span><%= flash[:notice] || flash[:alert] %></span>
</div> </div>
<a href="#" class="w-6 h-6 rounded-lg text-center hover:bg-base-300" onclick="[event.preventDefault(), window.flash.remove()]">&times;</a> <a href="#" onclick="[event.preventDefault(), window.flash.remove()]">&times;</a>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save