Class: Avo::ModalComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/avo/modal_component.rb

Instance Method Summary collapse

Instance Method Details

#ctrlObject



30
# File 'app/components/avo/modal_component.rb', line 30

def ctrl = stimulus_controller

#has_header?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'app/components/avo/modal_component.rb', line 26

def has_header?
  @title.present? || @description.present? || heading? || @show_close_button
end

#height_classesObject



22
23
24
# File 'app/components/avo/modal_component.rb', line 22

def height_classes
  "max-h-[calc(100dvh-5rem)] min-h-1/4"
end

#stimulus_controllerObject



18
19
20
# File 'app/components/avo/modal_component.rb', line 18

def stimulus_controller
  (@behavior == :persistent) ? "persistent-modal" : "modal"
end