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