Sha256: c8f740e9b9e5558b954a4e98c55f88b133ce97f4ffcdf4862c838ef19ee15c0f

Contents?: true

Size: 360 Bytes

Versions: 10

Compression:

Stored size: 360 Bytes

Contents

# frozen_string_literal: true

class Avo::CoverPhotoComponent < Avo::BaseComponent
  prop :cover_photo
  prop :size do |value|
    @cover_photo&.size
  end

  # aspect-cover-sm
  # aspect-cover-md
  # aspect-cover-lg
  def size_class
    "aspect-cover-#{@size}"
  end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
avo-3.15.1 app/components/avo/cover_photo_component.rb
avo-3.15.0 app/components/avo/cover_photo_component.rb
avo-3.14.5 app/components/avo/cover_photo_component.rb
avo-3.14.4 app/components/avo/cover_photo_component.rb
avo-3.14.3 app/components/avo/cover_photo_component.rb
avo-3.14.2 app/components/avo/cover_photo_component.rb
avo-3.14.1 app/components/avo/cover_photo_component.rb
avo-3.14.0 app/components/avo/cover_photo_component.rb
avo-3.13.7 app/components/avo/cover_photo_component.rb
avo-3.13.6 app/components/avo/cover_photo_component.rb