Class: Jav::SidebarComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/jav/sidebar_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(sidebar_open: nil, for_mobile: false) ⇒ SidebarComponent

Returns a new instance of SidebarComponent.



4
5
6
7
8
# File 'app/components/jav/sidebar_component.rb', line 4

def initialize(sidebar_open: nil, for_mobile: false)
  super
  @sidebar_open = sidebar_open
  @for_mobile = for_mobile
end

Instance Method Details

#dashboardsObject



10
11
12
# File 'app/components/jav/sidebar_component.rb', line 10

def dashboards
  Jav::App.dashboards_for_navigation
end

#resourcesObject



14
15
16
# File 'app/components/jav/sidebar_component.rb', line 14

def resources
  Jav::App.resources_for_navigation
end

#stimulus_targetObject



22
23
24
# File 'app/components/jav/sidebar_component.rb', line 22

def stimulus_target
  @for_mobile ? "mobileSidebar" : "sidebar"
end

#toolsObject



18
19
20
# File 'app/components/jav/sidebar_component.rb', line 18

def tools
  Jav::App.tools_for_navigation
end