chore: loading state improvement (#3657)

This commit is contained in:
Anmol Singh Bhatia 2024-02-14 12:40:03 +05:30 committed by GitHub
parent 25a2816a76
commit 83bf28bb83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 50 deletions

View File

@ -17,8 +17,6 @@ import {
} from "components/issues"; } from "components/issues";
import { TransferIssues, TransferIssuesModal } from "components/cycles"; import { TransferIssues, TransferIssuesModal } from "components/cycles";
import { ActiveLoader } from "components/ui"; import { ActiveLoader } from "components/ui";
// ui
import { Spinner } from "@plane/ui";
// constants // constants
import { EIssuesStoreType } from "constants/issue"; import { EIssuesStoreType } from "constants/issue";
@ -56,17 +54,7 @@ export const CycleLayoutRoot: React.FC = observer(() => {
if (!workspaceSlug || !projectId || !cycleId) return <></>; if (!workspaceSlug || !projectId || !cycleId) return <></>;
if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) { if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) {
return ( return <>{activeLayout && <ActiveLoader layout={activeLayout} />}</>;
<>
{activeLayout ? (
<ActiveLoader layout={activeLayout} />
) : (
<div className="flex h-full w-full items-center justify-center">
<Spinner />
</div>
)}
</>
);
} }
return ( return (

View File

@ -11,7 +11,6 @@ import { ProjectDraftEmptyState } from "../empty-states";
import { IssuePeekOverview } from "components/issues/peek-overview"; import { IssuePeekOverview } from "components/issues/peek-overview";
import { ActiveLoader } from "components/ui"; import { ActiveLoader } from "components/ui";
// ui // ui
import { Spinner } from "@plane/ui";
import { DraftKanBanLayout } from "../kanban/roots/draft-issue-root"; import { DraftKanBanLayout } from "../kanban/roots/draft-issue-root";
// constants // constants
import { EIssuesStoreType } from "constants/issue"; import { EIssuesStoreType } from "constants/issue";
@ -42,17 +41,7 @@ export const DraftIssueLayoutRoot: React.FC = observer(() => {
if (!workspaceSlug || !projectId) return <></>; if (!workspaceSlug || !projectId) return <></>;
if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) { if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) {
return ( return <>{activeLayout && <ActiveLoader layout={activeLayout} />}</>;
<>
{activeLayout ? (
<ActiveLoader layout={activeLayout} />
) : (
<div className="flex h-full w-full items-center justify-center">
<Spinner />
</div>
)}
</>
);
} }
return ( return (

View File

@ -16,8 +16,6 @@ import {
ModuleSpreadsheetLayout, ModuleSpreadsheetLayout,
} from "components/issues"; } from "components/issues";
import { ActiveLoader } from "components/ui"; import { ActiveLoader } from "components/ui";
// ui
import { Spinner } from "@plane/ui";
// constants // constants
import { EIssuesStoreType } from "constants/issue"; import { EIssuesStoreType } from "constants/issue";
@ -50,17 +48,7 @@ export const ModuleLayoutRoot: React.FC = observer(() => {
const activeLayout = issuesFilter?.issueFilters?.displayFilters?.layout || undefined; const activeLayout = issuesFilter?.issueFilters?.displayFilters?.layout || undefined;
if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) { if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) {
return ( return <>{activeLayout && <ActiveLoader layout={activeLayout} />}</>;
<>
{activeLayout ? (
<ActiveLoader layout={activeLayout} />
) : (
<div className="flex h-full w-full items-center justify-center">
<Spinner />
</div>
)}
</>
);
} }
return ( return (

View File

@ -15,7 +15,6 @@ import {
ProjectViewListLayout, ProjectViewListLayout,
ProjectViewSpreadsheetLayout, ProjectViewSpreadsheetLayout,
} from "components/issues"; } from "components/issues";
import { Spinner } from "@plane/ui";
import { ActiveLoader } from "components/ui"; import { ActiveLoader } from "components/ui";
// constants // constants
import { EIssuesStoreType } from "constants/issue"; import { EIssuesStoreType } from "constants/issue";
@ -66,17 +65,7 @@ export const ProjectViewLayoutRoot: React.FC = observer(() => {
if (!workspaceSlug || !projectId || !viewId) return <></>; if (!workspaceSlug || !projectId || !viewId) return <></>;
if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) { if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) {
return ( return <>{activeLayout && <ActiveLoader layout={activeLayout} />}</>;
<>
{activeLayout ? (
<ActiveLoader layout={activeLayout} />
) : (
<div className="flex h-full w-full items-center justify-center">
<Spinner />
</div>
)}
</>
);
} }
return ( return (