forked from github/plane
44f8ba407d
* auth integration fixes * auth integration fixes * auth integration fixes * auth integration fixes * dev: update user api to return fallback workspace and improve the structure of the response * dev: fix the issue keyerror and move onboarding logic to serializer method field * dev: use-user-auth hook imlemented for route access validation and build issues resolved effected by user payload * fix: global theme color fix * style: new onboarding ui , fix: use-user-auth hook implemented * fix: command palette, project invite modal and issue detail page mutation type fix * fix: onboarding redirection fix * dev: build isuue resolved * fix: use user auth hook fix * fix: sign in toast alert fix, sign out redirection fix and user theme error fix * fix: user response fix * fix: unAuthorizedStatus logic updated --------- Co-authored-by: pablohashescobar <nikhilschacko@gmail.com> Co-authored-by: gurusainath <gurusainath007@gmail.com> Co-authored-by: anmolsinghbhatia <anmolsinghbhatia@caravel.tech>
65 lines
1.6 KiB
TypeScript
65 lines
1.6 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";
|
|
import { Icon } from "components/ui";
|
|
|
|
type BreadcrumbsProps = {
|
|
children: any;
|
|
};
|
|
|
|
const Breadcrumbs = ({ children }: BreadcrumbsProps) => {
|
|
const router = useRouter();
|
|
|
|
return (
|
|
<>
|
|
<div className="flex items-center">
|
|
<button
|
|
type="button"
|
|
className="group grid h-7 w-7 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()}
|
|
>
|
|
<Icon
|
|
iconName="keyboard_backspace"
|
|
className="text-base leading-4 text-brand-secondary group-hover:text-brand-base"
|
|
/>
|
|
</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 };
|