[디테일 수정]

- 현재 매직마우스로는 팝업및 노출 정상적으로 가능하지만 4방향키 수정진행해야함.
 - 토스트가 유지가 안됌에 따른 수정이 더 필요함.
This commit is contained in:
junghoon86.park
2025-11-21 18:22:07 +09:00
parent 1f7020b28b
commit 8cce06bcc3
5 changed files with 80 additions and 22 deletions

View File

@@ -639,7 +639,8 @@ const BuyOption = ({
Spotlight.focus('buy-option-buy-now-button');
}
const handleBuyNowClick = useCallback(() => {
const handleBuyNowClick = useCallback((e) => {
e.stopPropagation()
console.log('%c🔥🔥🔥 BUY NOW CLICKED! FUNCTION CALLED! 🔥🔥🔥', 'background: red; color: white; font-size: 16px; font-weight: bold; padding: 5px;');
console.log('%cproductInfo exists:', 'background: red; color: white; padding: 3px;', !!productInfo);
console.log('%cuserNumber exists:', 'background: red; color: white; padding: 3px;', !!userNumber);
@@ -1013,7 +1014,7 @@ const BuyOption = ({
console.log('%c[BuyOption] ✅ AFTER pushPanel dispatch', 'background: orange; color: white; font-weight: bold; padding: 5px;');
// Toast 정리는 성공적으로 패널 이동 후에만 실행
dispatch(clearAllToasts());
// dispatch(clearAllToasts());
}
}
}, [
@@ -1035,7 +1036,8 @@ const BuyOption = ({
]);
// ADD TO CART 버튼 클릭 핸들러
const handleAddToCartClick = useCallback(() => {
const handleAddToCartClick = useCallback((e) => {
e.stopPropagation();
console.log('[BuyOption] ADD TO CART clicked');
const isMock = isMockMode;
@@ -1180,17 +1182,18 @@ const BuyOption = ({
name: optionLabel,
price: optionForUse?.optPrc || '0.00',
};
dispatch(
pushPanel({
name: Config.panel_names.CART_PANEL,
panelInfo: {
productInfo: productInfoForCart,
optionInfo: optionInfoForCart,
quantity: effectiveQuantity,
},
})
);
dispatch(setShowPopup(Config.ACTIVE_POPUP.addCartPopup));
return;
// dispatch(
// pushPanel({
// name: Config.panel_names.CART_PANEL,
// panelInfo: {
// productInfo: productInfoForCart,
// optionInfo: optionInfoForCart,
// quantity: effectiveQuantity,
// },
// })
// );
} else {
console.log('[BuyOption] Mock Mode - Adding to cart (Mock)');
@@ -1241,7 +1244,7 @@ const BuyOption = ({
optionInfo,
quantity: effectiveQuantity,
},
})
})
);
}
dispatch(clearAllToasts());
@@ -1403,7 +1406,7 @@ const BuyOption = ({
if (typeof spotlightId === 'string') {
currentSpot = spotlightId;
} else {
currentSpot = 'buy-option-buy-now-button';
currentSpot = 'buy-option-add-to-cart-button';
}
if (currentSpot) {
@@ -1447,8 +1450,25 @@ const BuyOption = ({
}
}, [dispatch, hasOnClose, isOptionValue, webOSVersion, userNumber]);
useEffect(()=>{
return(()=>{
dispatch(clearAllToasts());
})
},[])
const handleCartMove = useCallback(() => {
dispatch(setHidePopup());
dispatch(
pushPanel({
name: Config.panel_names.CART_PANEL,
})
)
},[dispatch])
return (
<Container className={styles.buy_option}>
<Container
className={styles.buy_option}
>
<div className={styles.buy_option__left_section}>
{/* 동적 옵션 렌더링 */}
{productOptionInfos &&
@@ -1582,8 +1602,24 @@ const BuyOption = ({
onClose={onClose}
/>
)}
{activePopup === Config.ACTIVE_POPUP.addCartPopup && (
<TPopUp
kind="textPopup"
hasText
open={popupVisible}
text={"Added to Cart"}
hasButton
hasOnClose={hasOnClose}
button1Text={$L('VIEW CART')}
button2Text={$L('CONTINUE SHOPPING')}
onClick={handleCartMove}
onClose={onClose}
/>
)}
</Container>
);
};
export default BuyOption;