Components/TItemCard

-금액 노출부분 수정하였습니다.
This commit is contained in:
junghoon86.park
2024-01-31 11:01:09 +09:00
parent 3ed3b57fe4
commit 1351f6d6d9

View File

@@ -15,7 +15,7 @@ const TYPE_HORIZONTAL = "horizontal";
const SOLD_OUT_STRING = "SOLD OUT"; const SOLD_OUT_STRING = "SOLD OUT";
const TOP_STRING = "TOP"; const TOP_STRING = "TOP";
export default memo(function ProductCard({ export default memo(function TItemCard({
children, children,
imageAlt, imageAlt,
imageSource, imageSource,
@@ -27,8 +27,6 @@ export default memo(function ProductCard({
rank, rank,
soldoutFlag, soldoutFlag,
type = TYPE_VERTICAL, type = TYPE_VERTICAL,
accType = false,
offerInfo,
...rest ...rest
}) { }) {
const handleClick = useCallback( const handleClick = useCallback(
@@ -46,9 +44,7 @@ export default memo(function ProductCard({
.map((item) => item.trim()); .map((item) => item.trim());
let originalPrice, discountedPrice, discountRate; let originalPrice, discountedPrice, discountRate;
if (priceParts.length === 5) { if (priceParts.length === 4) {
[originalPrice, discountedPrice, , discountRate] = priceParts;
} else if (priceParts.length === 4) {
[originalPrice, discountedPrice, , discountRate] = priceParts; [originalPrice, discountedPrice, , discountRate] = priceParts;
} else if (priceParts.length === 2) { } else if (priceParts.length === 2) {
[originalPrice, discountedPrice] = priceParts; [originalPrice, discountedPrice] = priceParts;
@@ -84,14 +80,8 @@ export default memo(function ProductCard({
<div> <div>
<h3>{productName}</h3> <h3>{productName}</h3>
<p> <p>
{offerInfo != "" {discountRate ? discountedPrice : originalPrice}
? offerInfo {discountRate && <span>{originalPrice}</span>}
: discountRate
? discountedPrice
: originalPrice}
{discountRate && (
<span>{accType ? originalPrice : discountRate}</span>
)}
</p> </p>
</div> </div>
{isBestSeller && rank && ( {isBestSeller && rank && (