Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions src/app/search/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use client';

import Link from 'next/link';
import { PenLineIcon } from 'lucide-react';
import AppShell from '@/components/layout/AppShell';
import SearchView from '@/components/sidebar/SearchView';
import ContentHeader from '@/components/layout/ContentHeader';
import LoginButton from '@/components/auth/LoginButton';
import ThemeToggleButton from '@/components/theme/ThemeToggleButton';

export default function SearchPage() {
return (
<AppShell
header={
<ContentHeader
className="bg-background/80 backdrop-blur"
innerClassName="px-3 sm:px-6 py-2 min-h-12"
right={
<>
<Link
href="/draft/new"
className="inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-sm text-muted-foreground hover:text-foreground hover:bg-muted transition-colors"
>
<PenLineIcon className="w-4 h-4" />
<span>Write</span>
</Link>
<ThemeToggleButton />
<LoginButton />
</>
}
/>
}
>
<div className="min-h-0 flex-1">
<SearchView />
</div>
</AppShell>
);
}
19 changes: 18 additions & 1 deletion src/components/sidebar/AppSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react';
import Link from 'next/link';
import { usePathname, useRouter } from 'next/navigation';
import { useQuery } from '@tanstack/react-query';
import { FileEditIcon, ServerIcon, PlusIcon, HouseIcon, HighlighterIcon, LayersIcon, HashIcon, ChevronDownIcon, XIcon, UserIcon } from 'lucide-react';
import { FileEditIcon, ServerIcon, PlusIcon, HouseIcon, HighlighterIcon, LayersIcon, HashIcon, ChevronDownIcon, XIcon, UserIcon, SearchIcon } from 'lucide-react';
import { useSession } from 'next-auth/react';
import { nip19 } from 'nostr-tools';
import { toast } from 'sonner';
Expand Down Expand Up @@ -143,6 +143,7 @@ export default function AppSidebar() {
const isDraftsRoute = pathname === '/drafts';
const isHighlightsRoute = pathname === '/highlights';
const isStacksRoute = pathname === '/stacks';
const isSearchRoute = pathname === '/search';
const isRelaysRoute = pathname === '/relays';

return (
Expand All @@ -167,6 +168,22 @@ export default function AppSidebar() {
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton
tooltip="Search"
isActive={isSearchRoute}
asChild
>
<Link
href="/search"
onClick={() => setOpenMobile(false)}
className="flex items-center gap-2"
>
<SearchIcon />
<span>Search</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
{userPubkey && (
<>
<SidebarMenuItem>
Expand Down
Loading