[TrendingNow] Best Seller 부분 추가
Detail Notes : 1. TrendingNowPanel.js -BestSeller만 우선 추가 2. utils.module.less -elip -> 2줄 정상 작동이 되지 않아 수정처리 3. TItemCard.jsx -rankOrd (랭킹) 추가 4. TItemCard.module.less -스타일 추가 및 정리
This commit is contained in:
@@ -12,6 +12,7 @@ export default function TItemCard({
|
|||||||
imageAlt,
|
imageAlt,
|
||||||
productName,
|
productName,
|
||||||
priceInfo,
|
priceInfo,
|
||||||
|
rankOrd,
|
||||||
...rest
|
...rest
|
||||||
}) {
|
}) {
|
||||||
const parsePriceInfo = (priceInfo) => {
|
const parsePriceInfo = (priceInfo) => {
|
||||||
@@ -41,6 +42,12 @@ export default function TItemCard({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SpottableItemList {...rest} className={css.container}>
|
<SpottableItemList {...rest} className={css.container}>
|
||||||
|
{rankOrd && (
|
||||||
|
<div className={css.rankOrd}>
|
||||||
|
<span>TOP</span>
|
||||||
|
<strong>{rankOrd}</strong>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className={css.imageContainer}>
|
<div className={css.imageContainer}>
|
||||||
<img src={imageSource} alt={imageAlt} />
|
<img src={imageSource} alt={imageAlt} />
|
||||||
{discountRate && (
|
{discountRate && (
|
||||||
|
|||||||
@@ -7,32 +7,55 @@
|
|||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
border: 1px solid @COLOR_GRAY02;
|
border: 1px solid @COLOR_GRAY02;
|
||||||
background-color: @COLOR_WHITE;
|
background-color: @COLOR_WHITE;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
&:focus-within {
|
&:focus-within {
|
||||||
border: 4px solid @PRIMARY_COLOR_RED;
|
border: 4px solid @PRIMARY_COLOR_RED;
|
||||||
|
padding: 15px;
|
||||||
box-shadow: 0 0 50px 0 rgba(0, 0, 0, 0.5);
|
box-shadow: 0 0 50px 0 rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rankOrd {
|
||||||
|
.size(@w:78px, @h:102px);
|
||||||
|
.position(@position: absolute, @top: 0, @left: 18px);
|
||||||
|
.flex(@justifyCenter: space-between, @direction: column);
|
||||||
|
padding: 12px 12px 18px;
|
||||||
|
background: @COLOR_GRAY07;
|
||||||
|
z-index: 2;
|
||||||
|
border-radius: 0 0 50px 50px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: @COLOR_WHITE;
|
||||||
|
> span {
|
||||||
|
.font (@fontFamily:Roboto, @fontSize:24px);
|
||||||
|
}
|
||||||
|
> strong {
|
||||||
|
.font (@fontFamily:Arial, @fontSize:42px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus-within {
|
||||||
|
.rankOrd {
|
||||||
|
top: -3px;
|
||||||
|
left: 15px;
|
||||||
|
background: @PRIMARY_COLOR_RED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.imageContainer {
|
.imageContainer {
|
||||||
width: 288px;
|
.size(@w: 288px, @h: 288px);
|
||||||
height: 288px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
.size(@w: 100%, @h: 100%);
|
||||||
height: 100%;
|
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: center;
|
object-position: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.discountBanner {
|
.discountBanner {
|
||||||
position: absolute;
|
.size(@w: 60px, @h: 60px);
|
||||||
.flex();
|
.flex();
|
||||||
width: 60px;
|
.position(@position: absolute, @bottom: 12px, @right: 12px);
|
||||||
height: 60px;
|
|
||||||
bottom: 12px;
|
|
||||||
right: 12px;
|
|
||||||
background-color: @PRIMARY_COLOR_RED;
|
background-color: @PRIMARY_COLOR_RED;
|
||||||
color: @COLOR_WHITE;
|
color: @COLOR_WHITE;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
@@ -43,29 +66,24 @@
|
|||||||
|
|
||||||
.descContainer {
|
.descContainer {
|
||||||
.productName {
|
.productName {
|
||||||
font-family: @baseFontBold;
|
.font (@fontFamily:@baseFontBold, @fontSize:24px);
|
||||||
font-size: 24px;
|
.elip(@clamp:2);
|
||||||
|
line-height: 1.33;
|
||||||
color: @COLOR_GRAY06;
|
color: @COLOR_GRAY06;
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
margin-top: 14px;
|
margin-top: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.priceInfo {
|
.priceInfo {
|
||||||
margin: 9px 0 12px 0;
|
.font (@fontFamily:@baseFontBold, @fontSize:30px);
|
||||||
font-size: 30px;
|
margin-top: 9px;
|
||||||
font-family: @baseFontBold;
|
|
||||||
color: @PRIMARY_COLOR_RED;
|
color: @PRIMARY_COLOR_RED;
|
||||||
|
line-height: 0.93;
|
||||||
|
|
||||||
.originalPrice {
|
.originalPrice {
|
||||||
font-family: @baseFont;
|
.font (@fontFamily:@baseFont, @fontSize:18px);
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
color: @COLOR_GRAY04;
|
color: @COLOR_GRAY04;
|
||||||
font-size: 18px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,9 @@
|
|||||||
.elip(@clamp) {
|
.elip(@clamp) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
// -webkit-box-orient: vertical;
|
word-break: break-word;
|
||||||
// display: -webkit-box;
|
display: -webkit-box;
|
||||||
white-space: nowrap;
|
-webkit-box-orient: vertical;
|
||||||
-webkit-line-clamp: @clamp;
|
-webkit-line-clamp: @clamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,40 @@
|
|||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import SectionTitle from "../../components/SectionTitle/SectionTitle";
|
||||||
import TPanel from "../../components/TPanel/TPanel";
|
import TPanel from "../../components/TPanel/TPanel";
|
||||||
|
import css from "./TrendingNowPanel.module.less";
|
||||||
|
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
||||||
|
import TGrid from "../../components/TGrid/TGrid";
|
||||||
|
import TItemCard from "../../components/TItemCard/TItemCard";
|
||||||
|
import { $L } from "../../utils/helperMethods";
|
||||||
|
|
||||||
|
const Container = SpotlightContainerDecorator(
|
||||||
|
{ enterTo: "last-focused" },
|
||||||
|
"div"
|
||||||
|
);
|
||||||
|
|
||||||
export default function TrendingNowPanel() {
|
export default function TrendingNowPanel() {
|
||||||
return <TPanel>Trending Now</TPanel>;
|
const bestSellerDatas = useSelector(
|
||||||
|
(state) => state.product.bestSellerData.bestSeller
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TPanel>
|
||||||
|
<Container className={css.container}>
|
||||||
|
<SectionTitle title={$L(`BEST SELLER`)} />
|
||||||
|
<TGrid>
|
||||||
|
{bestSellerDatas &&
|
||||||
|
bestSellerDatas.map((bestSeller) => (
|
||||||
|
<TItemCard
|
||||||
|
key={bestSeller.rankOrd}
|
||||||
|
imageSource={bestSeller.imgUrl}
|
||||||
|
imageAlt={bestSeller.prdtNm}
|
||||||
|
productName={bestSeller.prdtNm}
|
||||||
|
priceInfo={bestSeller.priceInfo}
|
||||||
|
rankOrd={bestSeller.rankOrd}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</TGrid>
|
||||||
|
</Container>
|
||||||
|
</TPanel>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
@import "../../style/CommonStyle.module.less";
|
||||||
|
@import "../../style/utils.module.less";
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding: 60px;
|
||||||
|
> ul {
|
||||||
|
margin-top: 35px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user