feat: Redesign navigation for scalability - replace dropdown with search
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s
This commit is contained in:
parent
9f57f4f3c2
commit
1dab125396
3 changed files with 28 additions and 11 deletions
|
|
@ -3,7 +3,7 @@ from fastapi import APIRouter, Depends, HTTPException, Query
|
|||
from sqlmodel import Session, select, col
|
||||
from sqlalchemy.orm import selectinload
|
||||
from database import get_session
|
||||
from models import Show, Song, Venue, Tour, Group, Performance, PerformanceNickname, Comment, Review
|
||||
from models import Show, Song, Venue, Tour, Group, Performance, PerformanceNickname, Comment, Review, Vertical
|
||||
|
||||
router = APIRouter(prefix="/search", tags=["search"])
|
||||
|
||||
|
|
@ -45,6 +45,13 @@ def global_search(
|
|||
.where(col(Group.name).ilike(q_str))
|
||||
.limit(limit)
|
||||
).all()
|
||||
|
||||
# Search Verticals (Bands)
|
||||
verticals = session.exec(
|
||||
select(Vertical)
|
||||
.where(col(Vertical.name).ilike(q_str))
|
||||
.limit(limit)
|
||||
).all()
|
||||
|
||||
# Search Nicknames
|
||||
nicknames_raw = session.exec(
|
||||
|
|
@ -115,6 +122,7 @@ def global_search(
|
|||
"venues": venues,
|
||||
"tours": tours,
|
||||
"groups": groups,
|
||||
"verticals": verticals,
|
||||
"nicknames": nicknames,
|
||||
"performances": performances,
|
||||
"reviews": reviews,
|
||||
|
|
|
|||
|
|
@ -6,14 +6,6 @@ import { Button } from "@/components/ui/button"
|
|||
import { SearchDialog } from "@/components/ui/search-dialog"
|
||||
import { NotificationBell } from "@/components/notifications/notification-bell"
|
||||
import { ThemeToggle } from "@/components/theme-toggle"
|
||||
import { BandSelector } from "@/components/layout/band-selector"
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu"
|
||||
import { useAuth } from "@/contexts/auth-context"
|
||||
import { useVertical } from "@/contexts/vertical-context"
|
||||
|
||||
|
|
@ -38,8 +30,10 @@ export function Navbar() {
|
|||
return (
|
||||
<header className="sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
||||
<div className="container mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 flex h-14 items-center justify-between">
|
||||
{/* Band Selector - replaces logo */}
|
||||
<BandSelector />
|
||||
{/* Brand Logo - Home Link */}
|
||||
<Link href="/" className="flex items-center gap-2 font-bold text-xl hover:opacity-80 transition-opacity">
|
||||
<span>Fediversion</span>
|
||||
</Link>
|
||||
|
||||
{/* Desktop Navigation */}
|
||||
<nav className="hidden md:flex items-center space-x-6 text-sm font-medium">
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ export function SearchDialog() {
|
|||
venues: [],
|
||||
tours: [],
|
||||
groups: [],
|
||||
verticals: [],
|
||||
users: [],
|
||||
nicknames: [],
|
||||
performances: [],
|
||||
|
|
@ -124,6 +125,20 @@ export function SearchDialog() {
|
|||
</CommandGroup>
|
||||
)}
|
||||
|
||||
{results.songs?.length > 0 && (
|
||||
{
|
||||
results.verticals?.length > 0 && (
|
||||
<CommandGroup heading="Bands">
|
||||
{results.verticals.map((vertical: any) => (
|
||||
<CommandItem key={vertical.slug} onSelect={() => handleSelect(`/${vertical.slug}`)}>
|
||||
<Music className="mr-2 h-4 w-4" />
|
||||
<span>{vertical.name}</span>
|
||||
</CommandItem>
|
||||
))}
|
||||
</CommandGroup>
|
||||
)
|
||||
}
|
||||
|
||||
{results.songs?.length > 0 && (
|
||||
<CommandGroup heading="Songs">
|
||||
{results.songs.map((song: any) => (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue