Skip to content

Commit 72696a3

Browse files
committed
feat: add storybook global decorator
1 parent 48e4277 commit 72696a3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.storybook/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from 'path';
2+
23
import type { StorybookConfig } from '@storybook/nextjs';
34

45
const config: StorybookConfig = {

.storybook/preview.ts .storybook/preview.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import '../src/app/index.css';
22

3+
import React from 'react';
4+
import { Toaster } from 'sonner';
5+
36
import type { Preview } from '@storybook/react';
47

58
const preview: Preview = {
@@ -11,6 +14,14 @@ const preview: Preview = {
1114
},
1215
},
1316
},
17+
decorators: [
18+
(Story) => (
19+
<>
20+
<Story />
21+
<Toaster />
22+
</>
23+
),
24+
],
1425
};
1526

1627
export default preview;

0 commit comments

Comments
 (0)