[251121] fix: ProductAllSection에서 FavoriteBtn 이벤트 수정

🕐 커밋 시간: 2025. 11. 21. 11:01:30

📊 변경 통계:
  • 총 파일: 1개
  • 삭제: -8줄

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/views/DetailPanel/components/FavoriteBtn.jsx

🔧 주요 변경 내용:
  • UI 컴포넌트 아키텍처 개선
  • 코드 정리 및 최적화

Performance: 코드 최적화로 성능 개선 기대
This commit is contained in:
2025-11-21 11:01:30 +09:00
parent 8ee426de52
commit 1fac922f61

View File

@@ -66,19 +66,11 @@ export default function FavoriteBtn({
onFavoriteFlagChanged(favoriteFlag === 'Y' ? 'N' : 'Y'); onFavoriteFlagChanged(favoriteFlag === 'Y' ? 'N' : 'Y');
}, [dispatch, favoriteFlag, onFavoriteFlagChanged]); }, [dispatch, favoriteFlag, onFavoriteFlagChanged]);
const handleFavoriteKeyDown = useCallback((e) => {
if (e.key === 'Enter') {
e.preventDefault();
handleFavoriteClick();
}
}, [handleFavoriteClick]);
return ( return (
<SpottableDiv <SpottableDiv
className={classNames(css.favorBtnContainer, kind === 'item_detail' ? css.smallSize : '')} className={classNames(css.favorBtnContainer, kind === 'item_detail' ? css.smallSize : '')}
spotlightId="favoriteBtn" spotlightId="favoriteBtn"
onClick={handleFavoriteClick} onClick={handleFavoriteClick}
onKeyDown={handleFavoriteKeyDown}
role="button" role="button"
tabIndex={0} tabIndex={0}
> >