Class: Keystone::Ui::NavbarComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Keystone::Ui::NavbarComponent
- Defined in:
- app/components/keystone/ui/navbar_component.rb
Constant Summary collapse
- NAV_BASE =
"top-nav"- NAV_STICKY =
"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%]"- DESKTOP_LINKS_CLASSES =
"nav-container hidden lg:flex"- MOBILE_RIGHT_CLASSES =
"nav-user-controls ml-auto"
Instance Method Summary collapse
-
#initialize(sticky: true) ⇒ NavbarComponent
constructor
A new instance of NavbarComponent.
- #nav_classes ⇒ Object
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
#nav_classes ⇒ Object
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 |