mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 10:11:35 +10:00
## Description Add support for teams which will allow users to collaborate on documents. Teams features allows users to: - Create, manage and transfer teams - Manage team members - Manage team emails - Manage a shared team inbox and documents These changes do NOT include the following, which are planned for a future release: - Team templates - Team API - Search menu integration ## Testing Performed - Added E2E tests for general team management - Added E2E tests to validate document counts ## Checklist - [X] I have tested these changes locally and they work as expected. - [X] I have added/updated tests that prove the effectiveness of these changes. - [ ] I have updated the documentation to reflect these changes, if applicable. - [X] I have followed the project's coding style guidelines.
76 lines
2.0 KiB
TypeScript
76 lines
2.0 KiB
TypeScript
'use client';
|
|
|
|
import type { HTMLAttributes } from 'react';
|
|
|
|
import Link from 'next/link';
|
|
import { useParams, usePathname } from 'next/navigation';
|
|
|
|
import { CreditCard, Key, User } from 'lucide-react';
|
|
|
|
import { IS_BILLING_ENABLED } from '@documenso/lib/constants/app';
|
|
import { cn } from '@documenso/ui/lib/utils';
|
|
import { Button } from '@documenso/ui/primitives/button';
|
|
|
|
export type MobileNavProps = HTMLAttributes<HTMLDivElement>;
|
|
|
|
export const MobileNav = ({ className, ...props }: MobileNavProps) => {
|
|
const pathname = usePathname();
|
|
const params = useParams();
|
|
|
|
const teamUrl = typeof params?.teamUrl === 'string' ? params?.teamUrl : '';
|
|
|
|
const settingsPath = `/t/${teamUrl}/settings`;
|
|
const membersPath = `/t/${teamUrl}/settings/members`;
|
|
const billingPath = `/t/${teamUrl}/settings/billing`;
|
|
|
|
return (
|
|
<div
|
|
className={cn('flex flex-wrap items-center justify-start gap-x-2 gap-y-4', className)}
|
|
{...props}
|
|
>
|
|
<Link href={settingsPath}>
|
|
<Button
|
|
variant="ghost"
|
|
className={cn(
|
|
'w-full justify-start',
|
|
pathname?.startsWith(settingsPath) &&
|
|
pathname.split('/').length === 4 &&
|
|
'bg-secondary',
|
|
)}
|
|
>
|
|
<User className="mr-2 h-5 w-5" />
|
|
General
|
|
</Button>
|
|
</Link>
|
|
|
|
<Link href={membersPath}>
|
|
<Button
|
|
variant="ghost"
|
|
className={cn(
|
|
'w-full justify-start',
|
|
pathname?.startsWith(membersPath) && 'bg-secondary',
|
|
)}
|
|
>
|
|
<Key className="mr-2 h-5 w-5" />
|
|
Members
|
|
</Button>
|
|
</Link>
|
|
|
|
{IS_BILLING_ENABLED && (
|
|
<Link href={billingPath}>
|
|
<Button
|
|
variant="ghost"
|
|
className={cn(
|
|
'w-full justify-start',
|
|
pathname?.startsWith(billingPath) && 'bg-secondary',
|
|
)}
|
|
>
|
|
<CreditCard className="mr-2 h-5 w-5" />
|
|
Billing
|
|
</Button>
|
|
</Link>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|