Skip to content

Commit

Permalink
Replace storybook-addon-material-ui5
Browse files Browse the repository at this point in the history
The addon does not support Storybook 7 as it is still using default
export of @storybook/addons

The addon has not been developed since April 2023.

I don't see any of its functionality, other than applying the theme,
actually working with Storybook 6 either. The project it was forked
from has some open issues where others had similar problems.

react-theming/storybook-addon-material-ui#124
react-theming/storybook-addon-material-ui#97

I followed the guide from Ocotober 2022 for Material UI in Storybook to
activate our theme without storybook-addon-material-ui.

https://storybook.js.org/blog/material-ui-in-storybook/
  • Loading branch information
WULCAN committed Jun 26, 2024
1 parent b06311c commit b1b3812
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = {
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'storybook-addon-material-ui5',
'storybook-addon-mock/register',
],
framework: '@storybook/nextjs',
Expand Down
8 changes: 6 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import dayjs from 'dayjs';
import { IntlProvider } from 'react-intl';
import isoWeek from 'dayjs/plugin/isoWeek';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { muiTheme } from 'storybook-addon-material-ui5';
import withMock from 'storybook-addon-mock';
import { Provider as ReduxProvider } from 'react-redux';
import { ThemeProvider } from '@mui/material';

import theme from '../src/theme';
import '../src/styles.css';
Expand All @@ -25,7 +25,11 @@ const I18nProvider = (props) => {
};

export const decorators = [
muiTheme([theme]),
(Story) => (
<ThemeProvider theme={theme}>
<Story />
</ThemeProvider>
),
(story) => <ReduxProvider store={createStore()}>{story()}</ReduxProvider>,
(story) => <I18nProvider>{story()}</I18nProvider>,
withMock,
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
"npm-run-all2": "^6.0.4",
"prettier": "^2.5.1",
"storybook": "7.0",
"storybook-addon-material-ui5": "^1.0.0",
"storybook-addon-mock": "^2.4.0",
"ts-jest": "^27.0.5",
"ts-loader": "^9.2.6",
Expand Down

0 comments on commit b1b3812

Please sign in to comment.