[상품 상세]
- price 파트너사 붙는쪽에 nbcu일 경우 peacoke | ******* 로 들어오는 부분때문에 변경.
This commit is contained in:
@@ -9,6 +9,12 @@ import usePriceInfo from '../../../../../hooks/usePriceInfo';
|
||||
import { $L } from '../../../../../utils/helperMethods';
|
||||
import css from './ShopByMobilePriceDisplay.module.less';
|
||||
|
||||
// 파트너명에서 "Peacock | Shop The Moment" 형식일 때 "Peacock"만 추출
|
||||
const extractPartnerName = (name) => {
|
||||
if (!name) return name;
|
||||
return name.includes(' | ') ? name.split(' | ')[0].trim() : name;
|
||||
};
|
||||
|
||||
export default function ShopByMobilePriceDisplay({
|
||||
priceData,
|
||||
priceInfo,
|
||||
@@ -26,6 +32,10 @@ export default function ShopByMobilePriceDisplay({
|
||||
orderPhnNo,
|
||||
} = priceData;
|
||||
|
||||
// 파트너명 정규화
|
||||
const cleanPatncNm = useMemo(() => extractPartnerName(patncNm), [patncNm]);
|
||||
const cleanPatnrName = useMemo(() => extractPartnerName(patnrName), [patnrName]);
|
||||
|
||||
const {
|
||||
discountRate,
|
||||
rewardFlag,
|
||||
@@ -50,6 +60,8 @@ export default function ShopByMobilePriceDisplay({
|
||||
[isOriginalPriceEmpty, isDiscountedPriceEmpty, price5, offerInfo]
|
||||
);
|
||||
|
||||
|
||||
|
||||
const renderPriceItem = useCallback(() => {
|
||||
if (priceData && !promotionCode) {
|
||||
if (rewd) {
|
||||
@@ -57,9 +69,9 @@ export default function ShopByMobilePriceDisplay({
|
||||
<div className={css.wrapper}>
|
||||
<div className={css.rewdTopLayer}>
|
||||
<span>
|
||||
{patncNm
|
||||
? patncNm + " " + $L("Price") + " "
|
||||
: patnrName + " " + $L("Price") + " "}
|
||||
{cleanPatncNm
|
||||
? cleanPatncNm + " " + $L("Price") + " "
|
||||
: cleanPatnrName + " " + $L("Price") + " "}
|
||||
</span>
|
||||
<span className={css.partnerPrc}>
|
||||
{TYPE_CASE.case5 || TYPE_CASE.case8
|
||||
@@ -95,9 +107,9 @@ export default function ShopByMobilePriceDisplay({
|
||||
return (
|
||||
<div className={css.wrapper}>
|
||||
<span className={css.name}>
|
||||
{patncNm
|
||||
? patncNm + " " + $L("Price")
|
||||
: patnrName + " " + $L("Price")}
|
||||
{cleanPatncNm
|
||||
? cleanPatncNm + " " + $L("Price")
|
||||
: cleanPatnrName + " " + $L("Price")}
|
||||
</span>
|
||||
<div className={css.btmLayer}>
|
||||
<span className={classNames(css.price, css.case01)}>
|
||||
@@ -111,9 +123,9 @@ export default function ShopByMobilePriceDisplay({
|
||||
<div className={css.wrapper}>
|
||||
<div className={css.topLayer}>
|
||||
<span className={css.name}>
|
||||
{patncNm
|
||||
? patncNm + " " + $L("Price")
|
||||
: patnrName + $L("Price")}
|
||||
{cleanPatncNm
|
||||
? cleanPatncNm + " " + $L("Price")
|
||||
: cleanPatnrName + $L("Price")}
|
||||
</span>
|
||||
</div>
|
||||
{discountRate && Number(discountRate.replace("%", "")) > 4 && (
|
||||
@@ -140,9 +152,9 @@ export default function ShopByMobilePriceDisplay({
|
||||
<div className={css.wrapper}>
|
||||
<div className={css.topLayer}>
|
||||
<span className={css.name}>
|
||||
{patncNm
|
||||
? patncNm + " " + $L("Price")
|
||||
: patnrName + " " + $L("Price")}
|
||||
{cleanPatncNm
|
||||
? cleanPatncNm + " " + $L("Price")
|
||||
: cleanPatnrName + " " + $L("Price")}
|
||||
</span>
|
||||
</div>
|
||||
{discountRate && Number(discountRate.replace("%", "")) > 4 && (
|
||||
@@ -194,7 +206,7 @@ export default function ShopByMobilePriceDisplay({
|
||||
return (
|
||||
<div className={css.wrapper}>
|
||||
<span className={css.partnerName}>
|
||||
{patncNm ? patncNm + " " + $L("Price") : patnrName + $L("Price")}
|
||||
{cleanPatncNm ? cleanPatncNm + " " + $L("Price") : cleanPatnrName + $L("Price")}
|
||||
</span>
|
||||
<span
|
||||
className={css.offerInfo}
|
||||
@@ -204,7 +216,8 @@ export default function ShopByMobilePriceDisplay({
|
||||
);
|
||||
}
|
||||
}, [
|
||||
patnrName,
|
||||
cleanPatnrName,
|
||||
cleanPatncNm,
|
||||
priceInfo,
|
||||
isOriginalPriceEmpty,
|
||||
isDiscountedPriceEmpty,
|
||||
|
||||
Reference in New Issue
Block a user