Sha256: df96d25da13abc8fe0e894e8651012ebf0116265951882d318d47e154c57dc06

Contents?: true

Size: 837 Bytes

Versions: 15

Compression:

Stored size: 837 Bytes

Contents

module PlutoniumUi
  class ResourceHeaderComponent < PlutoniumUi::Base
    renders_one :brand_logo
    renders_many :actions

    option :brand_name, optional: true
    option :default_brand_logo, default: -> { true }
    option :sidebar_toggle, default: -> { false }

    private

    def base_attributes
      # base attributes go here
      {
        classname: "resource-header bg-white border-b border-gray-200 px-4 py-2.5 dark:bg-gray-800 dark:border-gray-700 fixed left-0 right-0 top-0 z-50",
        controller: "resource-header"
      }
    end

    def before_render
      return if brand_logo.present? || !default_brand_logo

      with_brand_logo do
        resource_logo_tag classname: "mr-3 h-10"
      end
    end
  end
end

Plutonium::ComponentRegistry.register :resource_header, to: PlutoniumUi::ResourceHeaderComponent

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
plutonium-0.12.13 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.12 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.11 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.10 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.9 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.8 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.7 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.5 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.4 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.3 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.2 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.1 app/views/components/resource_header/resource_header_component.rb
plutonium-0.12.0 app/views/components/resource_header/resource_header_component.rb
plutonium-0.11.2 app/views/components/resource_header/resource_header_component.rb
plutonium-0.11.1 app/views/components/resource_header/resource_header_component.rb