Class: Keystone::Ui::NavbarComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/keystone/ui/navbar_component.rb

Constant Summary collapse

"top-nav"
"sticky top-0 z-40"
MOBILE_LEFT_CLASSES =
"lg:hidden flex items-center"
LOGO_CLASSES =
"logo"
MOBILE_CENTER_CLASSES =
"absolute left-1/2 -translate-x-1/2 font-semibold text-gray-900 dark:text-white lg:hidden truncate max-w-[60%]"
"nav-container hidden lg:flex"
MOBILE_RIGHT_CLASSES =
"nav-user-controls ml-auto"

Instance Method Summary collapse

Constructor Details

#initialize(sticky: true) ⇒ NavbarComponent

Returns a new instance of NavbarComponent.



21
22
23
# File 'app/components/keystone/ui/navbar_component.rb', line 21

def initialize(sticky: true)
  @sticky = sticky
end

Instance Method Details



25
26
27
28
29
# File 'app/components/keystone/ui/navbar_component.rb', line 25

def nav_classes
  classes = [ NAV_BASE ]
  classes << NAV_STICKY if @sticky
  classes.join(" ")
end