Skip to content

Commit

Permalink
design: 추천 상품 목록 디자인 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
bottlewook committed Mar 5, 2024
1 parent a12cf4f commit eac23af
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 45 deletions.
43 changes: 8 additions & 35 deletions src/components/shared/carousel/RecommendList.scss
Original file line number Diff line number Diff line change
@@ -1,37 +1,10 @@
/* stylelint-disable selector-class-pattern */

.recommend-slide {
.slick-list {
box-sizing: border-box;
padding: 0 var(--default-padding);

.slick-track {
.slick-slide {
width: 85px !important;
margin-right: 8px;

& > div {
a {
box-sizing: border-box;
text-align: center;

.img-container {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 85px;
margin: 0 auto 3px;
border-radius: 16px;
background-color: #eff9ff;

img {
vertical-align: top;
}
}
}
}
}
}
.imageContainer {
display: flex !important;
flex-direction: column !important;
align-items: center !important;
text-align: center;

span {
width: 85px;
}
}
22 changes: 12 additions & 10 deletions src/components/shared/carousel/RecommendList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import Link from 'next/link';
import { RecommendProductsType } from '@remote/api/types/home';
import Text from '@shared/text/Text';

import Spacing from '../spacing/Spacing';

const settings = {
infinite: true,
slidesToShow: 4,
Expand All @@ -19,6 +21,7 @@ const settings = {
arrows: false,
speed: 2000,
autoplaySpeed: 5000,
swipeToSlide: true,
};

// eslint-disable-next-line max-len
Expand All @@ -29,16 +32,15 @@ function RecommendList({ recommendProductsData }: { recommendProductsData: Recom
<Slider {...settings} className="recommend-slide">
{recommendList?.map((slide) => {
return (
<Link href={`/product/${slide.productNo.toString()}`} key={slide.productNo}>
<div className="img-container">
<Image
// src={slide.imageSource}
src={slide.item === '코팅제' ? '/assets/코팅제.webp' : '/assets/세정제.webp'}
alt={slide.alt}
width={60}
height={60}
/>
</div>
<Link href={`/product/${slide.productNo.toString()}`} key={slide.productNo} className="imageContainer">
<Image
// src={slide.imageSource}
src={slide.item === '코팅제' ? '/assets/코팅제.webp' : '/assets/세정제.webp'}
alt={slide.alt}
width={85}
height={85}
/>
<Spacing size={4} />
<Text color="gray800" typography="t7" className="ellipsis" css={{ height: '35px' }}>{slide.productName}</Text>
</Link>
);
Expand Down

0 comments on commit eac23af

Please sign in to comment.