Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish MUI v5 compatibility as stable release #437

Merged
merged 23 commits into from
Sep 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ module.exports = {
'react/destructuring-assignment': 0,
'react/jsx-closing-bracket-location': 0,
'react/sort-comp': 0,
'arrow-parens': 0,
'react/require-default-props': 0,
'react/jsx-props-no-spreading': 0,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'jsx-a11y/anchor-is-valid': ['error', { aspects: ['invalidHref', 'preferButton'] }],
},
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Thanks to all contributers who improved notistack by opening an issue/PR.

### `notistack@2.0.2`
###### Sep 26, 2021
* **@hugofpsilva** **@ramosbugs** **@joemaffei** Publish material-ui v5 compatible version as `latest` instead of `next` [#437](https://github.com/iamhosseindhv/notistack/pull/437)

<br />

### `notistack@1.0.10`
###### July 25, 2021
* **@joshkel** Support Collapse with root and container class keys [#408](https://github.com/iamhosseindhv/notistack/pull/408)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ npm install notistack
yarn add notistack
```

If you're using Material-UI version 4.x.x or lower, download a compatible version of notistack using:
```
npm install notistack@latest-mui-v4
yarn add notistack@latest-mui-v4
```

### How to use

**1:** Wrap your app inside a `SnackbarProvider` component: (see [docs](https://iamhosseindhv.com/notistack/api) for a full list of available props)
Expand Down
6 changes: 3 additions & 3 deletions examples/mobx-example/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component, Fragment } from 'react';
import { inject, observer } from 'mobx-react';
import Typography from '@material-ui/core/Typography';
import Button from '@material-ui/core/Button';
import Typography from '@mui/material/Typography';
import Button from '@mui/material/Button';
import Notifier from './Notifier';

class App extends Component {
Expand All @@ -21,7 +21,7 @@ class App extends Component {
<Typography variant="h4" gutterBottom>
Notistack mobx example
</Typography>
<Button variant="contained" onClick={this.handleClick}>
<Button variant="outlined" onClick={this.handleClick}>
Display snackbar
</Button>
</Fragment>
Expand Down
40 changes: 25 additions & 15 deletions examples/mobx-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,36 @@
"type": "git"
},
"main": "src/index.js",
"keywords": [
"react",
"javascript",
"material-ui",
"mui",
"@mui/material",
"emotion",
"@emotion/react",
"@emotion/styled",
"stacked",
"snackbar",
"notification",
"mobx",
"mobxjs"
],
"dependencies": {
"@material-ui/core": "^4.0.0",
"react": "latest",
"react-dom": "latest",
"react-scripts": "1.1.4",
"mobx": "^5.9.0",
"mobx-react": "^5.4.3",
"notistack": "latest"
"@emotion/react": "latest",
"@emotion/styled": "latest",
"@mui/material": "latest",
"notistack": "latest",
"react": "latest",
"react-dom": "latest",
"react-scripts": "latest",
"mobx": "^5.9.0",
"mobx-react": "^5.4.3"
},
"devDependencies": {},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"keywords": [
"notistack",
"mobx",
"react",
"mobxjs"
]
}
}
13 changes: 6 additions & 7 deletions examples/redux-example/App.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React, { Fragment } from 'react';
import { useDispatch } from 'react-redux';
import Typography from '@material-ui/core/Typography';
import Button from '@material-ui/core/Button';
import Notifier from './Notifier';
import Typography from '@mui/material/Typography';
import Button from '@mui/material/Button';
import useNotifier from './useNotifier';
import {
enqueueSnackbar as enqueueSnackbarAction,
closeSnackbar as closeSnackbarAction,
} from './redux/actions';

const App = () => {
useNotifier();
const dispatch = useDispatch();
const enqueueSnackbar = (...args) => dispatch(enqueueSnackbarAction(...args));
const closeSnackbar = (...args) => dispatch(closeSnackbarAction(...args));
Expand Down Expand Up @@ -36,11 +37,9 @@ const App = () => {

return (
<Fragment>
<Notifier />
<Typography variant="h4" gutterBottom>Notistack redux example</Typography>

<Button variant="contained" onClick={handleClick}>Display snackbar</Button>
<Button variant="contained" onClick={handleDimissAll}>Dismiss all snackbars</Button>
<Button variant="outlined" onClick={handleClick}>Display snackbar</Button>
<Button variant="outlined" onClick={handleDimissAll}>Dismiss all snackbars</Button>
</Fragment>
);
};
Expand Down
Loading