app/components/solidus_admin/ui/panel/component.rb in solidus_admin-0.2.0 vs app/components/solidus_admin/ui/panel/component.rb in solidus_admin-0.3.0

- old
+ new

@@ -8,17 +8,12 @@ **args, class: 'flex gap-1 hover:underline' ) } - renders_many :sections, ->(wide: false, high: false, **args, &block) do - tag.section(**args, class: " - border-gray-100 border-t w-full first-of-type:border-t-0 - #{'px-6' unless wide} - #{'py-6' unless high} - #{args[:class]} - ", &block) + renders_many :sections, ->(**args, &block) do + render_section(**args, &block) end renders_many :menus, ->(name, url, **args) do if args[:method] button_to(name, url, **args) @@ -30,7 +25,16 @@ # @param title [String] the title of the panel # @param title_hint [String] the title hint of the panel def initialize(title: nil, title_hint: nil) @title = title @title_hint = title_hint + end + + def render_section(wide: false, high: false, **args, &block) + tag.section(**args, class: " + border-gray-100 border-t w-full first-of-type:border-t-0 + #{'px-6' unless wide} + #{'py-4' unless high} + #{args[:class]} + ", &block) end end