Skip to content

Commit

Permalink
Publish MUI v5 compatibility as stable release (#437)
Browse files Browse the repository at this point in the history
* Closes #334 #333 - Fix collapse keys

* 1.0.3-alpha.0

* 1.0.4-alpha.0

* 1.0.6-alpha.0

* Fixes #355 - Update MUI peer dependency to next

* 1.0.6-next.0

* Use root classKey for Collapse

* 1.0.6-next.1

* Add support for Material-UI v5 beta (#418)

* upgrade to material-ui v5; modify code as recommended by the material-ui docs

* upgrade to material-ui v5; modify code as recommended by the material-ui docs

* add missing anchor classes to SnackbarItem; fix child class declarations

* update dependencies; run build

* package-lock update

* Allow passing classes from props

* Adapt new MUI breakpoints

* Bind this

* Mark emotion peerDeps as optional

* 1.0.6-next.2

Co-authored-by: Hossein Dehnokhalaji <[email protected]>

* Support @mui/material package naming (#423)

* Support Material-UI 5.0.0-rc.0

* Bump version to 1.0.6-next.3

* Remove @mui/styles dependency

* Prepare next to be published as latest (#436)

* Add tag for people on mui-v4

* Update simple example

* Update simple example

* Update redux example

* Update mobx example

* Minor

* Update next --> latest in example codes

* Update docs

* Update CHANGELOG

* Update MUI v5 peerDependencies

* Update version to v2.0.2

* Update docs.json

Co-authored-by: Joe Maffei <[email protected]>
Co-authored-by: David Ramos <[email protected]>
  • Loading branch information
3 people authored Sep 26, 2021
1 parent 54acc22 commit 2160b28
Show file tree
Hide file tree
Showing 23 changed files with 53,496 additions and 11,009 deletions.
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.

### `[email protected]`
###### 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 />

### `[email protected]`
###### 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

0 comments on commit 2160b28

Please sign in to comment.