[OnSalePanel] OnSalePanel css 수정 (2.0 GUI 반영)
Detail Notes : 1. OnSaleProductCard 삭제 (TitemCard 대체) 2. OnSaleProductGrid 구조 변경 및 css 수정
This commit is contained in:
@@ -2,10 +2,11 @@ import React, { useEffect, useState } from "react";
|
|||||||
|
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
|
||||||
|
import TBody from "../../components/TBody/TBody";
|
||||||
|
import TItemCard from "../../components/TItemCard/TItemCard";
|
||||||
import TPanel from "../../components/TPanel/TPanel";
|
import TPanel from "../../components/TPanel/TPanel";
|
||||||
import { getOnSaleInfo } from "../../features/onSale/onSaleSlice";
|
import { getOnSaleInfo } from "../../features/onSale/onSaleSlice";
|
||||||
import CategoryNav from "../OnSalePanel/CategoryNav/CategoryNav";
|
import CategoryNav from "../OnSalePanel/CategoryNav/CategoryNav";
|
||||||
import OnSaleProductCard from "../OnSalePanel/OnSaleProductCard/OnSaleProductCard";
|
|
||||||
import OnSaleProductsGrid from "../OnSalePanel/OnSaleProductsGrid/OnSaleProductsGrid";
|
import OnSaleProductsGrid from "../OnSalePanel/OnSaleProductsGrid/OnSaleProductsGrid";
|
||||||
import css from "./OnSalePanel.module.less";
|
import css from "./OnSalePanel.module.less";
|
||||||
|
|
||||||
@@ -42,11 +43,6 @@ export default function OnSalePanel() {
|
|||||||
}
|
}
|
||||||
}, [currentLgCatCd]);
|
}, [currentLgCatCd]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log(categoryInfos);
|
|
||||||
console.log(saleInfos);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TPanel className={css.container}>
|
<TPanel className={css.container}>
|
||||||
<CategoryNav
|
<CategoryNav
|
||||||
@@ -54,23 +50,27 @@ export default function OnSalePanel() {
|
|||||||
currentLgCatCd={currentLgCatCd}
|
currentLgCatCd={currentLgCatCd}
|
||||||
onCategoryNavClick={handleCategoryNav}
|
onCategoryNavClick={handleCategoryNav}
|
||||||
/>
|
/>
|
||||||
<div className={css.onSaleProducts}>
|
<TBody className={css.tBody}>
|
||||||
{saleInfos &&
|
{saleInfos &&
|
||||||
saleInfos.map(({ saleNm, saleProductInfos }) => {
|
saleInfos.map(({ saleNm, saleProductInfos }) => {
|
||||||
return (
|
return (
|
||||||
<OnSaleProductsGrid key={saleNm} saleNm={saleNm}>
|
<OnSaleProductsGrid key={saleNm} sectionTitle={saleNm}>
|
||||||
{saleProductInfos.map((saleProduct) => {
|
{saleProductInfos.map((saleProduct) => {
|
||||||
return (
|
return (
|
||||||
<OnSaleProductCard
|
<TItemCard
|
||||||
key={saleProduct.prdtId}
|
key={saleProduct.prdtId}
|
||||||
saleProduct={saleProduct}
|
imageAlt={saleProduct.prdtNm}
|
||||||
|
imageSource={saleProduct.imgUrl}
|
||||||
|
priceInfo={saleProduct.priceInfo}
|
||||||
|
productId={saleProduct.prdtId}
|
||||||
|
productName={saleProduct.prdtNm}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</OnSaleProductsGrid>
|
</OnSaleProductsGrid>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</TBody>
|
||||||
</TPanel>
|
</TPanel>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
@import "../../style/utils.module.less";
|
@import "../../style/utils.module.less";
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
.onSaleProducts {
|
background-color: #f2f2f2;
|
||||||
margin-top: 236px;
|
.tBody {
|
||||||
|
height: calc(1080px - 236px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
|
|
||||||
import Spottable from "@enact/spotlight/Spottable";
|
|
||||||
|
|
||||||
import css from "./OnSaleProductCard.module.less";
|
|
||||||
|
|
||||||
const SpottableComponent = Spottable("li");
|
|
||||||
|
|
||||||
export default function OnSaleProductCard({ saleProduct, ...rest }) {
|
|
||||||
const { imgUrl, prdtId, prdtNm, priceInfo } = saleProduct;
|
|
||||||
|
|
||||||
const originalPrice = priceInfo.split("|")[0];
|
|
||||||
const salePrice = priceInfo.split("|")[1];
|
|
||||||
const salePercentage = priceInfo.split("|").reverse()[0];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<SpottableComponent
|
|
||||||
{...rest}
|
|
||||||
className={css.container}
|
|
||||||
spotlightId={prdtId}
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<img src={imgUrl} alt={prdtNm} />
|
|
||||||
{salePercentage && <span>{salePercentage}</span>}
|
|
||||||
</div>
|
|
||||||
<div className={css.test}>
|
|
||||||
<h3>{prdtNm}</h3>
|
|
||||||
<p>
|
|
||||||
{salePrice}
|
|
||||||
<span>{originalPrice}</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</SpottableComponent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
@import "../../../style/CommonStyle.module.less";
|
|
||||||
@import "../../../style/utils.module.less";
|
|
||||||
|
|
||||||
.container {
|
|
||||||
position: relative;
|
|
||||||
.flex(@direction: column);
|
|
||||||
.size(@w: 260px, @h: 375px);
|
|
||||||
margin: 0 10px;
|
|
||||||
border-radius: 10px;
|
|
||||||
background-color: #e3e7ee;
|
|
||||||
|
|
||||||
div:nth-child(1) {
|
|
||||||
position: relative;
|
|
||||||
.size(@w: 260px, @h: 260px);
|
|
||||||
|
|
||||||
img {
|
|
||||||
.size(@w: 260px, @h: 260px);
|
|
||||||
object-fit: cover;
|
|
||||||
border-top-right-radius: 10px;
|
|
||||||
border-top-left-radius: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
> span {
|
|
||||||
.position(@position: absolute, @top: auto, @right: auto, @bottom: 12px, @left: 12px);
|
|
||||||
.size(@w: 44px, @h: 44px);
|
|
||||||
border-radius: 44px;
|
|
||||||
background-color: #c70850;
|
|
||||||
color: #fff;
|
|
||||||
font-family: @baseFontBold;
|
|
||||||
font-size: 20px;
|
|
||||||
line-height: 44px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
div:nth-child(2) {
|
|
||||||
.flex(@direction: column, @alignCenter: flex-start);
|
|
||||||
gap: 10px;
|
|
||||||
padding: 10px 15px;
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
display: -webkit-box;
|
|
||||||
font-family: @baseFontBold;
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 26px;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
word-break: break-all;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
color: #c70850;
|
|
||||||
font-family: @baseFontBold;
|
|
||||||
font-size: 24px;
|
|
||||||
|
|
||||||
span {
|
|
||||||
margin-left: 5px;
|
|
||||||
color: #767676;
|
|
||||||
font-size: 18px;
|
|
||||||
text-decoration: line-through;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: "";
|
|
||||||
.position(@position: absolute, @top: -12px, @right: auto, @bottom: auto, @left: -12px);
|
|
||||||
display: block;
|
|
||||||
.size(@w: 276px, @h: 390px);
|
|
||||||
border: 4px solid transparent;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
background-color: #fcfcfc;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
border: 4px solid #c70850;
|
|
||||||
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0),
|
|
||||||
0px 9px 15px 0 rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"main": "OnSaleProductCard.jsx",
|
|
||||||
"styles": [
|
|
||||||
"OnSaleProductCard.module.less"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react";
|
import Scroller from "@enact/sandstone/Scroller";
|
||||||
|
|
||||||
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
||||||
|
|
||||||
|
import SectionTitle from "../../../components/SectionTitle/SectionTitle";
|
||||||
import css from "./OnSaleProductsGrid.module.less";
|
import css from "./OnSaleProductsGrid.module.less";
|
||||||
|
|
||||||
const Container = SpotlightContainerDecorator(
|
const Container = SpotlightContainerDecorator(
|
||||||
@@ -9,11 +9,19 @@ const Container = SpotlightContainerDecorator(
|
|||||||
"div"
|
"div"
|
||||||
);
|
);
|
||||||
|
|
||||||
export default function OnSaleProductsGrid({ saleNm, children }) {
|
export default function OnSaleProductsGrid({ sectionTitle, children }) {
|
||||||
return (
|
return (
|
||||||
<Container className={css.container}>
|
<Container className={css.container}>
|
||||||
<h2>{saleNm}</h2>
|
<Scroller
|
||||||
<ul>{children}</ul>
|
className={css.scroller}
|
||||||
|
direction="horizontal"
|
||||||
|
horizontalScrollbar="hidden"
|
||||||
|
noScrollByWheel={true}
|
||||||
|
scrollMode="translate"
|
||||||
|
>
|
||||||
|
<SectionTitle title={sectionTitle} />
|
||||||
|
<ul>{children}</ul>
|
||||||
|
</Scroller>
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,19 +2,19 @@
|
|||||||
@import "../../../style/utils.module.less";
|
@import "../../../style/utils.module.less";
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
.flex(@direction:column, @alignCenter:flex-start);
|
position: relative;
|
||||||
gap: 40px;
|
|
||||||
width: 100%;
|
|
||||||
padding: 40px 0 20px 0;
|
|
||||||
|
|
||||||
h2 {
|
.scroller {
|
||||||
margin-left: 60px;
|
padding-left: 60px;
|
||||||
font-family: @baseFontBold;
|
|
||||||
font-size: 38px;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
h2 {
|
||||||
.flex();
|
.position(@position: sticky, @left: 0);
|
||||||
margin-left: 50px;
|
margin: 58px 0 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
.flex(@justifyCenter: flex-start);
|
||||||
|
gap: 18px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user