Class: Blacklight::SearchButtonComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/blacklight/search_button_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(text:, id:) ⇒ SearchButtonComponent

Returns a new instance of SearchButtonComponent.



5
6
7
8
# File 'app/components/blacklight/search_button_component.rb', line 5

def initialize(text:, id:)
  @text = text
  @id = id
end

Instance Method Details

#callObject



10
11
12
13
14
15
# File 'app/components/blacklight/search_button_component.rb', line 10

def call
  tag.button(class: 'btn btn-primary search-btn', type: 'submit', id: @id) do
    tag.span(@text, class: "submit-search-text") +
      blacklight_icon(:search, aria_hidden: true)
  end
end