Class: Www::FeatureListComponent

Inherits:
ApplicationComponent show all
Includes:
IconHelper
Defined in:
app/components/www/feature_list_component.rb

Constant Summary collapse

DEFAULT_ICON =
'list-check'

Constants included from IconHelper

IconHelper::CUSTOM_ICON_MAP, IconHelper::CUSTOM_SVG_DIR, IconHelper::DEFAULT_FAMILY

Instance Method Summary collapse

Methods included from IconHelper

#account_nav_icon, #fa_icon, #star_rating_html

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(features:, extra_classes: nil, columns: 2, section_title: nil, section_icon: nil, section_description: nil, section_link: nil, section_link_title: nil, show_learn_more: false, stacked: false, border: nil) ⇒ FeatureListComponent

Returns a new instance of FeatureListComponent.

Parameters:

  • border (Symbol, nil) (defaults to: nil)

    Border style: :top, :bottom, or :both

  • features (Object)
  • extra_classes (Object, nil) (defaults to: nil)
  • columns (Integer) (defaults to: 2)
  • section_title (Object, nil) (defaults to: nil)
  • section_icon (String, nil) (defaults to: nil)

    Font Awesome icon name (defaults to 'list-check')

  • section_description (Object, nil) (defaults to: nil)
  • section_link (Object, nil) (defaults to: nil)
  • section_link_title (Object, nil) (defaults to: nil)
  • show_learn_more (Boolean) (defaults to: false)
  • stacked (Boolean) (defaults to: false)


19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/components/www/feature_list_component.rb', line 19

def initialize(features:, extra_classes: nil, columns: 2, section_title: nil, section_icon: nil, section_description: nil, section_link: nil, section_link_title: nil, show_learn_more: false, stacked: false, border: nil)
  super()
  @features = features
  @extra_classes = extra_classes
  @columns = columns
  @section_title = section_title
  @section_icon = section_icon || DEFAULT_ICON
  @section_description = section_description
  @section_link = section_link
  @section_link_title = section_link_title
  @show_learn_more = show_learn_more
  @stacked = stacked
  @border = border
end

Instance Method Details

#border_classesObject



34
35
36
37
38
39
40
# File 'app/components/www/feature_list_component.rb', line 34

def border_classes
  case @border
  when :top then 'border-top'
  when :bottom then 'border-bottom'
  when :both then 'border-top border-bottom'
  end
end