Class: App::BannerComponent
- Inherits:
-
SparkComponents::Component
- Object
- SparkComponents::Component
- App::BannerComponent
- Defined in:
- app/components/spark/app/banner_component.rb
Instance Method Summary collapse
Instance Method Details
#render ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/components/spark/app/banner_component.rb', line 10 def render add_class theme content_tag(:header, tag_attrs) do concat content_tag(:div, class: join_class("content")) { concat component("ui/icon", name: theme_icon, class: join_class("icon")) concat content_tag(:div, || self, class: join_class("message")) } if href concat content_tag(:div, class: join_class("action")) { link_to(action_text, href, class: join_class("action-item"), target: target) } end end end |
#theme_icon ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/components/spark/app/banner_component.rb', line 25 def theme_icon case theme.to_sym when :message then "message-text" when :alert then "message-alert" when :admin then "admin-user" end end |