Navbar Component
Relevant source files
The following files were used as context for generating this wiki page:
The Navbar Component serves as the primary navigation system for the GeNCorE Command Center web application. It is designed as a persistent, mobile-first navigation bar that facilitates quick switching between the application's core functional areas: the Dashboard, the Task Panel, and the Pull Request Review section.
Within the project's architecture, the Navbar is implemented as a client-side React component that utilizes Next.js navigation hooks to provide visual feedback regarding the current active route. It is positioned at the bottom of the viewport to optimize for one-handed mobile usage, particularly on devices like iPhones.
Sources: components/Navbar.tsx:1-35, README.md
Architecture and Layout
The Navbar is built using Tailwind CSS and is fixed to the bottom of the screen. It employs a flexible box layout (flexbox) to distribute navigation items evenly across the width of the device.
Visual Configuration
The component uses a dark theme consistent with the rest of the application, featuring a bg-gray-800 background and a gray-700 top border to separate it from the main content. It also incorporates a specialized CSS class, safe-area-pb, to ensure content is not obscured by hardware features such as the iPhone notch or home indicator.
Sources: components/Navbar.tsx:16-18, app/globals.css:14-16
Component Structure
The following diagram illustrates the structural hierarchy of the Navbar within the application layout:
The Navbar is included at the end of the main container in each top-level page component rather than being placed once in the root layout, allowing pages to control its visibility if necessary.
Sources: app/page.tsx:163, app/review/page.tsx:210, app/task/page.tsx:128
Data Model and Navigation Logic
The Navbar's items are defined in a central array of objects, which allows for easy modification of the navigation structure.
Navigation Item Schema
Each item in the navigation bar consists of a destination URL, a display label, and an emoji icon.
| Field | Type | Description |
|---|---|---|
href | string | The internal path within the Next.js App Router. |
label | string | The text displayed below the icon (e.g., "Dashboard", "Zlecenia"). |
icon | string | An emoji used as a visual representation of the section. |
Sources: components/Navbar.tsx:6-10
Active State Detection
The component utilizes the usePathname hook from next/navigation to determine the current URL. By comparing the pathname to the href of each navigation item, the component dynamically applies active styling.
Sources: components/Navbar.tsx:13-25
Styling and Interactions
The Navbar utilizes specific Tailwind utility classes to handle responsiveness and interactive states:
- Active State: When a route matches the
href, the text and icon turntext-purple-400. - Hover/Active States: Inactive items transition to
text-gray-200on hover andtext-whitewhen clicked (active). - Transitions: A
transition-colorsclass is applied to ensure smooth visual changes between states. - Safe Area Handling: The
safe-area-pbclass appliespadding-bottom: env(safe-area-inset-bottom)to prevent the bar from overlapping with system-level UI elements on mobile devices.
Sources: components/Navbar.tsx:21-30, app/globals.css:14-16
Implementation Example
The core rendering logic maps through the navItems array to generate Next.js Link components:
// components/Navbar.tsx:19-33
<div className="flex justify-around items-center h-16">
{navItems.map((item) => {
const isActive = pathname === item.href
return (
<Link
key={item.href}
href={item.href}
className={`flex flex-col items-center gap-1 px-4 py-2 rounded-lg transition-colors ${
isActive
? 'text-purple-400'
: 'text-gray-400 hover:text-gray-200 active:text-white'
}`}
>
<span className="text-xl">{item.icon}</span>
<span className="text-xs font-medium">{item.label}</span>
</Link>
)
})}
</div>
Sources: components/Navbar.tsx:19-33
Summary
The Navbar Component is a critical navigation element in the GeNCorE Command Center, providing a consistent and accessible interface for managing AI agents and pull requests. Its implementation leverages standard Next.js patterns and Tailwind CSS to deliver a responsive, theme-aware navigation experience optimized for mobile environments.