[상품 상세]

- 탑버튼 추가.
 - 높이값 정상적으로 체크하지못하는 부분에 대한 처리.
This commit is contained in:
junghoon86.park
2025-11-24 20:45:27 +09:00
parent 7da55ea1ae
commit f9c23afd9e
2 changed files with 38 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ import {
} from '../../../actions/toastActions'; } from '../../../actions/toastActions';
import CustomImage from '../../../components/CustomImage/CustomImage.jsx'; import CustomImage from '../../../components/CustomImage/CustomImage.jsx';
// ProductInfoSection imports // ProductInfoSection imports
import TButton from '../../../components/TButton/TButton'; import TButton, { TYPES } from '../../../components/TButton/TButton';
import TPopUp from '../../../components/TPopUp/TPopUp.jsx'; import TPopUp from '../../../components/TPopUp/TPopUp.jsx';
import TVirtualGridList import TVirtualGridList
from '../../../components/TVirtualGridList/TVirtualGridList.jsx'; from '../../../components/TVirtualGridList/TVirtualGridList.jsx';
@@ -286,6 +286,20 @@ export default function ProductAllSection({
const [couponCodes, setCouponCodes] = useState(''); const [couponCodes, setCouponCodes] = useState('');
const [focused, setFocused] = useState(false); const [focused, setFocused] = useState(false);
//topbutton
const handleTopButtonClick = useCallback(() => {
const container = scrollContainerRef?.current;
if (!container) return;
if (typeof container.scrollTo === 'function') {
scrollTop({ y: 0, animate: true });
const timeOut = setTimeout(()=>{
Spotlight.focus("product-detail-container-0");
},100);
}
}, [
scrollTop
]);
useEffect(() => { useEffect(() => {
dispatch( dispatch(
getProductCouponSearch({ getProductCouponSearch({
@@ -1036,7 +1050,7 @@ export default function ProductAllSection({
const prevScrollTop = prevScrollTopRef.current; const prevScrollTop = prevScrollTopRef.current;
scrollPositionRef.current = currentScrollTop; scrollPositionRef.current = currentScrollTop;
// 기존 bottom 체크 로직 유지 // 기존 bottom 체크 로직 유지
if (documentHeight) { if (documentHeight) {
const isAtBottom = const isAtBottom =
@@ -1102,7 +1116,6 @@ export default function ProductAllSection({
(e) => { (e) => {
const currentScrollTop = e.scrollTop; const currentScrollTop = e.scrollTop;
scrollPositionRef.current = currentScrollTop; scrollPositionRef.current = currentScrollTop;
if (documentHeight) { if (documentHeight) {
const isAtBottom = const isAtBottom =
currentScrollTop + 944 >= currentScrollTop + 944 >=
@@ -1152,7 +1165,7 @@ export default function ProductAllSection({
(descriptionRef.current?.scrollHeight || 0) + (descriptionRef.current?.scrollHeight || 0) +
(reviewRef.current?.scrollHeight || 0) (reviewRef.current?.scrollHeight || 0)
); );
}, [hasReviews, hasYouMayAlsoLike]); }, [productDetailRef.current, descriptionRef.current, reviewRef.current]);
// 스크롤 위치에 따른 MediaPanel 제어 (비디오 재생 중에는 자동 제어 안함 - unmount 시에만 정리) // 스크롤 위치에 따른 MediaPanel 제어 (비디오 재생 중에는 자동 제어 안함 - unmount 시에만 정리)
// useEffect(() => { // useEffect(() => {
@@ -1671,6 +1684,18 @@ export default function ProductAllSection({
</div> </div>
)} )}
</div> </div>
<div className={css.topButtonBox}>
<TButton
className={css.tButton}
onClick={handleTopButtonClick}
size={null}
type={TYPES.topButton}
spotlightId={'detail-top-btn'}
data-wheel-point={true}
aria-label="Move to Top, Button"
/>
</div>
</TScrollerDetail> </TScrollerDetail>
</div> </div>
</ContentContainer> </ContentContainer>
@@ -1682,7 +1707,7 @@ export default function ProductAllSection({
<img src={arrowDown} /> <img src={arrowDown} />
SCROLL DOWN SCROLL DOWN
</p> </p>
)} )}
</div> </div>
{/* COUPON POPUP */} {/* COUPON POPUP */}
{activePopup === Config.ACTIVE_POPUP.couponPopup && ( {activePopup === Config.ACTIVE_POPUP.couponPopup && (

View File

@@ -961,3 +961,11 @@
} }
} }
} }
.topButtonBox {
width:100%;
.tButton {
&:focus {
background-color: @PRIMARY_COLOR_RED;
}
}
}