Sha256: 63bff77f00c4402372c5679e737035fabb8908dc7e1d110801f5b6f9a3884267

Contents?: true

Size: 773 Bytes

Versions: 21

Compression:

Stored size: 773 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  class HeaderComponent < Blacklight::Component
    renders_one :top_bar, lambda { |component: Blacklight::TopNavbarComponent|
      component.new(blacklight_config: blacklight_config)
    }

    renders_one :search_bar, lambda { |component: Blacklight::SearchNavbarComponent|
      component.new(blacklight_config: blacklight_config)
    }

    def initialize(blacklight_config:)
      @blacklight_config = blacklight_config
    end

    attr_reader :blacklight_config

    # Hack so that the default lambdas are triggered
    # so that we don't have to do c.with_top_bar() in the call.
    def before_render
      set_slot(:top_bar, nil) unless top_bar
      set_slot(:search_bar, nil) unless search_bar
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
blacklight-8.6.1 app/components/blacklight/header_component.rb
blacklight-8.6.0 app/components/blacklight/header_component.rb
blacklight-8.5.1 app/components/blacklight/header_component.rb
blacklight-8.5.0 app/components/blacklight/header_component.rb
blacklight-8.4.0 app/components/blacklight/header_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/app/components/blacklight/header_component.rb
blacklight-8.3.0 app/components/blacklight/header_component.rb
blacklight-8.2.2 app/components/blacklight/header_component.rb
blacklight-8.2.1 app/components/blacklight/header_component.rb
blacklight-8.2.0 app/components/blacklight/header_component.rb
blacklight-8.1.0 app/components/blacklight/header_component.rb
blacklight-8.0.1 app/components/blacklight/header_component.rb
blacklight-8.0.0 app/components/blacklight/header_component.rb
blacklight-8.0.0.beta8 app/components/blacklight/header_component.rb
blacklight-8.0.0.beta7 app/components/blacklight/header_component.rb
blacklight-8.0.0.beta6 app/components/blacklight/header_component.rb
blacklight-8.0.0.beta5 app/components/blacklight/header_component.rb
blacklight-8.0.0.beta4 app/components/blacklight/header_component.rb
blacklight-8.0.0.beta3 app/components/blacklight/header_component.rb
blacklight-8.0.0.beta2 app/components/blacklight/header_component.rb