[251026] Focus Recovery Success
위로 스크롤 시 비디오 자동 복구 기능 완성 - HomePanel의 _onScroll에서 expandVideoFrom1px() 액션 사용 - 1초 딜레이 후 축소된 비디오 자동 복구 - skipModalStyleRecalculation 플래그로 올바른 복구 로직 실행 📊 변경 통계: • 7개 파일 변경 • +3027줄 추가, -2240줄 삭제 🎯 주요 변경: • HomePanel.jsx: 스크롤 복구 타이밍 및 액션 개선 • playActions.js: 비디오 확장 액션 정의 • PlayerPanel.jsx: 복구 로직 개선 • 불필요한 파일 삭제 (PlayerPanel.new.jsx, .module.less)
This commit is contained in:
@@ -27,6 +27,7 @@ import { sendLogGNB, sendLogTotalRecommend } from '../../actions/logActions';
|
||||
import { getSubCategory, getTop20Show } from '../../actions/mainActions';
|
||||
import { getHomeOnSaleInfo } from '../../actions/onSaleActions';
|
||||
import { finishVideoPreview, shrinkVideoTo1px, expandVideoFrom1px } from '../../actions/playActions';
|
||||
import { updatePanel } from '../../actions/panelActions';
|
||||
import { getBestSeller } from '../../actions/productActions';
|
||||
import TBody from '../../components/TBody/TBody';
|
||||
import TButton, { TYPES } from '../../components/TButton/TButton';
|
||||
@@ -153,6 +154,8 @@ const HomePanel = ({ isOnTop }) => {
|
||||
|
||||
const cbChangePageRef = useRef(null);
|
||||
const prevScrollTopRef = useRef(0); // 이전 scrollTop 추적
|
||||
const isScrollingUpRef = useRef(false); // 스크롤 위로 감지
|
||||
const scrollExpandTimerRef = useRef(null); // 스크롤 복구 타이머
|
||||
|
||||
const focusedContainerIdRef = usePrevious(focusedContainerId);
|
||||
|
||||
@@ -419,10 +422,24 @@ const HomePanel = ({ isOnTop }) => {
|
||||
// 아래로 스크롤: 비디오를 1px로 축소
|
||||
console.log('[HomePanel] Scrolling down - shrinking video');
|
||||
dispatch(shrinkVideoTo1px());
|
||||
// 기존 타이머 취소
|
||||
if (scrollExpandTimerRef.current) {
|
||||
clearTimeout(scrollExpandTimerRef.current);
|
||||
scrollExpandTimerRef.current = null;
|
||||
}
|
||||
} else if (currentScrollTop < prevScrollTop && currentScrollTop > 0) {
|
||||
// 위로 스크롤 (0이 아닌): 비디오를 원래 크기로 복구
|
||||
console.log('[HomePanel] Scrolling up - expanding video');
|
||||
dispatch(expandVideoFrom1px());
|
||||
// 위로 스크롤 (0이 아닌): 1.5초 후 복구
|
||||
console.log('[HomePanel] Scrolling up - will expand after 1.5s');
|
||||
// 기존 타이머 취소
|
||||
if (scrollExpandTimerRef.current) {
|
||||
clearTimeout(scrollExpandTimerRef.current);
|
||||
}
|
||||
// 1초 후 자동으로 크기 조정
|
||||
scrollExpandTimerRef.current = setTimeout(() => {
|
||||
console.log('[HomePanel] 1s passed - auto expanding video');
|
||||
dispatch(expandVideoFrom1px());
|
||||
scrollExpandTimerRef.current = null;
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// 이전 scrollTop 업데이트
|
||||
|
||||
Reference in New Issue
Block a user