* feat: add navigation dropdown component * chore: enhance title/ description loader and componenet modularity * chore: issue store filter update * chore: added few icons to ui package * chore: improvements for tabs componenet * chore: enhance sidebar modularity * chore: update issue and router store to add support for additional issue layouts * chore: enhanced cycle componenets modularity * feat: added project grouping header for cycles list * chore: enhanced project dropdown componenet by adding multiple selection functionality * chore: enhanced rich text editor modularity by taking members ids as props for mentions * chore: added functionality to filter disabled layouts in issue-layout dropdown * chore: added support to pass project ids as props in project card list * feat: multi select project modal * chore: seperate out project componenet for reusability * chore: command pallete store improvements * fix: build errors
65 lines
2 KiB
TypeScript
65 lines
2 KiB
TypeScript
"use client";
|
|
|
|
import { observer } from "mobx-react";
|
|
import { usePathname } from "next/navigation";
|
|
import { Briefcase } from "lucide-react";
|
|
// ui
|
|
import { Breadcrumbs, Button, Header } from "@plane/ui";
|
|
// components
|
|
import { BreadcrumbLink } from "@/components/common";
|
|
// hooks
|
|
import { useCommandPalette, useEventTracker, useUserPermissions } from "@/hooks/store";
|
|
// plane web constants
|
|
import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions";
|
|
// components
|
|
import HeaderFilters from "./filters";
|
|
import { ProjectSearch } from "./search-projects";
|
|
|
|
export const ProjectsBaseHeader = observer(() => {
|
|
// store hooks
|
|
const { toggleCreateProjectModal } = useCommandPalette();
|
|
const { setTrackElement } = useEventTracker();
|
|
const { allowPermissions } = useUserPermissions();
|
|
|
|
const pathname = usePathname();
|
|
// auth
|
|
const isAuthorizedUser = allowPermissions(
|
|
[EUserPermissions.ADMIN, EUserPermissions.MEMBER],
|
|
EUserPermissionsLevel.WORKSPACE
|
|
);
|
|
const isArchived = pathname.includes("/archives");
|
|
|
|
return (
|
|
<Header>
|
|
<Header.LeftItem>
|
|
<Breadcrumbs>
|
|
<Breadcrumbs.BreadcrumbItem
|
|
type="text"
|
|
link={<BreadcrumbLink label="Projects" icon={<Briefcase className="h-4 w-4 text-custom-text-300" />} />}
|
|
/>
|
|
{isArchived && <Breadcrumbs.BreadcrumbItem type="text" link={<BreadcrumbLink label="Archived" />} />}
|
|
</Breadcrumbs>
|
|
</Header.LeftItem>
|
|
<Header.RightItem>
|
|
<ProjectSearch />
|
|
<div className="hidden md:flex">
|
|
<HeaderFilters />
|
|
</div>
|
|
{isAuthorizedUser && !isArchived ? (
|
|
<Button
|
|
size="sm"
|
|
onClick={() => {
|
|
setTrackElement("Projects page");
|
|
toggleCreateProjectModal(true);
|
|
}}
|
|
className="items-center gap-1"
|
|
>
|
|
<span className="hidden sm:inline-block">Add</span> Project
|
|
</Button>
|
|
) : (
|
|
<></>
|
|
)}
|
|
</Header.RightItem>
|
|
</Header>
|
|
);
|
|
});
|