Class: Avo::ModalComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Avo::ModalComponent
- Defined in:
- app/components/avo/modal_component.rb
Instance Attribute Summary collapse
-
#body_class ⇒ Object
readonly
Returns the value of attribute body_class.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #height_classes ⇒ Object
-
#initialize(width: :md, body_class: nil) ⇒ ModalComponent
constructor
A new instance of ModalComponent.
- #width_classes ⇒ Object
Constructor Details
#initialize(width: :md, body_class: nil) ⇒ ModalComponent
Returns a new instance of ModalComponent.
10 11 12 13 |
# File 'app/components/avo/modal_component.rb', line 10 def initialize(width: :md, body_class: nil) @width = width @body_class = body_class end |
Instance Attribute Details
#body_class ⇒ Object (readonly)
Returns the value of attribute body_class.
8 9 10 |
# File 'app/components/avo/modal_component.rb', line 8 def body_class @body_class end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
7 8 9 |
# File 'app/components/avo/modal_component.rb', line 7 def width @width end |
Instance Method Details
#height_classes ⇒ Object
24 25 26 |
# File 'app/components/avo/modal_component.rb', line 24 def height_classes "max-h-full min-h-1/4 max-h-11/12" end |
#width_classes ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/components/avo/modal_component.rb', line 15 def width_classes case width.to_sym when :md "w-11/12 lg:w-1/2 sm:max-w-168" when :xl "w-11/12 lg:w-3/4" end end |