Class: Railsboot::AvatarGroupComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/railsboot/avatar_group_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(reverse: false, **html_attributes) ⇒ AvatarGroupComponent

Returns a new instance of AvatarGroupComponent.



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/components/railsboot/avatar_group_component.rb', line 4

def initialize(reverse: false, **html_attributes)
  @reverse = reverse
  @html_attributes = html_attributes

  @html_attributes[:class] = class_names(
    "d-flex",
    html_attributes.delete(:class)
  )

  if @reverse
    @html_attributes[:style] = [html_attributes[:style], "flex-direction: row-reverse; justify-content: flex-end;"].compact_blank.join(" ")
  end
end