tasko/app/(platform)/(dashboard)/_components/Navbar.tsx

68 lines
1.9 KiB
TypeScript
Raw Normal View History

2024-02-16 01:49:19 +00:00
import { Plus } from 'lucide-react';
import { OrganizationSwitcher, UserButton } from '@clerk/nextjs';
2024-02-15 02:30:10 +00:00
2024-02-16 01:49:19 +00:00
import { Logo } from '@/components/logo';
import { Button } from '@/components/ui/button';
import { FormPopover } from '@/components/form/form-popover';
2024-02-15 02:30:10 +00:00
2024-02-16 01:49:19 +00:00
import { MobileSidebar } from './mobile-sidebar';
2024-02-15 02:30:10 +00:00
export const Navbar = () => {
return (
2024-02-16 01:49:19 +00:00
<nav className='fixed top-0 z-50 flex h-14 w-full items-center border-b bg-white px-4 shadow-sm'>
2024-02-15 02:30:10 +00:00
<MobileSidebar />
2024-02-16 01:49:19 +00:00
<div className='flex items-center gap-x-4'>
<div className='hidden md:flex'>
2024-02-15 02:30:10 +00:00
<Logo />
</div>
2024-02-16 01:49:19 +00:00
<FormPopover align='start' side='bottom' sideOffset={18}>
2024-02-15 02:30:10 +00:00
<Button
2024-02-16 01:49:19 +00:00
variant='primary'
size='sm'
className='hidden h-auto rounded-sm px-2 py-1.5 md:block'
2024-02-15 02:30:10 +00:00
>
Create
</Button>
</FormPopover>
<FormPopover>
<Button
2024-02-16 01:49:19 +00:00
variant='primary'
size='sm'
className='block rounded-sm md:hidden'
2024-02-15 02:30:10 +00:00
>
2024-02-16 01:49:19 +00:00
<Plus className='h-4 w-4' />
2024-02-15 02:30:10 +00:00
</Button>
</FormPopover>
</div>
2024-02-16 01:49:19 +00:00
<div className='ml-auto flex items-center gap-x-2'>
2024-02-15 02:30:10 +00:00
<OrganizationSwitcher
hidePersonal
2024-02-16 01:49:19 +00:00
afterCreateOrganizationUrl='/organization/:id'
afterLeaveOrganizationUrl='/org-select'
afterSelectOrganizationUrl='/organization/:id'
2024-02-15 02:30:10 +00:00
appearance={{
elements: {
rootBox: {
2024-02-16 01:49:19 +00:00
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
2024-02-15 02:30:10 +00:00
},
},
}}
/>
<UserButton
2024-02-16 01:49:19 +00:00
afterSignOutUrl='/'
2024-02-15 02:30:10 +00:00
appearance={{
elements: {
avatarBox: {
height: 30,
width: 30,
},
},
}}
/>
</div>
</nav>
);
};