diff --git a/admin/app/components/solidus_admin/base_component.rb b/admin/app/components/solidus_admin/base_component.rb index 67327a9ed39..e54f3c3a8b0 100644 --- a/admin/app/components/solidus_admin/base_component.rb +++ b/admin/app/components/solidus_admin/base_component.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "solidus_admin/system/import" + module SolidusAdmin # BaseComponent is the base class for all components in Solidus Admin. class BaseComponent < ViewComponent::Base diff --git a/admin/app/components/solidus_admin/main_nav_component.rb b/admin/app/components/solidus_admin/main_nav_component.rb index 6ec34a869c2..c8e43362d4f 100644 --- a/admin/app/components/solidus_admin/main_nav_component.rb +++ b/admin/app/components/solidus_admin/main_nav_component.rb @@ -3,16 +3,15 @@ module SolidusAdmin # Renders the main navigation of Solidus Admin. class MainNavComponent < BaseComponent - def initialize(main_nav_item_component: component("main_nav_item"), items: container.within_namespace("main_nav")) - @main_nav_item_component = main_nav_item_component - @items = items - super - end + include Import[ + "main_nav_item_component", + items: "main_nav_items" + ] erb_template <<~ERB