Skip to content

Commit

Permalink
chore: Wrap routes in suspense wrapper that haven't done so in child …
Browse files Browse the repository at this point in the history
…data components
  • Loading branch information
gdalcengio committed Sep 18, 2024
1 parent 6428704 commit 568b794
Show file tree
Hide file tree
Showing 19 changed files with 133 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import ContactPage from "@/administration/app/components/contacts/ContactPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params: { contactId },
}: Readonly<{ params: { contactId: string } }>) {
return <ContactPage contactId={contactId} />;
return (
<Suspense fallback={<Loading />}>
<ContactPage contactId={contactId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// 🚩 flagging that for shared routes between roles, "Page" code is a component for code maintainability
import { ContactsSearchParams } from "@/administration/app/components/contacts/types";
import ContactsPage from "@/administration/app/components/contacts/ContactsPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
searchParams,
}: Readonly<{
searchParams: ContactsSearchParams;
}>) {
return <ContactsPage searchParams={searchParams} isExternalUser={true} />;
return (
<Suspense fallback={<Loading />}>
<ContactsPage searchParams={searchParams} isExternalUser={true} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// 🚩 flagging that for shared routes between roles, `Operator` code is a component for code maintainability
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

import Operator from "@/administration/app/components/operators/Operator";

export default async function Page() {
return <Operator />;
return (
<Suspense fallback={<Loading />}>
<Operator />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { UUID } from "crypto";
import FacilityPage from "@/administration/app/components/facilities/FacilityPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params,
}: {
params: Readonly<{ operationId: UUID }>;
}) {
return <FacilityPage operationId={params.operationId} />;
return (
<Suspense fallback={<Loading />}>
<FacilityPage operationId={params.operationId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import OperationInformationPage from "@/administration/app/components/operations/OperationInformationPage";
import { UUID } from "crypto";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
params: { operationId },
}: Readonly<{
params: { operationId: UUID };
}>) {
return <OperationInformationPage operationId={operationId} />;
return (
<Suspense fallback={<Loading />}>
<OperationInformationPage operationId={operationId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import ContactPage from "@/administration/app/components/contacts/ContactPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params: { contactId },
}: Readonly<{ params: { contactId: string } }>) {
return <ContactPage contactId={contactId} />;
return (
<Suspense fallback={<Loading />}>
<ContactPage contactId={contactId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import ContactPage from "@/administration/app/components/contacts/ContactPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page() {
return <ContactPage />;
return (
<Suspense fallback={<Loading />}>
<ContactPage />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// 🚩 flagging that for shared routes between roles, "Page" code is a component for code maintainability
import { ContactsSearchParams } from "@/administration/app/components/contacts/types";
import ContactsPage from "@/administration/app/components/contacts/ContactsPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
searchParams,
}: Readonly<{
searchParams: ContactsSearchParams;
}>) {
return <ContactsPage searchParams={searchParams} isExternalUser={true} />;
return (
<Suspense fallback={<Loading />}>
<ContactsPage searchParams={searchParams} isExternalUser={true} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// 🚩 flagging that for shared routes between roles, `Operator` code is a component for code maintainability

import Operator from "@/administration/app/components/operators/Operator";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page() {
return <Operator />;
return (
<Suspense fallback={<Loading />}>
<Operator />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { UUID } from "crypto";
import FacilityPage from "@/administration/app/components/facilities/FacilityPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params,
}: {
params: Readonly<{ operationId: UUID }>;
}) {
return <FacilityPage operationId={params.operationId} />;
return (
<Suspense fallback={<Loading />}>
<FacilityPage operationId={params.operationId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import OperationInformationPage from "@/administration/app/components/operations/OperationInformationPage";
import { UUID } from "crypto";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
params: { operationId },
}: Readonly<{
params: { operationId: UUID };
}>) {
return <OperationInformationPage operationId={operationId} />;
return (
<Suspense fallback={<Loading />}>
<OperationInformationPage operationId={operationId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import ContactPage from "@/administration/app/components/contacts/ContactPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params: { contactId },
}: Readonly<{ params: { contactId: string } }>) {
return <ContactPage contactId={contactId} />;
return (
<Suspense fallback={<Loading />}>
<ContactPage contactId={contactId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// 🚩 flagging that for shared routes between roles, "Page" code is a component for code maintainability
import { ContactsSearchParams } from "@/administration/app/components/contacts/types";
import ContactsPage from "@/administration/app/components/contacts/ContactsPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
searchParams,
}: Readonly<{
searchParams: ContactsSearchParams;
}>) {
return <ContactsPage searchParams={searchParams} isExternalUser={false} />;
return (
<Suspense fallback={<Loading />}>
<ContactsPage searchParams={searchParams} isExternalUser={false} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import ContactPage from "apps/administration/app/components/contacts/ContactPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default function Page({
params: { contactId },
}: Readonly<{ params: { contactId: string } }>) {
return <ContactPage contactId={contactId} />;
return (
<Suspense fallback={<Loading />}>
<ContactPage contactId={contactId} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// 🚩 flagging that for shared routes between roles, "Page" code is a component for code maintainability
import { ContactsSearchParams } from "@/administration/app/components/contacts/types";
import ContactsPage from "@/administration/app/components/contacts/ContactsPage";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
searchParams,
}: Readonly<{
searchParams: ContactsSearchParams;
}>) {
return <ContactsPage searchParams={searchParams} isExternalUser={false} />;
return (
<Suspense fallback={<Loading />}>
<ContactsPage searchParams={searchParams} isExternalUser={false} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import OperationReviewFormData from "../../../../../components/operations/OperationReviewFormData";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
params,
}: {
params: { version_id: number };
}) {
return <OperationReviewFormData version_id={params.version_id} />;
return (
<Suspense fallback={<Loading />}>
<OperationReviewFormData version_id={params.version_id} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// 🚩 flagging that for shared routes between roles, "Page" code is a component for code maintainability
import { OperationsSearchParams } from "@reporting/src/app/components/operations/types";
import OperationsPage from "../../../components/routes/operations/Page";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
searchParams,
}: {
searchParams: OperationsSearchParams;
}) {
return <OperationsPage searchParams={searchParams} />;
return (
<Suspense fallback={<Loading />}>
<OperationsPage searchParams={searchParams} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import OperationReviewFormData from "../../../../../components/operations/OperationReviewFormData";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
params,
}: {
params: { version_id: number };
}) {
return <OperationReviewFormData version_id={params.version_id} />;
return (
<Suspense fallback={<Loading />}>
<OperationReviewFormData version_id={params.version_id} />
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// 🚩 flagging that for shared routes between roles, "Page" code is a component for code maintainability
import { OperationsSearchParams } from "@reporting/src/app/components/operations/types";
import OperationsPage from "../../../components/routes/operations/Page";
import { Suspense } from "react";
import Loading from "@bciers/components/loading/SkeletonForm";

export default async function Page({
searchParams,
}: {
searchParams: OperationsSearchParams;
}) {
return <OperationsPage searchParams={searchParams} />;
return (
<Suspense fallback={<Loading />}>
<OperationsPage searchParams={searchParams} />
</Suspense>
);
}

0 comments on commit 568b794

Please sign in to comment.