-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
493773a
commit 51342ee
Showing
11 changed files
with
170 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { | ||
NavigationMenuContent, | ||
NavigationMenuItem, | ||
NavigationMenuTrigger, | ||
} from "@/components/ui/NavigationMenu"; | ||
import { cn } from "@/lib/utils"; | ||
import type { NavItem } from "@/types"; | ||
import { SubLinks } from "./SubLinks"; | ||
|
||
export const MainNavSubLinks: React.FC<{ | ||
navItem: NavItem; | ||
titleClass: string; | ||
}> = ({ navItem, titleClass }) => ( | ||
<NavigationMenuItem> | ||
<NavigationMenuTrigger className={cn(titleClass, "-mx-4")}> | ||
{navItem.title} | ||
</NavigationMenuTrigger> | ||
<NavigationMenuContent> | ||
<SubLinks navItem={navItem} /> | ||
</NavigationMenuContent> | ||
</NavigationMenuItem> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { cn } from "@/lib/utils"; | ||
import type { NavItem } from "@/types"; | ||
|
||
export const SubLinks: React.FC<{ | ||
navItem: NavItem; | ||
}> = ({ navItem }) => ( | ||
<ul className="grid gap-3 p-4 grid-cols-1 lg:w-[300px] "> | ||
{navItem.subLinks?.map((subLink) => ( | ||
<li key={subLink.href}> | ||
<a | ||
href={subLink.href} | ||
className={cn( | ||
"hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors", | ||
)} | ||
> | ||
<div className="flex flex-col text-sm font-medium leading-none gap-2"> | ||
<span>{subLink.title}</span> | ||
<p className="text-muted-foreground line-clamp-2 text-sm leading-snug"> | ||
{subLink.description} | ||
</p> | ||
</div> | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { cn, extractSegmentURL } from "@/lib/utils"; | ||
import type { MainNavItem } from "@/types"; | ||
import { MainNavSubLinks } from "../MainNavSubLinks"; | ||
import { NavigationMenu, NavigationMenuList } from "../ui/NavigationMenu"; | ||
|
||
type Props = { | ||
items: MainNavItem[]; | ||
pathname: string; | ||
}; | ||
|
||
export const MainNav: React.FC<Props> = ({ items, pathname }) => { | ||
const segment = extractSegmentURL(pathname); | ||
|
||
return items?.length ? ( | ||
<NavigationMenu> | ||
<NavigationMenuList className="hidden gap-6 md:flex"> | ||
{items?.map((item) => { | ||
const titleClass = cn( | ||
"hover:text-foreground/80 flex items-center text-lg font-medium sm:text-sm", | ||
item.href?.startsWith(`/${segment}`) | ||
? "text-foreground" | ||
: "text-foreground/60", | ||
item.disabled && "cursor-not-allowed opacity-80", | ||
); | ||
if (item.subLinks) { | ||
return ( | ||
<MainNavSubLinks | ||
key={item.title} | ||
navItem={item} | ||
titleClass={titleClass} | ||
/> | ||
); | ||
} | ||
return ( | ||
<a | ||
key={item.href} | ||
href={item.disabled ? "#" : item.href} | ||
className={titleClass} | ||
> | ||
{item.title} | ||
</a> | ||
); | ||
})} | ||
</NavigationMenuList> | ||
</NavigationMenu> | ||
) : null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,28 @@ export const marketingConfig: MarketingConfig = { | |
title: "Changelog", | ||
href: `${siteConfig.links.github}/releases`, | ||
}, | ||
|
||
{ | ||
title: "Contact", | ||
href: "/contact", | ||
subLinks: [ | ||
{ | ||
title: "Email us", | ||
description: "[email protected]", | ||
href: `mailto:[email protected]`, | ||
}, | ||
{ | ||
title: "Open a Github issue", | ||
description: "For a bug or feature request", | ||
href: `${siteConfig.links.github}/issues/new`, | ||
}, | ||
{ | ||
title: "Get help on Discord", | ||
description: "Ask questions on Discord", | ||
href: siteConfig.links.discord, | ||
}, | ||
], | ||
}, | ||
{ | ||
title: "About", | ||
href: "/about", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
import { SubLinks } from "@/components/SubLinks"; | ||
import MainLayout from "@/layouts/MainLayout.astro"; | ||
import { marketingConfig } from "@/config/marketing"; | ||
const contact = marketingConfig.mainNav.find((n) => n.title === "Contact"); | ||
if (!contact) { | ||
throw new Error("Contact nav item not found"); | ||
} | ||
--- | ||
|
||
<MainLayout title="Contact"> | ||
<section class="h-full space-y-5"> | ||
<section | ||
class="container relative mb-28 mt-40 max-w-screen-md sm:mt-20 lg:mt-28" | ||
> | ||
<SubLinks navItem={contact} /> | ||
</section> | ||
</section> | ||
</MainLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters