-
Notifications
You must be signed in to change notification settings - Fork 0
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 #16 from FiligranHQ/issue/refactor-ui
[filigran-website] redefine website layout
- Loading branch information
Showing
11 changed files
with
108 additions
and
72 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
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
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,82 @@ | ||
'use client' | ||
import {FunctionComponent} from 'react' | ||
import {ContentMenu} from '@/utils/mdx.util' | ||
import {cn} from '@/utils/utils' | ||
import { | ||
Accordion, | ||
AccordionContent, | ||
AccordionItem, | ||
AccordionTrigger, | ||
Button, | ||
} from 'filigran-ui' | ||
import Link from 'next/link' | ||
import {usePathname} from 'next/navigation' | ||
|
||
interface MenuProps { | ||
contentMenu: ContentMenu | ||
} | ||
|
||
export const Menu: FunctionComponent<MenuProps> = ({contentMenu}) => { | ||
const currentPath = usePathname().replace('/docs/', '') | ||
return ( | ||
<aside | ||
className={cn( | ||
'mobile:hidden z-9 sticky top-[4rem] flex h-[calc(100vh-4rem)] w-48 flex-col overflow-y-auto overflow-x-hidden border-r bg-page-background py-s duration-300 ease-in-out' | ||
)}> | ||
<h2 className="px-s text-xl font-medium leading-9"> | ||
{contentMenu.title} | ||
</h2> | ||
{contentMenu.content.map((menu) => { | ||
if (menu?.content?.length > 0) { | ||
return ( | ||
<Accordion | ||
type="single" | ||
key={menu.title} | ||
collapsible> | ||
<AccordionItem value={`item-${menu.title}`}> | ||
<AccordionTrigger | ||
className={cn( | ||
'h-9 justify-between px-4 py-2 hover:bg-hover hover:no-underline', | ||
currentPath.startsWith(menu.title.toLowerCase()) && | ||
'bg-primary/10 shadow-[inset_2px_0px] shadow-primary' | ||
)}> | ||
{menu.title} | ||
</AccordionTrigger> | ||
<AccordionContent> | ||
{menu?.content.map((m) => { | ||
return ( | ||
<Button | ||
key={m.slug} | ||
variant="ghost" | ||
className={cn( | ||
'h-9 w-full justify-start rounded-none', | ||
currentPath === m.slug && | ||
'bg-primary/10 shadow-[inset_2px_0px] shadow-primary' | ||
)} | ||
asChild> | ||
<Link href={`/docs/${m.slug}`}>{m.title}</Link> | ||
</Button> | ||
) | ||
})} | ||
</AccordionContent> | ||
</AccordionItem> | ||
</Accordion> | ||
) | ||
} | ||
return ( | ||
<Button | ||
key={menu.slug} | ||
variant="ghost" | ||
className={cn( | ||
'h-9 w-full justify-start rounded-none', | ||
currentPath === menu.slug && | ||
'bg-primary/10 shadow-[inset_2px_0px] shadow-primary' | ||
)} | ||
asChild> | ||
<Link href={`/docs/${menu.slug}`}>{menu.title}</Link> | ||
</Button> | ||
) | ||
})} | ||
</aside> | ||
) | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Filigran UI presentation | ||
title: Presentation | ||
--- | ||
|
||
## Welcome to my MDX page! | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
Badge | ||
title: Badge | ||
--- | ||
|
||
## Example | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
Toast | ||
title: Toast | ||
--- | ||
|
||
## Example | ||
|