plane/apps/space/components/issues/peek-overview/side-peek-view.tsx

54 lines
1.6 KiB
TypeScript
Raw Normal View History

2023-08-30 18:42:45 +00:00
import { useEffect } from "react";
import { observer } from "mobx-react-lite";
2023-08-30 18:42:45 +00:00
// lib
import { useMobxStore } from "lib/mobx/store-provider";
2023-08-30 18:42:45 +00:00
// components
import {
PeekOverviewHeader,
PeekOverviewIssueActivity,
PeekOverviewIssueDetails,
PeekOverviewIssueProperties,
} from "components/issues/peek-overview";
2023-08-30 18:42:45 +00:00
// types
import { IIssue } from "types/issue";
2023-08-31 11:05:26 +00:00
import { RootStore } from "store/root";
type Props = {
handleClose: () => void;
2023-08-30 18:42:45 +00:00
issueDetails: IIssue;
};
export const SidePeekView: React.FC<Props> = observer((props) => {
2023-08-30 18:42:45 +00:00
const { handleClose, issueDetails } = props;
2023-08-31 11:05:26 +00:00
const { project: projectStore } = useMobxStore();
return (
<div className="h-full w-full flex flex-col overflow-hidden">
<div className="w-full p-5">
2023-08-30 18:42:45 +00:00
<PeekOverviewHeader handleClose={handleClose} issueDetails={issueDetails} />
</div>
2023-08-30 18:42:45 +00:00
{issueDetails && (
<div className="h-full w-full px-6 overflow-y-auto">
{/* issue title and description */}
<div className="w-full">
2023-08-30 18:42:45 +00:00
<PeekOverviewIssueDetails issueDetails={issueDetails} />
</div>
{/* issue properties */}
<div className="w-full mt-10">
2023-08-30 18:42:45 +00:00
<PeekOverviewIssueProperties issueDetails={issueDetails} />
</div>
{/* divider */}
<div className="h-[1] w-full border-t border-custom-border-200 my-5" />
{/* issue activity/comments */}
2023-08-31 11:05:26 +00:00
{projectStore?.deploySettings?.comments && (
<div className="w-full pb-5">
<PeekOverviewIssueActivity issueDetails={issueDetails} />
</div>
)}
</div>
)}
</div>
);
});