Skip to content

Commit

Permalink
With skeleton loader timed in
Browse files Browse the repository at this point in the history
  • Loading branch information
7emansell committed Nov 13, 2024
1 parent 13e46de commit 15aa47b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/src/components/lane/laneLoading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function LaneLoading({ withTitle = true }) {
<SkeletonLoader contentSize={0} showImage={false} headingSize={1} />
</Flex>
)}
<DCSimpleGrid>
<DCSimpleGrid marginTop="s">
<SkeletonLoader imageAspectRatio="landscape" contentSize={1} />
<SkeletonLoader imageAspectRatio="landscape" contentSize={1} />
<SkeletonLoader imageAspectRatio="landscape" contentSize={1} />
Expand Down
18 changes: 9 additions & 9 deletions app/src/components/pages/divisionPage/divisionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ export default function DivisionPage({ data }: any) {
Number(queryParams.get("page")) || 1
);

const { replace } = useRouter();

const { isLargerThanLargeTablet } = useBreakpoints();
const { push } = useRouter();

const totalPages = totalNumPages(data.numFound, data.perPage);

Expand All @@ -49,8 +47,12 @@ export default function DivisionPage({ data }: any) {
params.set("page", pageNumber.toString());
setCurrentPage(pageNumber);
const url = `${pathname}?${params.toString()}#${data.slug}`;
replace(url);
headingRef.current?.focus;
setIsLoaded(false);
setTimeout(() => {
setIsLoaded(true);
push(url);
headingRef.current?.focus;
}, 1500);
};

useEffect(() => {
Expand Down Expand Up @@ -123,11 +125,9 @@ export default function DivisionPage({ data }: any) {
{isLoaded ? (
<CardsGrid records={data.collections} />
) : (
<>
<LaneLoading withTitle={false} />
<LaneLoading withTitle={false} />
Array(Math.ceil(data.collections / 4)).fill(
<LaneLoading withTitle={false} />
</>
)
)}
{totalPages > 1 && (
<Pagination
Expand Down

0 comments on commit 15aa47b

Please sign in to comment.