-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.tsx
More file actions
44 lines (41 loc) · 1.56 KB
/
index.tsx
File metadata and controls
44 lines (41 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { routePaths } from "../../../core/routes/path";
import { LocationType } from "../../../types/cardCollection";
import { GTM_CLASS_NAME } from "../../../util/const/gtm";
import { headingTitles } from "../../../util/main/headingTitles";
import BestPiickleCard from "../../@common/BestPiickleCard";
import HeadingTitleContainer from "../../@common/HeadingTitleContainer";
import useDraggingContainer from "../../@common/hooks/useDraggingContainer";
import { useBestPiickle } from "../hooks/useBestPiickle";
import St from "./style";
export default function BestPiickle() {
const { bestPiickle } = useBestPiickle();
const { scrollableContainerProps, isDragging } = useDraggingContainer("X");
return (
<St.Root>
<HeadingTitleContainer
headingTitles={headingTitles[0]}
paddingVerticalValue={4}
routePath={routePaths.BestPiicklePage}
gtmClassName={GTM_CLASS_NAME.mainBestPiickleMore}
/>
{bestPiickle && (
<St.SliderWrapper {...scrollableContainerProps}>
{bestPiickle &&
bestPiickle.data.slice(0, 5).map((bestPiickle, idx) => {
const GTM_IDX_KEY = `mainBestPiickle${idx + 1}`;
return (
<BestPiickleCard
key={bestPiickle._id}
bestPiickle={bestPiickle}
idx={idx}
canNavigate={!isDragging}
locationType={LocationType.BEST}
gtmClassName={GTM_IDX_KEY}
/>
);
})}
</St.SliderWrapper>
)}
</St.Root>
);
}