Skip to content

Commit

Permalink
Merge pull request #160 from AE-Hertz/branch1
Browse files Browse the repository at this point in the history
fix: header and git issue
  • Loading branch information
Aarzookhunger authored Nov 2, 2024
2 parents 40546a5 + 47f5a47 commit ae25f06
Showing 1 changed file with 51 additions and 74 deletions.
125 changes: 51 additions & 74 deletions components/page-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,9 @@ const PageHeader = ({ prefLangCookie }: { prefLangCookie: string }) => {

const isActive = (href: string) =>
activePath === href
<<<<<<< HEAD
? "font-bold text-black dark:text-white"
: "text-muted-foreground dark:text-gray-400";

=======
? "text-black font-bold"
: "text-muted-foreground dark:text-gray-200";
>>>>>>> 383e7974f0a0fff21996aa91b2c8c87f53f89daa

return (
<header className="sticky inset-x-0 top-2 z-30 w-full transition-all bg-white/20 dark:bg-black backdrop-blur-md">
Expand All @@ -71,7 +66,6 @@ const PageHeader = ({ prefLangCookie }: { prefLangCookie: string }) => {
</div>
</Link>

<<<<<<< HEAD
<Link href="/dashboard">
<div
className={`ml-2 text-lg font-light hover:underline ${isActive(
Expand Down Expand Up @@ -125,27 +119,6 @@ const PageHeader = ({ prefLangCookie }: { prefLangCookie: string }) => {
FAQ
</div>
</Link>
=======
{[
"/dashboard",
"/popular",
"/blog",
"/about",
"/contributor",
"/faq",
"/testimonial"
].map((href) => (
<Link href={href} key={href}>
<div
className={`ml-2 text-lg font-light ${theme === 'light' ? 'text-black' : 'text-white'} hover:underline ${isActive(
href
)}`}
>
{href.slice(1).charAt(0).toUpperCase() + href.slice(2)}
</div>
</Link>
))}
>>>>>>> 383e7974f0a0fff21996aa91b2c8c87f53f89daa
</div>

<div className="flex items-center gap-2">
Expand Down Expand Up @@ -187,55 +160,59 @@ const PageHeader = ({ prefLangCookie }: { prefLangCookie: string }) => {
</div>

{/* Mobile Navbar */}
<div className="lg:hidden flex h-16 items-center justify-between border-b px-2">
<Link href="/" className="flex items-center">
<div className="lg:hidden flex h-16 items-center justify-between border-b px-4 bg-white dark:bg-neutral-950 dark:border-neutral-800">
<Link href="/" className="flex items-center">
<Image src="/git3.png" alt="Logo" width={38} height={38} />
</Link>

<div className="flex items-center gap-5">
<DropdownMenu>
<DropdownMenuTrigger>
<MenuIcon />
</DropdownMenuTrigger>
<DropdownMenuContent className="mr-3 mt-2">
<DropdownMenuItem>
<div className="flex flex-col gap-4 justify-start">
{["/dashboard", "/auth/signup", "/faq"].map((href) => (
<Link href={href} key={href}>
<div
className={`text-base hover:underline ${isActive(
href
)}`}
>
{href.slice(1).charAt(0).toUpperCase() +
href.slice(2)}
</div>
</Link>
))}
{session ? <LogoutButton /> : <LoginButton />}
</div>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<Badge
className="gap-1 bg-neutral-950 text-white hover:bg-neutral-800"
variant="outline"
onClick={handleGitHubClick}
style={{ cursor: "pointer" }}
>
<GitHubLogoIcon />
Star
</Badge>
<Badge
className="gap-1 rounded-xl bg-neutral-950 text-white hover:bg-neutral-800"
onClick={handleTweetClick}
style={{ cursor: "pointer" }}
>
<Image src="/twitter-x.svg" width={12} height={12} alt="Tweet" />
Post
</Badge>
</div>
</Link>

<div className="flex items-center gap-3">
<DropdownMenu>
<DropdownMenuTrigger aria-label="Open Menu">
<MenuIcon />
</DropdownMenuTrigger>
<DropdownMenuContent className="mr-2 mt-3 rounded-lg shadow-lg dark:bg-neutral-900">
<DropdownMenuItem>
<div className="flex flex-col gap-3 text-center">
{["/dashboard", "/auth/signup", "/faq"].map((href) => (
<Link href={href} key={href} className="block">
<span
className={`text-base font-medium hover:underline ${isActive(
href
)}`}
>
{href.slice(1).charAt(0).toUpperCase() + href.slice(2)}
</span>
</Link>
))}
{session ? <LogoutButton /> : <LoginButton />}
</div>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>

<Badge
className="flex items-center gap-1 bg-neutral-950 text-white hover:bg-neutral-800 p-2 rounded-md transition-colors duration-150"
variant="outline"
onClick={handleGitHubClick}
style={{ cursor: "pointer" }}
aria-label="Star on GitHub"
>
<GitHubLogoIcon />
Star
</Badge>

<Badge
className="flex items-center gap-1 bg-neutral-950 text-white hover:bg-neutral-800 p-2 rounded-md transition-colors duration-150"
onClick={handleTweetClick}
style={{ cursor: "pointer" }}
aria-label="Share on Twitter"
>
<Image src="/twitter-x.svg" width={12} height={12} alt="Tweet Icon" />
Post
</Badge>
</div>
</div>

</div>
</header>
);
Expand Down

0 comments on commit ae25f06

Please sign in to comment.