Fixed alert message, alert if email is not verified

This commit is contained in:
2024-09-17 14:55:08 +02:00
parent b5021d5683
commit cb1879055c
2 changed files with 2 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ class ApplicationController < ActionController::Base
def verified_user!
if user_signed_in?
unless current_user.verified?
flash[:notice] = "Please verify your email!"
flash[:alert] = "Verify your email!"
redirect_to profile_path
end
end

View File

@@ -1,6 +1,6 @@
<%= turbo_frame_tag "flash" do %>
<% flash.each do |type, message| %>
<div data-controller="flash" data-flash-target="toast" class="fixed z-50 top-2 right-2 border p-3 shadow-lg opacity-100 translate-x-full transition-transform ease-in-out duration-300 transform <%= type == :alert ? "bg-red-50 border-red-500/50 text-red-800" : "bg-green-50 border-green-300/90 text-green-800" %>">
<div data-controller="flash" data-flash-target="toast" class="fixed z-50 top-2 right-2 border p-3 shadow-lg opacity-100 translate-x-full transition-transform ease-in-out duration-300 transform <%= type == "alert" ? "bg-red-50 border-red-500/50 text-red-800" : "bg-green-50 border-green-300/90 text-green-800" %>">
<div class="flex items-center justify-between gap-4">
<%= icon "check", class: "size-4 stroke-primary-500" %>
<span class="text-l"><%= message %></span>