Components/TItemCard
-금액 노출부분 수정하였습니다.
This commit is contained in:
@@ -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 && (
|
||||
|
||||
Reference in New Issue
Block a user