[검색관련] 검색없을시에 나오는 베스트셀러 링크 부분 누락 수정.
This commit is contained in:
@@ -1,19 +1,32 @@
|
||||
import React from "react";
|
||||
import React, { useCallback } from "react";
|
||||
|
||||
import { useSelector } from "react-redux";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
|
||||
import NoSearchResultsImage from "../../../../assets/images/searchpanel/img-search-nodata.png";
|
||||
import { pushPanel } from "../../../actions/panelActions";
|
||||
import SectionTitle from "../../../components/SectionTitle/SectionTitle";
|
||||
import TGrid from "../../../components/TGrid/TGrid";
|
||||
import TItemCard from "../../../components/TItemCard/TItemCard";
|
||||
import { panel_names } from "../../../utils/Config";
|
||||
import { $L } from "../../../utils/helperMethods";
|
||||
import css from "./NoSearchResults.module.less";
|
||||
|
||||
export default function NoSearchResults() {
|
||||
const dispatch = useDispatch();
|
||||
const bestSellerDatas = useSelector(
|
||||
(state) => state.product.bestSellerData.bestSeller
|
||||
);
|
||||
|
||||
const handleCardClick = useCallback((item) => {
|
||||
dispatch(
|
||||
pushPanel(
|
||||
{
|
||||
name: panel_names.DETAIL_PANEL,
|
||||
panelInfo: { patnrId: item.patnrId, prdtId: item.prdtId },
|
||||
},
|
||||
[dispatch, item]
|
||||
)
|
||||
);
|
||||
});
|
||||
return (
|
||||
<div className={css.container}>
|
||||
<div className={css.info}>
|
||||
@@ -26,19 +39,21 @@ export default function NoSearchResults() {
|
||||
<SectionTitle title={$L("BEST SELLER")} />
|
||||
<TGrid>
|
||||
{bestSellerDatas &&
|
||||
bestSellerDatas
|
||||
.slice(0, 5)
|
||||
.map((bestSeller) => (
|
||||
<TItemCard
|
||||
key={bestSeller.rankOrd}
|
||||
imageSource={bestSeller.imgUrl}
|
||||
imageAlt={bestSeller.prdtNm}
|
||||
productName={bestSeller.prdtNm}
|
||||
priceInfo={bestSeller.priceInfo}
|
||||
rank={bestSeller.rankOrd}
|
||||
isBestSeller
|
||||
/>
|
||||
))}
|
||||
bestSellerDatas.slice(0, 5).map((bestSeller) => (
|
||||
<TItemCard
|
||||
key={bestSeller.rankOrd}
|
||||
imageSource={bestSeller.imgUrl}
|
||||
imageAlt={bestSeller.prdtNm}
|
||||
productName={bestSeller.prdtNm}
|
||||
priceInfo={bestSeller.priceInfo}
|
||||
productId={bestSeller.prdtId}
|
||||
rank={bestSeller.rankOrd}
|
||||
onClick={() => {
|
||||
handleCardClick(bestSeller);
|
||||
}}
|
||||
isBestSeller
|
||||
/>
|
||||
))}
|
||||
</TGrid>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user