Class: PhlexKit::BubbleReactions

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/bubble/bubble_reactions.rb

Constant Summary collapse

SIDES =
%i[top bottom].to_h { |v| [ v, v ] }.freeze
ALIGNS =
%i[start end].to_h { |v| [ v, v ] }.freeze

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(side: :bottom, align: :end, **attrs) ⇒ BubbleReactions

Returns a new instance of BubbleReactions.



5
6
7
8
9
# File 'app/components/phlex_kit/bubble/bubble_reactions.rb', line 5

def initialize(side: :bottom, align: :end, **attrs)
  @side = fetch_option(SIDES, side.to_sym, :side)
  @align = fetch_option(ALIGNS, align.to_sym, :align)
  @attrs = attrs
end

Instance Method Details

#view_templateObject



10
11
12
# File 'app/components/phlex_kit/bubble/bubble_reactions.rb', line 10

def view_template(&)
  div(**mix({ class: "pk-bubble-reactions", data: { slot: "bubble-reactions", side: @side, align: @align } }, @attrs), &)
end