[251217] fix: ProductAllSection PRODUCT DETAIL버튼 조건부 렌더링
🕐 커밋 시간: 2025. 12. 17. 08:58:40 📊 변경 통계: • 총 파일: 1개 • 추가: +21줄 • 삭제: -11줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx 🔧 주요 변경 내용: • 소규모 기능 개선 • 코드 정리 및 최적화
This commit is contained in:
@@ -584,6 +584,11 @@ export default function ProductAllSection({
|
|||||||
[productType, themeProductInfo, themeProducts, selectedIndex, productInfo]
|
[productType, themeProductInfo, themeProducts, selectedIndex, productInfo]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// ProductDescription 데이터 유무 확인
|
||||||
|
const hasProductDescription = useMemo(() => {
|
||||||
|
return !!productData?.prdtDesc;
|
||||||
|
}, [productData?.prdtDesc]);
|
||||||
|
|
||||||
// 🆕 [251211] patnrId=21인 경우 QR 데이터 확인
|
// 🆕 [251211] patnrId=21인 경우 QR 데이터 확인
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (productData?.patnrId === 21 || productData?.patnrId === '21') {
|
if (productData?.patnrId === 21 || productData?.patnrId === '21') {
|
||||||
@@ -1336,6 +1341,9 @@ export default function ProductAllSection({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleProductDetailsClick = useCallback(() => {
|
const handleProductDetailsClick = useCallback(() => {
|
||||||
|
// 제품 설명 데이터가 없을 때 클릭 방지
|
||||||
|
if (!hasProductDescription) return;
|
||||||
|
|
||||||
dispatch(minimizeModalMedia());
|
dispatch(minimizeModalMedia());
|
||||||
scrollToSection('scroll-marker-product-details');
|
scrollToSection('scroll-marker-product-details');
|
||||||
|
|
||||||
@@ -1344,7 +1352,7 @@ export default function ProductAllSection({
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Spotlight.focus('product-description-content');
|
Spotlight.focus('product-description-content');
|
||||||
}, 100);
|
}, 100);
|
||||||
}, [scrollToSection, dispatch, handleIndicatorOptions]);
|
}, [scrollToSection, dispatch, handleIndicatorOptions, hasProductDescription]);
|
||||||
|
|
||||||
const handleYouMayAlsoLikeClick = useCallback(() => {
|
const handleYouMayAlsoLikeClick = useCallback(() => {
|
||||||
dispatch(minimizeModalMedia());
|
dispatch(minimizeModalMedia());
|
||||||
@@ -1961,16 +1969,18 @@ export default function ProductAllSection({
|
|||||||
className={css.actionButtonsWrapper}
|
className={css.actionButtonsWrapper}
|
||||||
spotlightId="product-info-button-container"
|
spotlightId="product-info-button-container"
|
||||||
>
|
>
|
||||||
<TButton
|
{hasProductDescription && (
|
||||||
className={classNames(
|
<TButton
|
||||||
css.productDetailsButton,
|
className={classNames(
|
||||||
activeButton === 'product' ? css.active : ''
|
css.productDetailsButton,
|
||||||
)}
|
activeButton === 'product' ? css.active : ''
|
||||||
onClick={handleProductDetailsClick}
|
)}
|
||||||
spotlightId="product-details-button"
|
onClick={handleProductDetailsClick}
|
||||||
>
|
spotlightId="product-details-button"
|
||||||
{$L('PRODUCT DETAILS')}
|
>
|
||||||
</TButton>
|
{$L('PRODUCT DETAILS')}
|
||||||
|
</TButton>
|
||||||
|
)}
|
||||||
{isReviewDataComplete && (
|
{isReviewDataComplete && (
|
||||||
<>
|
<>
|
||||||
{/*
|
{/*
|
||||||
|
|||||||
Reference in New Issue
Block a user