Skip to content

Commit b9ea477

Browse files
committed
fix: react query 설정을 preview 로 이동
1 parent 9feeca4 commit b9ea477

File tree

3 files changed

+29
-25
lines changed

3 files changed

+29
-25
lines changed

.storybook/preview.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

.storybook/preview.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import type { Preview } from "@storybook/react";
2+
import "../src/app/globals.css";
3+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4+
import React from "react";
5+
import { Decorator } from "@storybook/react";
6+
7+
const queryClient = new QueryClient();
8+
9+
const withQueryClient: Decorator = (Story) => {
10+
return (
11+
<QueryClientProvider client={queryClient}>
12+
<Story />
13+
</QueryClientProvider>
14+
);
15+
};
16+
17+
const preview: Preview = {
18+
parameters: {
19+
controls: {
20+
matchers: {
21+
color: /(background|color)$/i,
22+
date: /Date$/i,
23+
},
24+
},
25+
},
26+
decorators: [withQueryClient],
27+
};
28+
29+
export default preview;

src/app/stories/design-system/components/modal/ModalLayout.stories.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
import ModalLayout from "@/app/components/modal/ModalLayout";
22
import useModalStore from "@/store/modalStore";
33
import type { Meta, StoryObj } from "@storybook/react";
4-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
5-
6-
const queryClient = new QueryClient();
74

85
const meta: Meta<typeof ModalLayout> = {
96
title: "Design System/Components/Modal/ModalLayout",
107
component: ModalLayout,
118
parameters: {
129
layout: "centered",
1310
},
14-
decorators: [
15-
(Story) => (
16-
<QueryClientProvider client={queryClient}>
17-
<Story />
18-
</QueryClientProvider>
19-
),
20-
],
2111
};
2212

2313
export default meta;

0 commit comments

Comments
 (0)