2023-08-30 18:42:45 +00:00
|
|
|
import { useEffect } from "react";
|
2023-08-30 07:19:15 +00:00
|
|
|
import { observer } from "mobx-react-lite";
|
2023-08-30 18:42:45 +00:00
|
|
|
// lib
|
2023-08-30 07:19:15 +00:00
|
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
2023-08-30 18:42:45 +00:00
|
|
|
// components
|
2023-08-30 07:19:15 +00:00
|
|
|
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";
|
2023-08-30 07:19:15 +00:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
handleClose: () => void;
|
2023-08-30 18:42:45 +00:00
|
|
|
issueDetails: IIssue;
|
2023-08-30 07:19:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const SidePeekView: React.FC<Props> = observer((props) => {
|
2023-08-30 18:42:45 +00:00
|
|
|
const { handleClose, issueDetails } = props;
|
2023-08-30 07:19:15 +00:00
|
|
|
|
2023-08-31 11:05:26 +00:00
|
|
|
const { project: projectStore } = useMobxStore();
|
|
|
|
|
2023-08-30 07:19:15 +00:00
|
|
|
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} />
|
2023-08-30 07:19:15 +00:00
|
|
|
</div>
|
2023-08-30 18:42:45 +00:00
|
|
|
{issueDetails && (
|
2023-08-30 07:19:15 +00:00
|
|
|
<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} />
|
2023-08-30 07:19:15 +00:00
|
|
|
</div>
|
|
|
|
{/* issue properties */}
|
|
|
|
<div className="w-full mt-10">
|
2023-08-30 18:42:45 +00:00
|
|
|
<PeekOverviewIssueProperties issueDetails={issueDetails} />
|
2023-08-30 07:19:15 +00:00
|
|
|
</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>
|
|
|
|
)}
|
2023-08-30 07:19:15 +00:00
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
});
|