|
1 | 1 | import { observer } from "mobx-react"; |
2 | 2 | import { useParams } from "next/navigation"; |
3 | | -// plane imports |
4 | | -import { EProjectFeatureKey } from "@plane/constants"; |
5 | | -import { Breadcrumbs, Header } from "@plane/ui"; |
6 | | -// components |
7 | | -import { BreadcrumbLink } from "@/components/common/breadcrumb-link"; |
8 | | -import { IssueDetailQuickActions } from "@/components/issues/issue-detail/issue-detail-quick-actions"; |
9 | 3 | // hooks |
| 4 | +import { Header, Row } from "@plane/ui"; |
| 5 | +import { AppHeader } from "@/components/core/app-header"; |
| 6 | +import { TabNavigationRoot } from "@/components/navigation"; |
10 | 7 | import { useIssueDetail } from "@/hooks/store/use-issue-detail"; |
11 | | -import { useProject } from "@/hooks/store/use-project"; |
12 | | -import { useAppRouter } from "@/hooks/use-app-router"; |
13 | | -import { CommonProjectBreadcrumbs } from "@/plane-web/components/breadcrumbs/common"; |
| 8 | +// local components |
| 9 | +import { WorkItemDetailsHeader } from "./work-item-header"; |
14 | 10 |
|
15 | | -export const ProjectIssueDetailsHeader = observer(function ProjectIssueDetailsHeader() { |
| 11 | +export const ProjectWorkItemDetailsHeader = observer(function ProjectWorkItemDetailsHeader() { |
16 | 12 | // router |
17 | | - const router = useAppRouter(); |
18 | 13 | const { workspaceSlug, workItem } = useParams(); |
19 | 14 | // store hooks |
20 | | - const { getProjectById, loader } = useProject(); |
21 | 15 | const { |
22 | 16 | issue: { getIssueById, getIssueIdByIdentifier }, |
23 | 17 | } = useIssueDetail(); |
24 | 18 | // derived values |
25 | 19 | const issueId = getIssueIdByIdentifier(workItem?.toString()); |
26 | | - const issueDetails = issueId ? getIssueById(issueId.toString()) : undefined; |
27 | | - const projectId = issueDetails ? issueDetails?.project_id : undefined; |
28 | | - const projectDetails = projectId ? getProjectById(projectId?.toString()) : undefined; |
29 | | - |
30 | | - if (!workspaceSlug || !projectId || !issueId) return null; |
| 20 | + const issueDetails = issueId ? getIssueById(issueId?.toString()) : undefined; |
31 | 21 |
|
32 | 22 | return ( |
33 | | - <Header> |
34 | | - <Header.LeftItem> |
35 | | - <Breadcrumbs onBack={router.back} isLoading={loader === "init-loader"}> |
36 | | - <CommonProjectBreadcrumbs |
37 | | - workspaceSlug={workspaceSlug?.toString()} |
38 | | - projectId={projectId?.toString()} |
39 | | - featureKey={EProjectFeatureKey.WORK_ITEMS} |
40 | | - /> |
41 | | - <Breadcrumbs.Item |
42 | | - component={ |
43 | | - <BreadcrumbLink |
44 | | - label={projectDetails && issueDetails ? `${projectDetails.identifier}-${issueDetails.sequence_id}` : ""} |
45 | | - /> |
46 | | - } |
47 | | - /> |
48 | | - </Breadcrumbs> |
49 | | - </Header.LeftItem> |
50 | | - <Header.RightItem> |
51 | | - {projectId && issueId && ( |
52 | | - <IssueDetailQuickActions |
53 | | - workspaceSlug={workspaceSlug?.toString()} |
54 | | - projectId={projectId?.toString()} |
55 | | - issueId={issueId?.toString()} |
56 | | - /> |
57 | | - )} |
58 | | - </Header.RightItem> |
59 | | - </Header> |
| 23 | + <> |
| 24 | + <div className="z-20"> |
| 25 | + <Row className="h-header flex gap-2 w-full items-center border-b border-custom-border-200 bg-custom-sidebar-background-100"> |
| 26 | + <div className="flex items-center gap-2 divide-x divide-custom-border-100 h-full w-full"> |
| 27 | + <div className="flex items-center h-full w-full flex-1"> |
| 28 | + <Header className="h-full"> |
| 29 | + <Header.LeftItem className="h-full max-w-full"> |
| 30 | + <TabNavigationRoot |
| 31 | + workspaceSlug={workspaceSlug} |
| 32 | + projectId={issueDetails?.project_id?.toString() ?? ""} |
| 33 | + /> |
| 34 | + </Header.LeftItem> |
| 35 | + </Header> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + </Row> |
| 39 | + </div> |
| 40 | + <AppHeader header={<WorkItemDetailsHeader />} /> |
| 41 | + </> |
60 | 42 | ); |
61 | 43 | }); |
0 commit comments