Class: Spina::MainNavigation::LinkComponent

Inherits:
ApplicationComponent show all
Defined in:
app/components/spina/main_navigation/link_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(label, path, active: false) ⇒ LinkComponent

Returns a new instance of LinkComponent.



4
5
6
7
8
# File 'app/components/spina/main_navigation/link_component.rb', line 4

def initialize(label, path, active: false)
  @label = label
  @path = path
  @active = active
end

Instance Method Details

#css_classesObject



10
11
12
13
14
15
16
# File 'app/components/spina/main_navigation/link_component.rb', line 10

def css_classes
  if @active
    ""
  else
    "opacity-50"
  end
end