diff --git a/admin/app/components/solidus_admin/base_component.rb b/admin/app/components/solidus_admin/base_component.rb index e59ec7c1a9e..366a409d14d 100644 --- a/admin/app/components/solidus_admin/base_component.rb +++ b/admin/app/components/solidus_admin/base_component.rb @@ -6,5 +6,9 @@ class BaseComponent < ViewComponent::Base def container SolidusAdmin::Container end + + def component(name) + container.resolve("#{name}_component") + end end end diff --git a/admin/app/components/solidus_admin/main_nav_component/main_nav_component.html.erb b/admin/app/components/solidus_admin/main_nav_component/main_nav_component.html.erb index 685bd4bd8a7..3990d5136ad 100644 --- a/admin/app/components/solidus_admin/main_nav_component/main_nav_component.html.erb +++ b/admin/app/components/solidus_admin/main_nav_component/main_nav_component.html.erb @@ -1,6 +1,6 @@