fix: empty module mutation and issue view flicker fix (#1158)

This commit is contained in:
Anmol Singh Bhatia 2023-05-29 18:35:43 +05:30 committed by GitHub
parent c8caa925b1
commit c949c4d244
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 42 deletions

View file

@ -172,47 +172,15 @@ const SingleModule: React.FC = () => {
}
>
<AnalyticsProjectModal isOpen={analyticsModal} onClose={() => setAnalyticsModal(false)} />
{moduleIssues ? (
moduleIssues.length > 0 ? (
<div className={`h-full ${moduleSidebar ? "mr-[24rem]" : ""} duration-300`}>
<IssuesView type="module" openIssuesListModal={openIssuesListModal} />
</div>
) : (
<div
className={`flex h-full flex-col items-center justify-center px-4 ${
moduleSidebar ? "mr-[24rem]" : ""
} duration-300`}
>
<EmptySpace
title="You don't have any issue yet."
description="Modules are smaller, focused projects that help you group and organize issues within a specific time frame."
Icon={RectangleStackIcon}
>
<EmptySpaceItem
title="Create a new issue"
description="Click to create a new issue inside the module."
Icon={PlusIcon}
action={() => {
const e = new KeyboardEvent("keydown", {
key: "c",
});
document.dispatchEvent(e);
}}
/>
<EmptySpaceItem
title="Add an existing issue"
description="Open list"
Icon={ListBulletIcon}
action={openIssuesListModal}
/>
</EmptySpace>
</div>
)
) : (
<div className="flex h-full w-full items-center justify-center">
<Spinner />
</div>
)}
<div
className={`h-full ${moduleSidebar ? "mr-[24rem]" : ""} ${
analyticsModal ? "mr-[50%]" : ""
} duration-300`}
>
<IssuesView type="module" openIssuesListModal={openIssuesListModal} />
</div>
<ModuleDetailsSidebar
issues={moduleIssues ?? []}
module={moduleDetails}