Class: Avo::CoverComponent

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

Instance Method Summary collapse

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


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

def render?
  @cover.present? && @cover.visible_in_current_view?
end

#size_classObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/components/avo/cover_component.rb', line 9

def size_class
  case @size
  when :sm
    "max-h-60"
  when :md
    "max-h-100"
  when :lg
    "max-h-140"
  when :full
    "max-h-none"
  end
end