Skip to content

Commit

Permalink
skeletons
Browse files Browse the repository at this point in the history
  • Loading branch information
Przemek committed Feb 16, 2024
1 parent 76fd5d6 commit c9dffec
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions src/components/skeletons/CourseCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,35 @@ export const CourseCardSkeleton: React.FC<Props> = ({
count = 1,
colProps,
}) => {
return Array.from({ length: count }).map(() =>
colProps ? (
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
<Col key={`card-skeleton-${useId()}`} {...colProps}>
<CardSkeleton>
<Skeleton
height="264px"
borderRadius={14}
style={{ marginBottom: "10px" }}
/>
<Skeleton width={146} style={{ marginBottom: "10px" }} />
<Skeleton count={2} />
</CardSkeleton>
</Col>
) : (
<CardSkeleton key={`card-skeleton-${useId()}`}>
<Skeleton
height="264px"
borderRadius={14}
style={{ marginBottom: "10px" }}
/>
<Skeleton width={146} style={{ marginBottom: "10px" }} />
<Skeleton count={2} />
</CardSkeleton>
)
return (
<>
{Array.from({ length: count }).map((_, index) =>
colProps ? (
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
<Col key={`card-skeleton-${index}`} {...colProps}>
<CardSkeleton>
<Skeleton
height="264px"
borderRadius={14}
style={{ marginBottom: "10px" }}
/>
<Skeleton width={146} style={{ marginBottom: "10px" }} />
<Skeleton count={2} />
</CardSkeleton>
</Col>
) : (
<CardSkeleton key={`card-skeleton-${index}`}>
<Skeleton
height="264px"
borderRadius={14}
style={{ marginBottom: "10px" }}
/>
<Skeleton width={146} style={{ marginBottom: "10px" }} />
<Skeleton count={2} />
</CardSkeleton>
)
)}
</>
);
};

0 comments on commit c9dffec

Please sign in to comment.