Sha256: b295d32a6739ffc145eed8374dd4d64621e6ad4b5d18bdb2b8efdefbe785b0db

Contents?: true

Size: 467 Bytes

Versions: 22

Compression:

Stored size: 467 Bytes

Contents

module Spina
  module UserInterface
    class FlashMessageComponent < ApplicationComponent
      
      def initialize(type:, message:)
        @type = type
        @message = message
      end
      
      def confetti?
        @type == "confetti" && !Spina.config.party_pooper
      end
      
      def theme
        case @type
        when "alert", "error"
          "bg-red-400"
        else
          "bg-gray-400"
        end
      end
      
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spina-2.12.0 app/components/spina/user_interface/flash_message_component.rb
spina-2.11.0 app/components/spina/user_interface/flash_message_component.rb
spina-2.10.0 app/components/spina/user_interface/flash_message_component.rb
spina-2.9.1 app/components/spina/user_interface/flash_message_component.rb
spina-2.9.0 app/components/spina/user_interface/flash_message_component.rb
spina-2.8.1 app/components/spina/user_interface/flash_message_component.rb
spina-2.8.0 app/components/spina/user_interface/flash_message_component.rb
spina-2.7.0 app/components/spina/user_interface/flash_message_component.rb
spina-2.6.2 app/components/spina/user_interface/flash_message_component.rb
spina-2.6.1 app/components/spina/user_interface/flash_message_component.rb
spina-2.6.0 app/components/spina/user_interface/flash_message_component.rb
spina-2.5.0 app/components/spina/user_interface/flash_message_component.rb
spina-2.4.0 app/components/spina/user_interface/flash_message_component.rb
spina-2.3.5 app/components/spina/user_interface/flash_message_component.rb
spina-2.3.4 app/components/spina/user_interface/flash_message_component.rb
spina-2.3.3 app/components/spina/user_interface/flash_message_component.rb
spina-2.3.2 app/components/spina/user_interface/flash_message_component.rb
spina-2.3.1 app/components/spina/user_interface/flash_message_component.rb
spina-2.3.0 app/components/spina/user_interface/flash_message_component.rb
spina-2.2.0 app/components/spina/user_interface/flash_message_component.rb