[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]
|
||||
);
|
||||
|
||||
// ProductDescription 데이터 유무 확인
|
||||
const hasProductDescription = useMemo(() => {
|
||||
return !!productData?.prdtDesc;
|
||||
}, [productData?.prdtDesc]);
|
||||
|
||||
// 🆕 [251211] patnrId=21인 경우 QR 데이터 확인
|
||||
useEffect(() => {
|
||||
if (productData?.patnrId === 21 || productData?.patnrId === '21') {
|
||||
@@ -1336,6 +1341,9 @@ export default function ProductAllSection({
|
||||
);
|
||||
|
||||
const handleProductDetailsClick = useCallback(() => {
|
||||
// 제품 설명 데이터가 없을 때 클릭 방지
|
||||
if (!hasProductDescription) return;
|
||||
|
||||
dispatch(minimizeModalMedia());
|
||||
scrollToSection('scroll-marker-product-details');
|
||||
|
||||
@@ -1344,7 +1352,7 @@ export default function ProductAllSection({
|
||||
setTimeout(() => {
|
||||
Spotlight.focus('product-description-content');
|
||||
}, 100);
|
||||
}, [scrollToSection, dispatch, handleIndicatorOptions]);
|
||||
}, [scrollToSection, dispatch, handleIndicatorOptions, hasProductDescription]);
|
||||
|
||||
const handleYouMayAlsoLikeClick = useCallback(() => {
|
||||
dispatch(minimizeModalMedia());
|
||||
@@ -1961,16 +1969,18 @@ export default function ProductAllSection({
|
||||
className={css.actionButtonsWrapper}
|
||||
spotlightId="product-info-button-container"
|
||||
>
|
||||
<TButton
|
||||
className={classNames(
|
||||
css.productDetailsButton,
|
||||
activeButton === 'product' ? css.active : ''
|
||||
)}
|
||||
onClick={handleProductDetailsClick}
|
||||
spotlightId="product-details-button"
|
||||
>
|
||||
{$L('PRODUCT DETAILS')}
|
||||
</TButton>
|
||||
{hasProductDescription && (
|
||||
<TButton
|
||||
className={classNames(
|
||||
css.productDetailsButton,
|
||||
activeButton === 'product' ? css.active : ''
|
||||
)}
|
||||
onClick={handleProductDetailsClick}
|
||||
spotlightId="product-details-button"
|
||||
>
|
||||
{$L('PRODUCT DETAILS')}
|
||||
</TButton>
|
||||
)}
|
||||
{isReviewDataComplete && (
|
||||
<>
|
||||
{/*
|
||||
|
||||
Reference in New Issue
Block a user