Skip to content

Commit

Permalink
feat: recommendList skeleton 컴포넌트 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
bottlewook committed Mar 3, 2024
1 parent 9de333d commit 8d6ebfc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/components/shared/carousel/RecommendListContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
import React from 'react';

import useRecommendProducts from '@remote/queries/home/useRecommendProducts';
import Skeleton from '@shared/skeleton/Skeleton';

import RecommendList from './RecommendList';

function RecommendListContainer() {
const { data: recommendProductsData } = useRecommendProducts();
const { data: recommendProductsData, isLoading } = useRecommendProducts();

if (isLoading) {
return <Skeleton width="100%" height="172px" />;
}

return (
<RecommendList recommendProductsData={recommendProductsData!} />
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/shared/skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import styles from './Skeleton.module.scss';
const cx = classNames.bind(styles);

interface SkeletonProps {
width: number
height: number
width: number | string
height: number | string
}

function Skeleton({ width, height }: SkeletonProps) {
Expand Down

0 comments on commit 8d6ebfc

Please sign in to comment.