Class: Primer::TimelineItemComponent
- 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
Classes: BadgeComponent
Constant Summary
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
Primer::TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(condensed: false, **system_arguments) ⇒ TimelineItemComponent
constructor
A new instance of TimelineItemComponent.
- #render? ⇒ Boolean
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Constructor Details
#initialize(condensed: false, **system_arguments) ⇒ TimelineItemComponent
Returns a new instance of TimelineItemComponent.
51 52 53 54 55 56 57 58 59 |
# File 'app/components/primer/timeline_item_component.rb', line 51 def initialize(condensed: false, **system_arguments) @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:tag] = :div @system_arguments[:classes] = class_names( "TimelineItem", condensed ? "TimelineItem--condensed" : "", system_arguments[:classes] ) end |
Instance Method Details
#render? ⇒ Boolean
61 62 63 |
# File 'app/components/primer/timeline_item_component.rb', line 61 def render? avatar.present? || badge.present? || body.present? end |