mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-11 13:44:18 +03:00
27 lines
638 B
TypeScript
27 lines
638 B
TypeScript
import React from 'react';
|
|
import { getDarkTheme, getLightTheme, ThemeProvider } from '../src';
|
|
import { useDarkMode } from 'storybook-dark-mode-v7';
|
|
export const parameters = {
|
|
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
controls: {
|
|
matchers: {
|
|
color: /(background|color)$/i,
|
|
date: /Date$/,
|
|
},
|
|
},
|
|
};
|
|
|
|
const lightTheme = getLightTheme('page');
|
|
const darkTheme = getDarkTheme('page');
|
|
|
|
export const decorators = [
|
|
(Story: React.ComponentType) => {
|
|
const isDark = useDarkMode();
|
|
return (
|
|
<ThemeProvider theme={isDark ? darkTheme : lightTheme}>
|
|
<Story />
|
|
</ThemeProvider>
|
|
);
|
|
},
|
|
];
|