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>
61 lines
1.5 KiB
TypeScript
61 lines
1.5 KiB
TypeScript
import * as React from "react";
|
|
import { useRouter } from "next/router";
|
|
import Link from "next/link";
|
|
// icons
|
|
import { ArrowLeftIcon } from "@heroicons/react/24/outline";
|
|
|
|
type BreadcrumbsProps = {
|
|
children: any;
|
|
};
|
|
|
|
const Breadcrumbs = ({ children }: BreadcrumbsProps) => {
|
|
const router = useRouter();
|
|
|
|
return (
|
|
<>
|
|
<div className="flex items-center">
|
|
<button
|
|
type="button"
|
|
className="grid h-8 w-8 flex-shrink-0 cursor-pointer place-items-center rounded border border-brand-base text-center text-sm hover:bg-brand-surface-1"
|
|
onClick={() => router.back()}
|
|
>
|
|
<ArrowLeftIcon className="h-3 w-3" />
|
|
</button>
|
|
{children}
|
|
</div>
|
|
</>
|
|
);
|
|
};
|
|
|
|
type BreadcrumbItemProps = {
|
|
title: string;
|
|
link?: string;
|
|
icon?: any;
|
|
};
|
|
|
|
const BreadcrumbItem: React.FC<BreadcrumbItemProps> = ({ title, link, icon }) => (
|
|
<>
|
|
{link ? (
|
|
<Link href={link}>
|
|
<a className="border-r-2 border-brand-base px-3 text-sm">
|
|
<p className={`${icon ? "flex items-center gap-2" : ""}`}>
|
|
{icon ?? null}
|
|
{title}
|
|
</p>
|
|
</a>
|
|
</Link>
|
|
) : (
|
|
<div className="max-w-64 px-3 text-sm">
|
|
<p className={`${icon ? "flex items-center gap-2" : ""}`}>
|
|
{icon}
|
|
<span className="break-all">{title}</span>
|
|
</p>
|
|
</div>
|
|
)}
|
|
</>
|
|
);
|
|
|
|
Breadcrumbs.BreadcrumbItem = BreadcrumbItem;
|
|
|
|
export { Breadcrumbs, BreadcrumbItem };
|