Skip to content

Commit

Permalink
Prevent snackbars from having the same width (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamhosseindhv authored Feb 28, 2021
1 parent 700bacb commit 24fff56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/SnackbarItem/SnackbarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ const styles = (theme: Theme) => {
marginTop: SNACKBAR_INDENTS.snackbar.dense,
marginBottom: SNACKBAR_INDENTS.snackbar.dense,
},
collapseWrapperInner: {
width: 'auto',
},
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/SnackbarItem/SnackbarItem.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const getTransitionDirection = (anchorOrigin: Snack['anchorOrigin']): Dir
/**
* Omit all class keys except what we need for collapse component
*/
export const omitNonCollapseKeys = (classes: SnackbarItemProps['classes'], dense: SnackbarProviderProps['dense']): { container: string; wrapper: string } => ({
export const omitNonCollapseKeys = (classes: SnackbarItemProps['classes'], dense: SnackbarProviderProps['dense']): { container: string; wrapper: string; wrapperInner: string; } => ({
container: classes.collapseContainer,
wrapper: clsx(classes.collapseWrapper, { [classes.collapseWrapperDense]: dense }),
wrapperInner: classes.collapseWrapperInner,
});

0 comments on commit 24fff56

Please sign in to comment.