-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Loading skeleton added on explore page
- Loading branch information
1 parent
75581b3
commit d9439f0
Showing
5 changed files
with
90 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react"; | ||
import Toolbar from "@/components/filters/toolbar"; | ||
import { container } from "@/components/primitives"; | ||
import { FiltersProvider } from "@/contexts/filters"; | ||
import { decodingSlug } from "@/utils/url"; | ||
|
||
export default function ExploreLayout({ | ||
children, | ||
params, | ||
}: { | ||
children: React.ReactNode; | ||
params: { slug: string }; | ||
}) { | ||
const filters = decodingSlug(params.slug); | ||
return ( | ||
<FiltersProvider initialFilters={filters}> | ||
<div className="flex flex-col"> | ||
<Toolbar /> | ||
<section className={container()}>{children}</section> | ||
</div> | ||
</FiltersProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import TableSkeleton from "@/components/table/skeleton"; | ||
|
||
export default function ExploreLoading() { | ||
return <TableSkeleton />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
"use client"; | ||
import React from "react"; | ||
import { Skeleton } from "@nextui-org/skeleton"; | ||
import { | ||
Table as NuiTable, | ||
TableHeader, | ||
TableBody, | ||
TableColumn, | ||
TableRow, | ||
TableCell, | ||
} from "@nextui-org/table"; | ||
|
||
export const TableSkeleton = () => { | ||
const placeholderItems = Array.from({ length: 25 }, (_, index) => ({ | ||
id: index + 1, | ||
})); | ||
|
||
return ( | ||
<> | ||
<NuiTable | ||
layout="fixed" | ||
hideHeader | ||
fullWidth | ||
aria-label="Table skeleton" | ||
classNames={{ | ||
table: | ||
"w-full bg-gradient-to-r from-background to-background-200 to-80% max-w-7xl border-spacing-0 rounded-b-md overflow-hidden", | ||
wrapper: | ||
"bg-background overflow-visible p-0 rounded-none border-small rounded-b-md", | ||
tr: "relative bg-red border-y-small border-y-overlay before:content-[''] before:absolute before:bg-hover-overlay before:opacity-0 before:w-full before:h-full before:transition-opacity before:duration-300 before:ease-in-out sm:before:max-h-[88px] md:before:max-h-[62px] hover:before:opacity-100", | ||
td: "px-2 sm:px-inherit", | ||
}} | ||
> | ||
<TableHeader> | ||
<TableColumn>Skeleton</TableColumn> | ||
</TableHeader> | ||
<TableBody items={placeholderItems}> | ||
{(item) => ( | ||
<TableRow key={item.id}> | ||
<TableCell className="w-full"> | ||
<Skeleton className="w-full rounded-lg"> | ||
<div className="h-12 w-full rounded-lg bg-default-200"></div> | ||
</Skeleton> | ||
</TableCell> | ||
</TableRow> | ||
)} | ||
</TableBody> | ||
</NuiTable> | ||
</> | ||
); | ||
}; | ||
|
||
export default TableSkeleton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters