forked from github/plane
3c2f5d12ed
* chore: add next theme and initial setup * chore: add dark mode colors to layouts * chore: user general setting page theming * chore: dashboard theming * chore: project page theming * chore: workspace setting page theming * chore: my issue page theming * chore: cmdk theming * chore: change hardcode bg and text color to theme * chore: change color name according to the design * style: fix card in the dashboard * style: fix merge conflict design issues * style: add light high contrast and dark high contrast * style: fix cmd k menu color and selection * feat: change theme from cmdk menu * chore: add multiple theme field to custom theme * chore: removed custom theming * fix: build error --------- Co-authored-by: Saheb Giri <iamsahebgiri@gmail.com>
112 lines
2.7 KiB
TypeScript
112 lines
2.7 KiB
TypeScript
import Link from "next/link";
|
|
import { useRouter } from "next/router";
|
|
|
|
type Props = {
|
|
profilePage?: boolean;
|
|
};
|
|
|
|
const SettingsNavbar: React.FC<Props> = ({ profilePage = false }) => {
|
|
const router = useRouter();
|
|
const { workspaceSlug, projectId } = router.query;
|
|
|
|
const workspaceLinks: Array<{
|
|
label: string;
|
|
href: string;
|
|
}> = [
|
|
{
|
|
label: "General",
|
|
href: `/${workspaceSlug}/settings`,
|
|
},
|
|
{
|
|
label: "Members",
|
|
href: `/${workspaceSlug}/settings/members`,
|
|
},
|
|
{
|
|
label: "Billing & Plans",
|
|
href: `/${workspaceSlug}/settings/billing`,
|
|
},
|
|
{
|
|
label: "Integrations",
|
|
href: `/${workspaceSlug}/settings/integrations`,
|
|
},
|
|
{
|
|
label: "Import/Export",
|
|
href: `/${workspaceSlug}/settings/import-export`,
|
|
},
|
|
];
|
|
|
|
const projectLinks: Array<{
|
|
label: string;
|
|
href: string;
|
|
}> = [
|
|
{
|
|
label: "General",
|
|
href: `/${workspaceSlug}/projects/${projectId}/settings`,
|
|
},
|
|
{
|
|
label: "Control",
|
|
href: `/${workspaceSlug}/projects/${projectId}/settings/control`,
|
|
},
|
|
{
|
|
label: "Members",
|
|
href: `/${workspaceSlug}/projects/${projectId}/settings/members`,
|
|
},
|
|
{
|
|
label: "Features",
|
|
href: `/${workspaceSlug}/projects/${projectId}/settings/features`,
|
|
},
|
|
{
|
|
label: "States",
|
|
href: `/${workspaceSlug}/projects/${projectId}/settings/states`,
|
|
},
|
|
{
|
|
label: "Labels",
|
|
href: `/${workspaceSlug}/projects/${projectId}/settings/labels`,
|
|
},
|
|
{
|
|
label: "Integrations",
|
|
href: `/${workspaceSlug}/projects/${projectId}/settings/integrations`,
|
|
},
|
|
{
|
|
label: "Estimates",
|
|
href: `/${workspaceSlug}/projects/${projectId}/settings/estimates`,
|
|
},
|
|
];
|
|
|
|
const profileLinks: Array<{
|
|
label: string;
|
|
href: string;
|
|
}> = [
|
|
{
|
|
label: "General",
|
|
href: `/${workspaceSlug}/me/profile`,
|
|
},
|
|
{
|
|
label: "Activity",
|
|
href: `/${workspaceSlug}/me/profile/activity`,
|
|
},
|
|
];
|
|
|
|
return (
|
|
<div className="flex flex-wrap gap-4">
|
|
{(profilePage ? profileLinks : projectId ? projectLinks : workspaceLinks).map((link) => (
|
|
<Link key={link.href} href={link.href}>
|
|
<a>
|
|
<div
|
|
className={`rounded-3xl border border-brand-base px-5 py-1.5 text-sm sm:px-7 sm:py-2 sm:text-base ${
|
|
router.asPath === link.href
|
|
? "border-brand-accent bg-brand-accent text-white"
|
|
: "border-brand-base bg-brand-surface-2 hover:bg-brand-surface-1"
|
|
}`}
|
|
>
|
|
{link.label}
|
|
</div>
|
|
</a>
|
|
</Link>
|
|
))}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default SettingsNavbar;
|