[HomePanel] 스크롤 처음으로 돌아왔을때 시작점 변경건.

- BestSeller,SubCategory 스크롤 처리
 - SubCategory더보기 아이콘 png 변경.
 - SubCategory width,Height값제거.
This commit is contained in:
junghoon86.park
2024-02-21 15:59:36 +09:00
parent 1904b305c7
commit 650f7614c1
3 changed files with 54 additions and 36 deletions

View File

@@ -8,6 +8,8 @@ import Spottable from "@enact/spotlight/Spottable";
import SectionTitle from "../../../components/SectionTitle/SectionTitle";
import TItemCard from "../../../components/TItemCard/TItemCard";
import TScroller from "../../../components/TScroller/TScroller";
import useScrollReset from "../../../hooks/useScrollReset";
import useScrollTo from "../../../hooks/useScrollTo";
import { $L } from "../../../utils/helperMethods";
import css from "./BestSeller.module.less";
@@ -21,12 +23,20 @@ const BestSeller = () => {
const bestSellerDatas = useSelector(
(state) => state.product.bestSellerData.bestSeller
);
const { getScrollTo, scrollLeft } = useScrollTo();
const { handleScrollReset, handleStopScrolling } = useScrollReset(
scrollLeft,
true
);
return (
<Container className={css.bestSellerWrap}>
<SectionTitle title={$L(`BEST SELLER`)} />
<TScroller className={css.homeBestSeller} direction="horizontal">
<TScroller
className={css.homeBestSeller}
direction="horizontal"
cbScrollTo={getScrollTo}
>
{bestSellerDatas &&
bestSellerDatas.map((item, index) => (
<TItemCard
@@ -37,6 +47,8 @@ const BestSeller = () => {
productName={item.prdtNm}
isBestSeller={true}
rank={item.rankOrd}
onFocus={index === 0 ? handleScrollReset : null}
onBlur={handleStopScrolling}
/>
))}