[HomePanel] 스크롤 처음으로 돌아왔을때 시작점 변경건.
- BestSeller,SubCategory 스크롤 처리 - SubCategory더보기 아이콘 png 변경. - SubCategory width,Height값제거.
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
))}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user