[DetailPanel] mobileSendPopUp productImg ProductNm 분기처리
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
|
||||
@@ -188,6 +194,22 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
}
|
||||
}, [productData, themeProductInfos, selectedIndex, panelInfo]);
|
||||
|
||||
const mobileSendPopUpProductImg = useMemo(() => {
|
||||
if (type === "theme" && themeProductInfos) {
|
||||
return themeProductInfos[selectedIndex]?.imgUrls600[0];
|
||||
} else {
|
||||
return productData?.imgUrls600[0];
|
||||
}
|
||||
}, [themeProductInfos, selectedIndex, productData, type]);
|
||||
|
||||
const mobileSendPopUpSubtitle = useMemo(() => {
|
||||
if (type === "theme") {
|
||||
return themeProductInfos[selectedIndex]?.prdtNm;
|
||||
} else {
|
||||
return productData?.prdtNm;
|
||||
}
|
||||
}, [themeProductInfos, selectedIndex, productData, type]);
|
||||
|
||||
useEffect(() => {
|
||||
getlgCatCd();
|
||||
}, [themeProductInfos, productData, panelInfo, selectedIndex]);
|
||||
@@ -320,8 +342,8 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
open={popupVisible}
|
||||
onClose={handleSMSonClose}
|
||||
title={$L("Send a Payment link for this item via SMS")}
|
||||
subTitle={productData?.prdtNm}
|
||||
productImg={productData?.imgUrls600[0]}
|
||||
subTitle={mobileSendPopUpSubtitle}
|
||||
productImg={mobileSendPopUpProductImg}
|
||||
patnrId={patnrId}
|
||||
prdtId={prdtId}
|
||||
smsTpCd={"APP00201"}
|
||||
|
||||
Reference in New Issue
Block a user