Skip to content

Commit

Permalink
fix: 배너 스켈레톤 구현 #111
Browse files Browse the repository at this point in the history
#preview
  • Loading branch information
1119wj committed Dec 5, 2024
1 parent d223ea2 commit 4a367cc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
32 changes: 18 additions & 14 deletions frontend/src/components/Banner/BannerSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,24 @@ const BannerSlider: React.FC<BannerSliderProps> = ({

return (
<div className={className}>
<Slider {...settings} className="h-full w-full">
{banners.map((banner, index) => (
<div key={index} className="cursor-pointer">
<img
className="box-sizing:border-box h-full w-full rounded-md border-[1.5px] border-c_border_gray"
src={banner.imageUrl}
alt={`Banner ${index}`}
onMouseDown={handleMouseDown}
onMouseUp={handleMouseUp}
onClick={() => handleClick(banner.redirectUrl)}
/>
</div>
))}
</Slider>
{banners.length > 0 ? (
<Slider {...settings} className="h-full w-full">
{banners.map((banner, index) => (
<div key={index} className="cursor-pointer">
<img
className="box-sizing:border-box h-full w-full rounded-md border-[1.5px] border-c_border_gray"
src={banner.imageUrl}
alt={`Banner ${index}`}
onMouseDown={handleMouseDown}
onMouseUp={handleMouseUp}
onClick={() => handleClick(banner.redirectUrl)}
/>
</div>
))}
</Slider>
) : (
<div className="h-96 w-full animate-pulse rounded-md border-[1.5px] bg-c_textarea_gray"></div>
)}
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ImageSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react';
import { useState, useEffect } from 'react';

type ImageWithSkeletonProps = {
src: string;
Expand Down

0 comments on commit 4a367cc

Please sign in to comment.