[home bestseller] 링크 오류수정
This commit is contained in:
@@ -2,19 +2,20 @@ import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
|
||||
import Spotlight from "@enact/spotlight";
|
||||
import { SpotlightContainerDecorator } from "@enact/spotlight/SpotlightContainerDecorator";
|
||||
import Spottable from "@enact/spotlight/Spottable";
|
||||
|
||||
import { pushPanel } from "../../../actions/panelActions";
|
||||
import { pushPanel, updatePanel } from "../../../actions/panelActions";
|
||||
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 useScrollTopByDistance from "../../../hooks/useScrollTopByDistance";
|
||||
import { panel_names } from "../../../utils/Config";
|
||||
import { $L } from "../../../utils/helperMethods";
|
||||
import css from "./BestSeller.module.less";
|
||||
import useScrollTopByDistance from "../../../hooks/useScrollTopByDistance";
|
||||
|
||||
const SpottableComponent = Spottable("div");
|
||||
const Container = SpotlightContainerDecorator(
|
||||
@@ -22,10 +23,10 @@ const Container = SpotlightContainerDecorator(
|
||||
"div"
|
||||
);
|
||||
|
||||
const BestSeller = ({ order, scrollTopBody }) => {
|
||||
const BestSeller = ({ order, scrollTopBody, panelInfo }) => {
|
||||
const dispatch = useDispatch();
|
||||
const bestSellerDatas = useSelector(
|
||||
(state) => state.product.bestSellerData.bestSeller
|
||||
(state) => state.product.bestSellerData?.bestSeller
|
||||
);
|
||||
const [drawChk, setDrawChk] = useState(false);
|
||||
const { getScrollTo, scrollLeft } = useScrollTo();
|
||||
@@ -38,14 +39,14 @@ const BestSeller = ({ order, scrollTopBody }) => {
|
||||
useEffect(() => {
|
||||
setDrawChk(true);
|
||||
}, [bestSellerDatas]);
|
||||
const handleCardClick = useCallback((item) => {
|
||||
const handleCardClick = useCallback((patnrId, prdtId) => {
|
||||
dispatch(
|
||||
pushPanel(
|
||||
{
|
||||
name: panel_names.DETAIL_PANEL,
|
||||
panelInfo: { patnrId: item.patnrId, prdtId: item.prdtId },
|
||||
panelInfo: { patnrId: patnrId, prdtId: prdtId },
|
||||
},
|
||||
[dispatch, item]
|
||||
[dispatch]
|
||||
)
|
||||
);
|
||||
});
|
||||
@@ -87,6 +88,7 @@ const BestSeller = ({ order, scrollTopBody }) => {
|
||||
);
|
||||
|
||||
const orderStyle = useMemo(() => ({ order: order }), [order]);
|
||||
|
||||
return (
|
||||
<Container className={css.bestSellerWrap} style={orderStyle}>
|
||||
<SectionTitle
|
||||
@@ -121,10 +123,11 @@ const BestSeller = ({ order, scrollTopBody }) => {
|
||||
priceInfo={priceInfo}
|
||||
productName={prdtNm}
|
||||
isBestSeller={true}
|
||||
productId={prdtId}
|
||||
rank={rankOrd}
|
||||
onFocus={() => handleFocus(itemIndex)}
|
||||
onBlur={() => handleBlur(itemIndex)}
|
||||
onClick={(e) => handleCardClick(e, patnrId, prdtId)}
|
||||
onClick={() => handleCardClick(patnrId, prdtId)}
|
||||
offerInfo={offerInfo}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user