[SHOPTIME-3655] Search / Result / No Result / Best Seller / undefiend 발화됨

[수정사항] 기존 priceLabel에서 offerInfo가 없는경우에 undefined로 발화를 하여 offerInfo가 없는 경우에도 빈 문자열 조건 추가
This commit is contained in:
고동영
2025-02-25 15:34:48 +09:00
parent 6fed35e4f8
commit 721ca75fd4

View File

@@ -106,6 +106,7 @@ export default memo(function TItemCard({
[onClick, disabled]
);
const _onFocus = useCallback(() => {
console.log("#priceLabel", priceLabel);
if (onFocus) {
onFocus();
}
@@ -123,11 +124,14 @@ export default memo(function TItemCard({
? "Sale price " + discountedPrice + ", "
: "";
const priceLabel = originalPrice
? parseFloat(originalPrice.replace("$", "")) === 0
? " " + offerInfo
: " Original price " + originalPrice + ", "
: "";
const priceLabel =
originalPrice && parseFloat(originalPrice.replace("$", "")) === 0
? offerInfo
? " " + offerInfo
: ""
: originalPrice
? " Original price " + originalPrice + ", "
: "";
const lastLabeltext = lastLabel ? lastLabel : "";
const firstLabeltext = firstLabel ? firstLabel + " " : "";
const soldOutText = soldoutFlag === "Y" ? "Sold Out " : "";