From 73f812cfb830c7c948432bc8c73c9f82da46f93b Mon Sep 17 00:00:00 2001 From: Johnson Mao Date: Sat, 26 Oct 2024 16:55:45 +0800 Subject: [PATCH] chore: fix storybook and sonar cloud issue --- components/shared/Carousel/v2/Carousel.stories.tsx | 7 +++++-- components/shared/Carousel/v2/CarouselContext.tsx | 2 +- pages/index.tsx | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/shared/Carousel/v2/Carousel.stories.tsx b/components/shared/Carousel/v2/Carousel.stories.tsx index 27cc64a7..b77a2e62 100644 --- a/components/shared/Carousel/v2/Carousel.stories.tsx +++ b/components/shared/Carousel/v2/Carousel.stories.tsx @@ -21,8 +21,11 @@ const meta: Meta = { }, ], args: { - renderKey: (props: any) => props.name, - items: [{ name: "TEST 1" }, { name: "TEST 2" }, { name: "TEST 3" }], + items: [ + { id: 1, name: "TEST 1" }, + { id: 2, name: "TEST 2" }, + { id: 3, name: "TEST 3" }, + ], Component: Card, }, argTypes: { diff --git a/components/shared/Carousel/v2/CarouselContext.tsx b/components/shared/Carousel/v2/CarouselContext.tsx index cf4bb71c..8a4c8d58 100644 --- a/components/shared/Carousel/v2/CarouselContext.tsx +++ b/components/shared/Carousel/v2/CarouselContext.tsx @@ -87,7 +87,7 @@ export function CarouselProvider({ items, Component, renderKey = (item) => item.id, -}: CarouselProviderProps) { +}: Readonly>) { const [state, dispatch] = useReducer(reducer, { ...initialState, items, diff --git a/pages/index.tsx b/pages/index.tsx index c9f0efca..52714d2a 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -70,6 +70,7 @@ function CarouselCard({
setOpen(false)} + role="menuitem" >
setOpen(false)} + role="menuitem" >