Sha256: 71ba1372d44cec4ec720252b99a5e154440ab2af55fa2515e32e1c1831fd0b04
Contents?: true
Size: 768 Bytes
Versions: 10
Compression:
Stored size: 768 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.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
10 entries across 10 versions & 2 rubygems