app/views/components/block/block_component.rb in plutonium-0.8.0 vs app/views/components/block/block_component.rb in plutonium-0.11.0

- old
+ new

@@ -1,18 +1,22 @@ -module Plutonium::Ui - class BlockComponent < Plutonium::Ui::Base +module PlutoniumUi + class BlockComponent < PlutoniumUi::Base option :rounded, optional: true option :scroll, optional: true private - def classname - classnames = ["relative bg-white dark:bg-gray-800 shadow-md", rounded_classes, scroll_classes] - classnames << super.presence - classnames.compact.join " " + def base_attributes + { + classname: classnames + } end + def classnames + ["relative bg-white dark:bg-gray-800 shadow-md", rounded_classes, scroll_classes] + end + def scroll_classes case scroll when :x "overflow-x-auto" when :y @@ -35,6 +39,6 @@ end end end end -Plutonium::ComponentRegistry.register :block, to: Plutonium::Ui::BlockComponent +Plutonium::ComponentRegistry.register :block, to: PlutoniumUi::BlockComponent