-
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.
- Loading branch information
1 parent
84ba1e3
commit 2a999b7
Showing
22 changed files
with
330 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,38 @@ | ||
import { Navbar, NavbarContent } from '@nextui-org/react'; | ||
import { twColors } from '@do-ob/ui/utility'; | ||
import { clsx } from '@do-ob/core'; | ||
import { clsx, clmg } from '@do-ob/core'; | ||
|
||
import type { NavigationProps } from './Navigation'; | ||
import { NavigationPart_Brand } from './parts/NavigationPart_Brand'; | ||
import { NavigationPart_Links } from './parts/NavigationPart_Links'; | ||
import { NavigationPart_Search } from './parts/NavigationPart_Search'; | ||
|
||
export function NavigationIsland({ | ||
title, | ||
image, | ||
color, | ||
links, | ||
className, | ||
search, | ||
}: NavigationProps) { | ||
|
||
const [ colors ] = twColors(color); | ||
|
||
return ( | ||
<Navbar className="items-center justify-center"> | ||
<NavbarContent justify="start" className="flex items-center"> | ||
<NavigationPart_Brand title={title} /> | ||
<NavigationPart_Brand title={title} image={image} /> | ||
</NavbarContent> | ||
<NavbarContent justify="center"> | ||
<div className={clsx(color && colors, 'flex gap-1 rounded-full px-4 py-1')}> | ||
<div className={clmg(clsx(color && colors, 'flex rounded-full px-4', className))}> | ||
<NavigationPart_Links links={links} colors={colors} /> | ||
</div> | ||
</NavbarContent> | ||
<NavbarContent justify="end"> | ||
|
||
{search ? ( | ||
<NavigationPart_Search search={search} /> | ||
) : null} | ||
</NavbarContent> | ||
</Navbar> | ||
); | ||
} | ||
|
||
export default NavigationIsland; |
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
28 changes: 28 additions & 0 deletions
28
packages/ui/src/Navigation/parts/NavigationPart_Search.tsx
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,28 @@ | ||
import { MagnifyingGlassIcon } from '@heroicons/react/24/solid'; | ||
import { Button, Modal, useDisclosure } from '@nextui-org/react'; | ||
|
||
/** | ||
* Navigation Brand properties | ||
*/ | ||
export interface NavigationPart_SearchProps { | ||
/** | ||
* The search form action URL. | ||
*/ | ||
search?: string; | ||
} | ||
|
||
/** | ||
* Navigation Search component | ||
*/ | ||
export function NavigationPart_Search({ | ||
search = '#' | ||
}: NavigationPart_SearchProps) { | ||
|
||
const { isOpen, onOpen } = useDisclosure(); | ||
|
||
return ( | ||
<Button isIconOnly onClick={onOpen}> | ||
<MagnifyingGlassIcon className="size-6" /> | ||
</Button> | ||
); | ||
} |
Oops, something went wrong.