Class: Keystone::Ui::CtaBannerComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Keystone::Ui::CtaBannerComponent
- Defined in:
- app/components/keystone/ui/cta_banner_component.rb
Constant Summary collapse
- CARD_LAYOUT_CLASSES =
"rounded-2xl border px-6 py-12 text-center lg:px-16 lg:py-16"- TITLE_BASE_CLASSES =
"mb-4 text-3xl font-bold tracking-tight sm:text-4xl"- SUBTITLE_BASE_CLASSES =
"mx-auto mb-8 max-w-2xl text-lg"- ACTIONS_CLASSES =
"flex flex-wrap justify-center gap-4"
Instance Attribute Summary collapse
-
#subtitle ⇒ Object
readonly
Returns the value of attribute subtitle.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #actions_classes ⇒ Object
- #classes ⇒ Object
-
#initialize(title:, subtitle: nil) ⇒ CtaBannerComponent
constructor
A new instance of CtaBannerComponent.
- #subtitle? ⇒ Boolean
- #subtitle_classes ⇒ Object
- #title_classes ⇒ Object
Constructor Details
#initialize(title:, subtitle: nil) ⇒ CtaBannerComponent
Returns a new instance of CtaBannerComponent.
13 14 15 16 |
# File 'app/components/keystone/ui/cta_banner_component.rb', line 13 def initialize(title:, subtitle: nil) @title = title @subtitle = subtitle end |
Instance Attribute Details
#subtitle ⇒ Object (readonly)
Returns the value of attribute subtitle.
11 12 13 |
# File 'app/components/keystone/ui/cta_banner_component.rb', line 11 def subtitle @subtitle end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
11 12 13 |
# File 'app/components/keystone/ui/cta_banner_component.rb', line 11 def title @title end |
Instance Method Details
#actions_classes ⇒ Object
34 35 36 |
# File 'app/components/keystone/ui/cta_banner_component.rb', line 34 def actions_classes ACTIONS_CLASSES end |
#classes ⇒ Object
18 19 20 |
# File 'app/components/keystone/ui/cta_banner_component.rb', line 18 def classes "#{CARD_LAYOUT_CLASSES} border-surface-200 dark:border-surface-700 bg-surface-50 dark:bg-surface-800" end |
#subtitle? ⇒ Boolean
30 31 32 |
# File 'app/components/keystone/ui/cta_banner_component.rb', line 30 def subtitle? !@subtitle.nil? end |
#subtitle_classes ⇒ Object
26 27 28 |
# File 'app/components/keystone/ui/cta_banner_component.rb', line 26 def subtitle_classes "#{SUBTITLE_BASE_CLASSES} text-surface-500 dark:text-surface-400" end |
#title_classes ⇒ Object
22 23 24 |
# File 'app/components/keystone/ui/cta_banner_component.rb', line 22 def title_classes "#{TITLE_BASE_CLASSES} text-surface-900 dark:text-white" end |