Skip to content

Commit

Permalink
fix: Restore search functionality in Navbar component (code100x#1466)
Browse files Browse the repository at this point in the history
  • Loading branch information
gupta-soham authored Oct 17, 2024
1 parent 6a49a64 commit 75ff1a9
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useSession } from 'next-auth/react';
import { usePathname, useRouter } from 'next/navigation';
import React, { useState, useCallback, useMemo } from 'react';
import Link from 'next/link';
import { ArrowLeft, Menu, X } from 'lucide-react';
import { ArrowLeft, Menu, Search, X } from 'lucide-react';
import { Button } from './ui/button';
import { AppbarAuth } from './AppbarAuth';
import ThemeToggler from './ThemeToggler';
Expand Down Expand Up @@ -94,6 +94,25 @@ export const Navbar = () => {
variants={navItemVariants}
custom={1}
>
{/* Search Bar */}
{session?.user && (
<>
<div className="hidden md:block">
<SearchBar />
</div>
<div className="md:hidden">
<Button
onClick={toggleSearch}
variant={'ghost'}
size={'icon'}
className="mr-2"
>
<Search className="size-6" />
</Button>
</div>
</>
)}

<ThemeToggler />
{session?.user && <ProfileDropdown />}

Expand Down

0 comments on commit 75ff1a9

Please sign in to comment.