fix: issue widget modal rendering (#5896)

This commit is contained in:
Anmol Singh Bhatia 2024-10-23 15:19:26 +05:30 committed by GitHub
parent 84c06c4713
commit c4421f5f97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -12,10 +12,11 @@ type Props = {
projectId: string; projectId: string;
issueId: string; issueId: string;
disabled: boolean; disabled: boolean;
renderWidgetModals?: boolean;
}; };
export const IssueDetailWidgets: FC<Props> = (props) => { export const IssueDetailWidgets: FC<Props> = (props) => {
const { workspaceSlug, projectId, issueId, disabled } = props; const { workspaceSlug, projectId, issueId, disabled, renderWidgetModals = true } = props;
return ( return (
<> <>
<div className="flex flex-col gap-5"> <div className="flex flex-col gap-5">
@ -32,7 +33,9 @@ export const IssueDetailWidgets: FC<Props> = (props) => {
disabled={disabled} disabled={disabled}
/> />
</div> </div>
{renderWidgetModals && (
<IssueDetailWidgetModals workspaceSlug={workspaceSlug} projectId={projectId} issueId={issueId} /> <IssueDetailWidgetModals workspaceSlug={workspaceSlug} projectId={projectId} issueId={issueId} />
)}
</> </>
); );
}; };

View file

@ -40,6 +40,7 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
const { data: currentUser } = useUser(); const { data: currentUser } = useUser();
const { const {
issue: { getIssueById }, issue: { getIssueById },
peekIssue,
} = useIssueDetail(); } = useIssueDetail();
const { setShowAlert } = useReloadConfirmations(isSubmitting === "submitting"); const { setShowAlert } = useReloadConfirmations(isSubmitting === "submitting");
@ -53,6 +54,8 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
const issue = issueId ? getIssueById(issueId) : undefined; const issue = issueId ? getIssueById(issueId) : undefined;
if (!issue || !issue.project_id) return <></>; if (!issue || !issue.project_id) return <></>;
const isPeekModeActive = Boolean(peekIssue);
return ( return (
<> <>
<div className="rounded-lg space-y-4"> <div className="rounded-lg space-y-4">
@ -110,6 +113,7 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
projectId={projectId} projectId={projectId}
issueId={issueId} issueId={issueId}
disabled={!isEditable || isArchived} disabled={!isEditable || isArchived}
renderWidgetModals={!isPeekModeActive}
/> />
{windowSize[0] < 768 && ( {windowSize[0] < 768 && (