Class: Tramway::NavbarComponent
- Inherits:
-
TailwindComponent
- Object
- ViewComponent::Base
- BaseComponent
- TailwindComponent
- Tramway::NavbarComponent
- Defined in:
- app/components/tramway/navbar_component.rb
Overview
Navbar component
Constant Summary collapse
- NAVBAR_CLASSES =
%w[ flex items-center justify-between border-zinc-800 px-4 py-3 shadow-sm backdrop-blur sm:px-6 ].freeze
- MOBILE_BUTTON_CLASSES =
%w[ inline-flex items-center justify-center rounded-md p-2 transition-colors hover:bg-zinc-800 hover:text-zinc-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950 ].freeze
- MOBILE_MENU_CLASSES =
%w[ fixed inset-0 z-50 hidden h-screen w-screen flex-col border-r border-zinc-800 bg-zinc-950 px-4 py-6 shadow-lg transition-transform transform -translate-x-full duration-300 ease-in-out pt-16 ].freeze
Constants inherited from TailwindComponent
TailwindComponent::SIZE_CLASSES
Constants included from Helpers::ViewsHelper
Helpers::ViewsHelper::FORM_SIZES
Instance Method Summary collapse
-
#initialize(**options) ⇒ NavbarComponent
constructor
A new instance of NavbarComponent.
- #mobile_button_classes ⇒ Object
- #mobile_menu_classes ⇒ Object
- #navbar_classes ⇒ Object
- #title_classes ⇒ Object
Methods included from Helpers::ViewsHelper
#tramway_back_button, #tramway_badge, #tramway_button, #tramway_cell, #tramway_chat, #tramway_container, #tramway_flash, #tramway_form_for, #tramway_header, #tramway_main_container, #tramway_row, #tramway_table, #tramway_title
Methods included from Helpers::ComponentHelper
Methods included from Helpers::DecorateHelper
Constructor Details
#initialize(**options) ⇒ NavbarComponent
Returns a new instance of NavbarComponent.
21 22 23 24 25 |
# File 'app/components/tramway/navbar_component.rb', line 21 def initialize(**) @title = { text: [:title], link: [:title_link] || '/' } @left_items = [:left_items] @right_items = [:right_items] end |
Instance Method Details
#mobile_button_classes ⇒ Object
35 36 37 |
# File 'app/components/tramway/navbar_component.rb', line 35 def MOBILE_BUTTON_CLASSES.join(' ') end |
#mobile_menu_classes ⇒ Object
39 40 41 |
# File 'app/components/tramway/navbar_component.rb', line 39 def MOBILE_MENU_CLASSES.join(' ') end |
#navbar_classes ⇒ Object
27 28 29 |
# File 'app/components/tramway/navbar_component.rb', line 27 def NAVBAR_CLASSES.join(' ') end |
#title_classes ⇒ Object
31 32 33 |
# File 'app/components/tramway/navbar_component.rb', line 31 def title_classes 'text-base font-semibold text-zinc-50' end |