Class: Blacklight::Icons::IconComponent

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

Overview

This is the list icon for the search button. You can override the default svg by setting:

Blacklight::Icons::ListComponent.svg = '<svg>your SVG here</svg>'

Instance Method Summary collapse

Constructor Details

#initialize(svg: nil) ⇒ IconComponent

Returns a new instance of IconComponent.



9
10
11
# File 'app/components/blacklight/icons/icon_component.rb', line 9

def initialize(svg: nil)
  self.svg = svg if svg
end

Instance Method Details

#callObject



13
14
15
# File 'app/components/blacklight/icons/icon_component.rb', line 13

def call
  svg&.html_safe # rubocop:disable Rails/OutputSafety
end