[TItemCard]

Detail Notes :
 
1. 가격이 0 일때 offerInfo 출력 되도록 처리
2. CustomImage 사용시 이미지를 불러오지 못할 경우 defaultImg 출력되도록 처리
This commit is contained in:
jangheon Pyo
2024-04-22 09:45:42 +09:00
parent 112b8b4db7
commit 4a1575139b
2 changed files with 24 additions and 3 deletions

View File

@@ -133,8 +133,13 @@ export default memo(function TItemCard({
alt={imageAlt}
delay={0}
src={defaultImage ? defaultImage : imageSource}
onError={addDefaultImg}
// src={imageSource}
fallbackSrc={
type === "videoShow"
? imgType === IMAGETYPES.imgHorizontal
? defaultimgHorizontal
: defaultimgVertical
: defaultImageItem
}
/>
{priceInfo &&
discountRate &&
@@ -156,7 +161,13 @@ export default memo(function TItemCard({
{catNm !== null && <h4 className={css.hstmNmTitle}>{catNm}</h4>}
{priceInfo ? (
<p className={css.priceInfo}>
{discountRate ? discountedPrice : originalPrice}
{parseFloat(originalPrice.replace("$", "")) === 0 ? (
<strong>{offerInfo}</strong>
) : discountRate ? (
discountedPrice
) : (
originalPrice
)}
{discountRate && <span>{originalPrice}</span>}
</p>
) : (

View File

@@ -81,6 +81,11 @@
color: @COLOR_GRAY04;
text-decoration: line-through;
}
> strong {
overflow: hidden;
.elip(@clamp:1);
word-break: break-all;
}
}
}
}
@@ -177,6 +182,11 @@
color: @COLOR_GRAY04;
text-decoration: line-through;
}
> strong {
overflow: hidden;
.elip(@clamp:1);
word-break: break-all;
}
}
}
}