Class: Www::LandingPageCtaLinkComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Www::LandingPageCtaLinkComponent
- Defined in:
- app/components/www/landing_page_cta_link_component.rb
Instance Method Summary collapse
-
#initialize(url: nil, title:, fa_icon: nil, svg_icon: nil, icon_url: nil, style: :solid, data: nil, panel: nil) ⇒ LandingPageCtaLinkComponent
constructor
A new instance of LandingPageCtaLinkComponent.
- #panel_button? ⇒ Boolean
- #panel_target ⇒ Object
Methods inherited from ApplicationComponent
#cms_link, #fetch_or_fallback, #image_asset_tag, #image_tag, #number_to_currency, #number_with_delimiter, #post_path, #post_url, #strip_tags
Constructor Details
#initialize(url: nil, title:, fa_icon: nil, svg_icon: nil, icon_url: nil, style: :solid, data: nil, panel: nil) ⇒ LandingPageCtaLinkComponent
Returns a new instance of LandingPageCtaLinkComponent.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/components/www/landing_page_cta_link_component.rb', line 10 def initialize(url: nil, title:, fa_icon: nil, svg_icon: nil, icon_url: nil, style: :solid, data: nil, panel: nil) super() @url = url @title = title @fa_icon = fa_icon @svg_icon = svg_icon @icon_url = icon_url @style = style @data = data @panel = panel end |
Instance Method Details
#panel_button? ⇒ Boolean
22 23 24 |
# File 'app/components/www/landing_page_cta_link_component.rb', line 22 def @panel == :contact end |
#panel_target ⇒ Object
26 27 28 |
# File 'app/components/www/landing_page_cta_link_component.rb', line 26 def panel_target '#offcanvas-contact' if @panel == :contact end |