Sha256: 80de8fffd9818760dfa38153ac4e74a8822aa907395a82825a2bb9d8fb95a9c8

Contents?: true

Size: 411 Bytes

Versions: 32

Compression:

Stored size: 411 Bytes

Contents

# frozen_string_literal: true

module PandaCms
  class MenuComponent < ViewComponent::Base
    attr_accessor :menu_item
    attr_accessor :children

    def initialize(name:, item_styles: "")
      @menu = PandaCms::Menu.find_by(name: name)
      @menu_items = @menu.menu_items.order(:lft) if @menu.present?
      @item_styles = item_styles
    end

    def render?
      @menu_items.present?
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
panda_cms-0.5.7 app/components/panda_cms/menu_component.rb
panda_cms-0.5.6 app/components/panda_cms/menu_component.rb
panda_cms-0.5.5 app/components/panda_cms/menu_component.rb
panda_cms-0.5.4 app/components/panda_cms/menu_component.rb
panda_cms-0.5.3 app/components/panda_cms/menu_component.rb
panda_cms-0.5.2 app/components/panda_cms/menu_component.rb
panda_cms-0.5.1 app/components/panda_cms/menu_component.rb
panda_cms-0.5.0 app/components/panda_cms/menu_component.rb
panda_cms-0.3.15 app/components/panda_cms/menu_component.rb
panda_cms-0.3.14 app/components/panda_cms/menu_component.rb
panda_cms-0.3.13 app/components/panda_cms/menu_component.rb
panda_cms-0.3.12 app/components/panda_cms/menu_component.rb
panda_cms-0.3.11 app/components/panda_cms/menu_component.rb
panda_cms-0.3.10 app/components/panda_cms/menu_component.rb
panda_cms-0.3.9 app/components/panda_cms/menu_component.rb
panda_cms-0.3.8 app/components/panda_cms/menu_component.rb
panda_cms-0.3.7 app/components/panda_cms/menu_component.rb
panda_cms-0.3.6 app/components/panda_cms/menu_component.rb
panda_cms-0.3.5 app/components/panda_cms/menu_component.rb
panda_cms-0.3.4 app/components/panda_cms/menu_component.rb