Class: Primer::TimelineItemComponent
- Includes:
- ViewComponent::Slotable
- Defined in:
- app/components/primer/timeline_item_component.rb
Overview
Use ‘TimelineItem` to display items on a vertical timeline, connected by badge elements.
Defined Under Namespace
Constant Summary
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Attribute Summary collapse
-
#system_arguments ⇒ Object
readonly
Returns the value of attribute system_arguments.
Instance Method Summary collapse
-
#initialize(condensed: false, **system_arguments) ⇒ TimelineItemComponent
constructor
A new instance of TimelineItemComponent.
- #render? ⇒ Boolean
Methods included from FetchOrFallbackHelper
Methods included from ClassNameHelper
Constructor Details
#initialize(condensed: false, **system_arguments) ⇒ TimelineItemComponent
Returns a new instance of TimelineItemComponent.
25 26 27 28 29 30 31 32 33 |
# File 'app/components/primer/timeline_item_component.rb', line 25 def initialize(condensed: false, **system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :div @system_arguments[:classes] = class_names( "TimelineItem", condensed ? "TimelineItem--condensed" : "", system_arguments[:classes] ) end |
Instance Attribute Details
#system_arguments ⇒ Object (readonly)
Returns the value of attribute system_arguments.
12 13 14 |
# File 'app/components/primer/timeline_item_component.rb', line 12 def system_arguments @system_arguments end |
Instance Method Details
#render? ⇒ Boolean
35 36 37 |
# File 'app/components/primer/timeline_item_component.rb', line 35 def render? avatar.present? || badge.present? || body.present? end |