mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 22:42:05 +08:00
29 lines
660 B
Plaintext
29 lines
660 B
Plaintext
```ts
|
|
// .storybook/preview.ts
|
|
|
|
import React from 'react';
|
|
|
|
// Replace your-framework with the framework you are using (e.g., react, vue3)
|
|
import { Preview } from '@storybook/your-framework';
|
|
|
|
import { normal as NavigationNormal } from '../components/Navigation.stories';
|
|
|
|
import GlobalContainerContext from '../components/lib/GlobalContainerContext';
|
|
|
|
const context = {
|
|
NavigationContainer: NavigationNormal,
|
|
};
|
|
|
|
const AppDecorator = (storyFn) => {
|
|
return (
|
|
<GlobalContainerContext.Provider value={context}>{storyFn()}</GlobalContainerContext.Provider>
|
|
);
|
|
};
|
|
|
|
const preview: Preview = {
|
|
decorators: [AppDecorator],
|
|
};
|
|
|
|
export default preview;
|
|
```
|