Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions apps/web/src/app/(companies-list)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import CompaniesHeader from "@/components/CompaniesHeader";
import { CompaniesListSkeleton } from "@/components/CompaniesListSkeleton";
import Footer from "@/components/Footer";
import { Skeleton } from "@/components/ui/skeleton";
import { LayoutProps } from "@/lib/types";
Expand All @@ -24,11 +25,7 @@ const AppLoading = () => {
<div className="flex h-fit shrink-0 flex-col gap-4 md:flex-col-reverse">
<Skeleton className="h-52 w-full rounded-md md:w-60" />
</div>
<div className="flex-1 space-y-4">
<Skeleton className="h-36 w-full rounded-md" />
<Skeleton className="h-36 w-full rounded-md" />
<Skeleton className="h-36 w-full rounded-md" />
</div>
<CompaniesListSkeleton />
</div>
);
};
2 changes: 1 addition & 1 deletion apps/web/src/app/category/[category]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Suspense } from "react";
export default function CategoryPageLayout({ children }: LayoutProps) {
return (
<>
<Suspense fallback={<div>Loading...</div>}>{children}</Suspense>
{children}
<Footer />
</>
);
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/app/category/[category]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Breadcrumb } from "@/components/Breadcrumb";
import CompaniesList from "@/components/CompaniesList";
import { CompaniesListSkeleton } from "@/components/CompaniesListSkeleton";
import {
APP_URL,
defaultMetadata,
Expand Down Expand Up @@ -83,7 +84,7 @@ export default async function CategoryPage({
]}
/>
<h1 className="text-2xl font-bold">{category} Companies</h1>
<Suspense>
<Suspense fallback={<CompaniesListSkeleton />}>
<CompaniesList
allCompanies={filteredCompanies}
updatedAtISODate={updatedAtISODate}
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/app/location/[location]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import Footer from "@/components/Footer";
import { Skeleton } from "@/components/ui/skeleton";
import { LayoutProps } from "@/lib/types";
import { Suspense } from "react";

export default function LocationPageLayout({ children }: LayoutProps) {
return (
<>
<Suspense fallback={<div>Loading...</div>}>{children}</Suspense>
{children}
<Footer />
</>
);
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/app/location/[location]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Breadcrumb } from "@/components/Breadcrumb";
import CompaniesList from "@/components/CompaniesList";
import { CompaniesListSkeleton } from "@/components/CompaniesListSkeleton";
import {
APP_URL,
defaultMetadata,
Expand Down Expand Up @@ -84,7 +85,7 @@ export default async function LocationPage({
/>
<h1 className="text-2xl font-bold">Companies in {location}</h1>

<Suspense>
<Suspense fallback={<CompaniesListSkeleton />}>
<CompaniesList
allCompanies={filteredCompanies}
updatedAtISODate={updatedAtISODate}
Expand Down
11 changes: 11 additions & 0 deletions apps/web/src/components/CompaniesListSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Skeleton } from "./ui/skeleton";

export const CompaniesListSkeleton = () => {
return (
<div className="flex-1 space-y-4">
<Skeleton className="h-36 w-full rounded-md" />
<Skeleton className="h-36 w-full rounded-md" />
<Skeleton className="h-36 w-full rounded-md" />
</div>
);
};