2023-08-30 07:56:28 +00:00
|
|
|
// components
|
2023-08-25 12:11:23 +00:00
|
|
|
import {
|
|
|
|
PeekOverviewHeader,
|
|
|
|
PeekOverviewIssueActivity,
|
|
|
|
PeekOverviewIssueDetails,
|
|
|
|
PeekOverviewIssueProperties,
|
|
|
|
TPeekOverviewModes,
|
|
|
|
} from "components/issues";
|
2023-08-30 07:56:28 +00:00
|
|
|
// ui
|
|
|
|
import { Loader } from "components/ui";
|
|
|
|
// types
|
2023-08-25 12:11:23 +00:00
|
|
|
import { IIssue } from "types";
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
handleClose: () => void;
|
|
|
|
handleDeleteIssue: () => void;
|
2023-08-30 07:56:28 +00:00
|
|
|
handleUpdateIssue: (formData: Partial<IIssue>) => Promise<void>;
|
|
|
|
issue: IIssue | undefined;
|
2023-08-25 12:11:23 +00:00
|
|
|
mode: TPeekOverviewModes;
|
|
|
|
readOnly: boolean;
|
|
|
|
setMode: (mode: TPeekOverviewModes) => void;
|
|
|
|
workspaceSlug: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const FullScreenPeekView: React.FC<Props> = ({
|
|
|
|
handleClose,
|
|
|
|
handleDeleteIssue,
|
|
|
|
handleUpdateIssue,
|
|
|
|
issue,
|
|
|
|
mode,
|
|
|
|
readOnly,
|
|
|
|
setMode,
|
|
|
|
workspaceSlug,
|
|
|
|
}) => (
|
|
|
|
<div className="h-full w-full grid grid-cols-10 divide-x divide-custom-border-200 overflow-hidden">
|
|
|
|
<div className="h-full w-full flex flex-col col-span-7 overflow-hidden">
|
|
|
|
<div className="w-full p-5">
|
|
|
|
<PeekOverviewHeader
|
|
|
|
handleClose={handleClose}
|
|
|
|
handleDeleteIssue={handleDeleteIssue}
|
|
|
|
issue={issue}
|
|
|
|
mode={mode}
|
|
|
|
setMode={setMode}
|
|
|
|
workspaceSlug={workspaceSlug}
|
|
|
|
/>
|
|
|
|
</div>
|
2023-08-30 07:56:28 +00:00
|
|
|
{issue ? (
|
|
|
|
<div className="h-full w-full px-6 overflow-y-auto">
|
|
|
|
{/* issue title and description */}
|
|
|
|
<div className="w-full">
|
|
|
|
<PeekOverviewIssueDetails
|
|
|
|
handleUpdateIssue={handleUpdateIssue}
|
|
|
|
issue={issue}
|
|
|
|
readOnly={readOnly}
|
|
|
|
workspaceSlug={workspaceSlug}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
{/* divider */}
|
|
|
|
<div className="h-[1] w-full border-t border-custom-border-200 my-5" />
|
|
|
|
{/* issue activity/comments */}
|
|
|
|
<div className="w-full pb-5">
|
|
|
|
<PeekOverviewIssueActivity
|
|
|
|
workspaceSlug={workspaceSlug}
|
|
|
|
issue={issue}
|
|
|
|
readOnly={readOnly}
|
|
|
|
/>
|
|
|
|
</div>
|
2023-08-25 12:11:23 +00:00
|
|
|
</div>
|
2023-08-30 07:56:28 +00:00
|
|
|
) : (
|
|
|
|
<Loader className="px-6">
|
|
|
|
<Loader.Item height="30px" />
|
|
|
|
<div className="space-y-2 mt-3">
|
|
|
|
<Loader.Item height="20px" width="70%" />
|
|
|
|
<Loader.Item height="20px" width="60%" />
|
|
|
|
<Loader.Item height="20px" width="60%" />
|
|
|
|
</div>
|
|
|
|
</Loader>
|
|
|
|
)}
|
2023-08-25 12:11:23 +00:00
|
|
|
</div>
|
|
|
|
<div className="col-span-3 h-full w-full overflow-y-auto">
|
|
|
|
{/* issue properties */}
|
|
|
|
<div className="w-full px-6 py-5">
|
2023-08-30 07:56:28 +00:00
|
|
|
{issue ? (
|
|
|
|
<PeekOverviewIssueProperties
|
|
|
|
handleDeleteIssue={handleDeleteIssue}
|
|
|
|
handleUpdateIssue={handleUpdateIssue}
|
|
|
|
issue={issue}
|
|
|
|
mode="full"
|
|
|
|
readOnly={readOnly}
|
|
|
|
workspaceSlug={workspaceSlug}
|
|
|
|
/>
|
|
|
|
) : (
|
|
|
|
<Loader className="mt-11 space-y-4">
|
|
|
|
<Loader.Item height="30px" />
|
|
|
|
<Loader.Item height="30px" />
|
|
|
|
<Loader.Item height="30px" />
|
|
|
|
<Loader.Item height="30px" />
|
|
|
|
</Loader>
|
|
|
|
)}
|
2023-08-25 12:11:23 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|