Class: Spotlight::TitleComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Spotlight::TitleComponent
- Defined in:
- app/components/spotlight/title_component.rb
Overview
Draws the title in the masthead
Instance Method Summary collapse
-
#initialize(title:, subtitle:) ⇒ TitleComponent
constructor
A new instance of TitleComponent.
- #subtitle ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(title:, subtitle:) ⇒ TitleComponent
Returns a new instance of TitleComponent.
6 7 8 9 10 |
# File 'app/components/spotlight/title_component.rb', line 6 def initialize(title:, subtitle:) @title = title @subtitle = subtitle super end |
Instance Method Details
#subtitle ⇒ Object
16 17 18 19 20 |
# File 'app/components/spotlight/title_component.rb', line 16 def subtitle return unless @subtitle tag.small(@subtitle, class: 'd-none d-md-block py-2 fs-4') end |
#title ⇒ Object
12 13 14 |
# File 'app/components/spotlight/title_component.rb', line 12 def title tag.h1 @title, class: 'site-title h2' end |