vertical pagenator

This commit is contained in:
yonghyon
2024-05-31 15:58:08 +09:00
parent 80f1967f6f
commit dd705d0071
17 changed files with 428 additions and 304 deletions

View File

@@ -12,8 +12,7 @@ import TItemCard from "../../../components/TItemCard/TItemCard";
import TScroller from "../../../components/TScroller/TScroller";
import useScrollReset from "../../../hooks/useScrollReset";
import useScrollTo from "../../../hooks/useScrollTo";
import useScrollTopByDistance from "../../../hooks/useScrollTopByDistance";
import { LOG_MENU, panel_names } from "../../../utils/Config";
import { panel_names } from "../../../utils/Config";
import { $L, scaleW } from "../../../utils/helperMethods";
import css from "./BestSeller.module.less";
@@ -23,13 +22,12 @@ const Container = SpotlightContainerDecorator(
"div"
);
const BestSeller = ({ order, scrollTopBody, handleItemFocus }) => {
const BestSeller = ({ order, scrollTopBody, spotlightId, handleItemFocus }) => {
const { getScrollTo, scrollLeft } = useScrollTo();
const { handleScrollReset, handleStopScrolling } = useScrollReset(
scrollLeft,
true
);
const { scrollTopByDistance } = useScrollTopByDistance();
const dispatch = useDispatch();
@@ -90,20 +88,12 @@ const BestSeller = ({ order, scrollTopBody, handleItemFocus }) => {
if (cursorVisible) {
return;
}
scrollTopByDistance(
`[data-marker="scroll-marker"]`,
`[data-title-index="homeBestSellerTitle"]`,
scrollTopBody,
36
);
},
[
cursorVisible,
_handleItemFocus,
handleScrollReset,
scrollTopBody,
scrollTopByDistance,
scrollTopBody
]
);
@@ -118,12 +108,12 @@ const BestSeller = ({ order, scrollTopBody, handleItemFocus }) => {
const _handleItemFocus = useCallback(() => {
if (handleItemFocus) {
handleItemFocus(LOG_MENU.HOME_BEST_SELLER);
handleItemFocus();
}
}, [handleItemFocus]);
return (
<Container className={css.bestSellerWrap} style={orderStyle}>
<Container className={css.bestSellerWrap} style={orderStyle} spotlightId={spotlightId}>
<SectionTitle
title={$L("BEST SELLER")}
data-title-index="homeBestSellerTitle"