Class: Avo::SidebarComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/avo/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
# File 'app/components/avo/sidebar_component.rb', line 4

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

Instance Method Details

#dashboardsObject



9
10
11
# File 'app/components/avo/sidebar_component.rb', line 9

def dashboards
  Avo::App.dashboards_for_navigation
end

#resourcesObject



13
14
15
# File 'app/components/avo/sidebar_component.rb', line 13

def resources
  Avo::App.resources_for_navigation
end

#stimulus_targetObject



21
22
23
# File 'app/components/avo/sidebar_component.rb', line 21

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

#toolsObject



17
18
19
# File 'app/components/avo/sidebar_component.rb', line 17

def tools
  Avo::App.tools_for_navigation
end