-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from AfipSDK/feature/integrations
Add integrations menu
- Loading branch information
Showing
10 changed files
with
216 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,148 @@ | ||
import * as React from "react"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
import { Icons } from "@/icons"; | ||
import { | ||
NavigationMenu, | ||
NavigationMenuContent, | ||
NavigationMenuItem, | ||
NavigationMenuList, | ||
NavigationMenuTrigger, | ||
navigationMenuTriggerStyle, | ||
} from "@/components/ui/navigation-menu"; | ||
import { Badge } from "@/components/ui/badge"; | ||
import { navMenuConfig } from "@/config/nav-menu"; | ||
import type { MenuItem } from "@/types"; | ||
|
||
const links = navMenuConfig.links; | ||
const pages = navMenuConfig.pagesNav[1]; | ||
const examples = navMenuConfig.examplesNav[0]; | ||
|
||
export function MainNavigationMenu() { | ||
return ( | ||
<NavigationMenu className="ml-4"> | ||
<NavigationMenuList> | ||
{/* <NavigationMenuItem> | ||
<NavigationMenuTrigger>{pages.title}</NavigationMenuTrigger> | ||
<NavigationMenuContent> | ||
<ul className="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]"> | ||
<li className="row-span-3"> | ||
<a | ||
className="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md" | ||
href="/" | ||
> | ||
<Icons.logo className="size-8" /> | ||
<div className="mb-2 mt-3 text-lg font-medium">Astronomy</div> | ||
<p className="text-sm leading-tight text-muted-foreground"> | ||
Pages and examples apps built with Astro v4.5, | ||
shadcn/ui & react js. | ||
<br /> | ||
Open Source. | ||
</p> | ||
</a> | ||
</li> | ||
{pages.items?.map((page) => ( | ||
<ListItem key={page.title} {...page} /> | ||
))} | ||
</ul> | ||
</NavigationMenuContent> | ||
</NavigationMenuItem> */} | ||
|
||
<NavigationMenuItem> | ||
<NavigationMenuTrigger>{pages.title}</NavigationMenuTrigger> | ||
<NavigationMenuContent> | ||
<ul className="grid w-[200px] gap-3 p-4 md:w-[250px] md:grid-cols-2 lg:w-[300px] "> | ||
{pages.items?.map((page) => ( | ||
<ListItem key={page.title} {...page} /> | ||
))} | ||
</ul> | ||
</NavigationMenuContent> | ||
</NavigationMenuItem> | ||
|
||
{/* <NavigationMenuItem> | ||
<NavigationMenuTrigger>{examples.title}</NavigationMenuTrigger> | ||
<NavigationMenuContent> | ||
<ul className="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px] "> | ||
{examples.items?.map((example) => ( | ||
<ListItem key={example.title} {...example} /> | ||
))} | ||
</ul> | ||
</NavigationMenuContent> | ||
</NavigationMenuItem> */} | ||
|
||
{links ? ( | ||
<NavigationMenuItem> | ||
{links.map((link) => ( | ||
<a | ||
key={link.href} | ||
href={link.href} | ||
className={navigationMenuTriggerStyle()} | ||
{...(link.forceReload ? { "data-astro-reload": true } : {})} | ||
> | ||
{link.title} | ||
</a> | ||
))} | ||
</NavigationMenuItem> | ||
) : null} | ||
</NavigationMenuList> | ||
</NavigationMenu> | ||
); | ||
} | ||
|
||
const ListItem: React.FC<MenuItem> = ({ | ||
title, | ||
href, | ||
description, | ||
launched, | ||
disabled, | ||
external, | ||
icon, | ||
forceReload, | ||
}) => { | ||
const target = external ? "_blank" : undefined; | ||
|
||
return ( | ||
<li> | ||
<a | ||
target={target} | ||
href={disabled ? undefined : href} | ||
{...(forceReload ? { "data-astro-reload": true } : {})} | ||
className={cn( | ||
"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground", | ||
disabled | ||
? "text-muted-foreground hover:bg-transparent hover:text-muted-foreground" | ||
: "" | ||
)} | ||
> | ||
<div className="flex items-center text-sm font-medium leading-none"> | ||
{icon && <img className="max-w-[20px] mr-3 align-middle" src={icon} alt={title} />} | ||
|
||
<span className="mr-2 align-middle">{title}</span> | ||
{disabled ? ( | ||
<Badge | ||
variant="secondary" | ||
radius="sm" | ||
className="h-5 px-1.5 text-xs font-medium" | ||
> | ||
SOON | ||
</Badge> | ||
) : null} | ||
{launched ? ( | ||
<Badge | ||
radius="sm" | ||
className="h-5 px-1.5 text-xs font-medium bg-[#ebf5ff] hover:bg-[#ebf5ff] text-[#0068d6]" | ||
> | ||
NEW | ||
</Badge> | ||
) : null} | ||
</div> | ||
{description && <p className="line-clamp-2 text-sm leading-snug text-muted-foreground"> | ||
{description} | ||
</p>} | ||
</a> | ||
</li> | ||
); | ||
}; | ||
|
||
ListItem.displayName = "ListItem"; |
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