Class: Oversee::Flash

Inherits:
Phlex::HTML
  • Object
show all
Includes:
Phlex::Rails::Helpers::Flash
Defined in:
app/components/oversee/flash.rb

Instance Method Summary collapse

Instance Method Details

#view_templateObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/components/oversee/flash.rb', line 6

def view_template
  div(id: :flash, class: "fixed bottom-0 right-0 mb-8 mr-8 w-80 z-50") do
    if !flash.empty?
      div(
        class: "flex flex-col gap-2 p-4 bg-white border border-gray-200/75 border-b-2 rounded-lg transition-all opacity-0 transform duration-300",
        data: { controller: :notification }
      ) do
        notice if notice?
        alert if alert?
      end
    end
  end
end