Class: Spark::Banner

Inherits:
Component::Base show all
Defined in:
app/components/spark/banner.rb

Constant Summary collapse

THEME =
%i[message alert warning admin].freeze

Instance Method Summary collapse

Methods inherited from Component::Base

#selector, #to_s, #unique_id

Constructor Details

#initializeBanner

Returns a new instance of Banner.



10
11
12
13
14
15
# File 'app/components/spark/banner.rb', line 10

def initialize(*)
  super

  tag_attrs.add(role: "banner")
  classname.add("app-banner", "theme-#{@theme}")
end

Instance Method Details

#theme_iconObject



20
21
22
23
24
25
26
27
# File 'app/components/spark/banner.rb', line 20

def theme_icon
  case @theme.to_sym
  when :message then "message-text"
  when :alert then "message-alert"
  when :warning then "message-alert"
  when :admin then "admin-user"
  end
end

#to_partial_pathObject



17
18
# File 'app/components/spark/banner.rb', line 17

def to_partial_path
end