-
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.
feat(navbar): add group-list sub-component + minor design fixes (#72)
* feat(navbar): add group-list sub-component + minor design fixes * feat(navbar): cr fix * feat(navbar): cr fix
- Loading branch information
Showing
6 changed files
with
120 additions
and
127 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import cs from 'classnames'; | ||
import type { FC } from 'react'; | ||
import { Navbar } from '.'; | ||
|
||
export type NavbarExpansionItem = { | ||
label: string; | ||
href: string; | ||
}; | ||
|
||
export interface NavbarExpansionProps { | ||
groupName?: string; | ||
groupLink?: string; | ||
withUnderlineEffect?: boolean; | ||
children?: React.ReactNode; | ||
} | ||
|
||
export const NavbarExpansion: FC<NavbarExpansionProps> = ({ | ||
groupName, | ||
groupLink, | ||
withUnderlineEffect = false, | ||
children | ||
}) => { | ||
return ( | ||
<div className="flex md:container md:max-h-96 md:min-h-[200px] md:py-5"> | ||
{groupName && ( | ||
<div className="hidden h-fit min-w-[120px] md:block"> | ||
<div className="w-fit"> | ||
{groupLink ? ( | ||
<Navbar.Link href={groupLink} withUnderlineEffect={withUnderlineEffect}> | ||
{groupName} | ||
</Navbar.Link> | ||
) : ( | ||
<span className="underline">{groupName}</span> | ||
)} | ||
</div> | ||
</div> | ||
)} | ||
<div | ||
className={cs({ | ||
'flex flex-col flex-wrap gap-4 gap-x-20 px-5 py-6 md:py-0': true, | ||
'border-l-0 md:border-l': groupName | ||
})} | ||
> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
}; |
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