mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
f0b102d830
This is a squash merge of a bajillion messy small commits created while iterating on the UI component library and redesign.
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import { Preview } from '@storybook/react';
|
|
import { themes } from '@storybook/theming';
|
|
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import { Provider } from 'react-redux';
|
|
import ThemeLocaleProvider from '../src/app/components/ThemeLocaleProvider';
|
|
import { $baseUrl } from '../src/app/store/nanostores/baseUrl';
|
|
import { createStore } from '../src/app/store/store';
|
|
import { Container } from '@chakra-ui/react';
|
|
// TODO: Disabled for IDE performance issues with our translation JSON
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-ignore
|
|
import translationEN from '../public/locales/en.json';
|
|
import { ReduxInit } from './ReduxInit';
|
|
|
|
i18n.use(initReactI18next).init({
|
|
lng: 'en',
|
|
resources: {
|
|
en: { translation: translationEN },
|
|
},
|
|
debug: true,
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
returnNull: false,
|
|
});
|
|
|
|
const store = createStore(undefined, false);
|
|
$baseUrl.set('http://localhost:9090');
|
|
|
|
const preview: Preview = {
|
|
decorators: [
|
|
(Story) => {
|
|
return (
|
|
<Provider store={store}>
|
|
<ThemeLocaleProvider>
|
|
<ReduxInit>
|
|
<Story />
|
|
</ReduxInit>
|
|
</ThemeLocaleProvider>
|
|
</Provider>
|
|
);
|
|
},
|
|
],
|
|
parameters: {
|
|
docs: {
|
|
theme: themes.dark,
|
|
},
|
|
},
|
|
};
|
|
|
|
export default preview;
|