Skip to content

Commit

Permalink
Merge branch 'tooppaaa-fix/removeObjectEntries'
Browse files Browse the repository at this point in the history
  • Loading branch information
iamhosseindhv committed Jun 10, 2020
2 parents 07529a6 + ba20e70 commit 34a7010
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 29 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
Thanks to all contributers who improved notistack by opening an issue/PR.

### `[email protected].17`
### `[email protected].18`
###### to be published
* **@pctestjfarz**: Add swipe to dismiss feature [#138](https://github.com/iamhosseindhv/notistack/issues/138)
* **@molynerd**: Add support to update content of snackbar in place [#50](https://github.com/iamhosseindhv/notistack/issues/50)
* **@david-chau**: Allow `asc`, `desc` or custom sort order of snackbars [#160](https://github.com/iamhosseindhv/notistack/issues/160)


<br />

### `[email protected]`
###### June 10, 2020
* Bug fix and improvments [#277](https://github.com/iamhosseindhv/notistack/issues/277)
* Alternative for Object.entries to better support IE 11 compat [#284](https://github.com/iamhosseindhv/notistack/pull/284)


<br />

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notistack",
"version": "0.9.16",
"version": "0.9.17",
"description": "Highly customizable notification snackbars (toasts) that can be stacked on top of each other",
"main": "dist/index.js",
"module": "dist/notistack.esm.js",
Expand Down
55 changes: 29 additions & 26 deletions src/SnackbarProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,32 +279,35 @@ class SnackbarProvider extends Component<SnackbarProviderProps, State> {
...this.props.iconVariant,
};

const snackbars = Object.entries(categ).map(([origin, snacks]) => (
<SnackbarContainer
key={origin}
dense={dense}
anchorOrigin={snacks[0].anchorOrigin}
className={clsx(
classes.containerRoot,
classes[`containerAnchorOrigin${origin}` as ContainerClassKey],
)}
>
{snacks.map(snack => (
<SnackbarItem
{...props}
key={snack.key}
dense={dense}
snack={snack}
hideIconVariant={hideIconVariant}
iconVariant={iconVariant}
classes={omitContainerKeys(classes)}
onClose={this.handleCloseSnack}
onExited={createChainedFunction([this.handleExitedSnack, this.props.onExited])}
onEntered={createChainedFunction([this.handleEnteredSnack, this.props.onEntered])}
/>
))}
</SnackbarContainer>
));
const snackbars = Object.keys(categ).map((origin) => {
const snacks = categ[origin];
return (
<SnackbarContainer
key={origin}
dense={dense}
anchorOrigin={snacks[0].anchorOrigin}
className={clsx(
classes.containerRoot,
classes[`containerAnchorOrigin${origin}` as ContainerClassKey],
)}
>
{snacks.map(snack => (
<SnackbarItem
{...props}
key={snack.key}
dense={dense}
snack={snack}
hideIconVariant={hideIconVariant}
iconVariant={iconVariant}
classes={omitContainerKeys(classes)}
onClose={this.handleCloseSnack}
onExited={createChainedFunction([this.handleExitedSnack, this.props.onExited])}
onEntered={createChainedFunction([this.handleEnteredSnack, this.props.onEntered])}
/>
))}
</SnackbarContainer>
);
});

return (
<SnackbarContext.Provider value={contextValue}>
Expand Down

0 comments on commit 34a7010

Please sign in to comment.