diff --git a/src/SnackbarItem/SnackbarItem.tsx b/src/SnackbarItem/SnackbarItem.tsx index ab02e2bf..97ea954b 100644 --- a/src/SnackbarItem/SnackbarItem.tsx +++ b/src/SnackbarItem/SnackbarItem.tsx @@ -3,8 +3,8 @@ import clsx from 'clsx'; import { withStyles, WithStyles, createStyles, Theme, emphasize } from '@material-ui/core/styles'; import Collapse from '@material-ui/core/Collapse'; import SnackbarContent from '../SnackbarContent'; -import { getTransitionDirection, omitNonCollapseKeys } from './SnackbarItem.util'; -import { allClasses, REASONS, SNACKBAR_INDENTS, objectMerge, DEFAULTS, transformer } from '../utils/constants'; +import { getTransitionDirection } from './SnackbarItem.util'; +import { allClasses, REASONS, objectMerge, DEFAULTS, transformer } from '../utils/constants'; import { SharedProps, RequiredBy, TransitionHandlerProps, SnackbarProviderProps as ProviderProps } from '../index'; import defaultIconVariants from '../utils/defaultIconVariants'; import createChainedFunction from '../utils/createChainedFunction'; @@ -65,27 +65,6 @@ const styles = (theme: Theme) => { bottom: 0, left: 0, }, - collapseContainer: { - [theme.breakpoints.down('xs')]: { - paddingLeft: theme.spacing(1), - paddingRight: theme.spacing(1), - }, - }, - collapseWrapper: { - transition: theme.transitions.create(['margin-bottom'], { easing: 'ease' }), - marginTop: SNACKBAR_INDENTS.snackbar.default, - marginBottom: SNACKBAR_INDENTS.snackbar.default, - }, - collapseWrapperDense: { - marginTop: SNACKBAR_INDENTS.snackbar.dense, - marginBottom: SNACKBAR_INDENTS.snackbar.dense, - }, - collapseWrapperInner: { - width: 'auto', - [theme.breakpoints.down('xs')]: { - width: '100%', - }, - }, }); } @@ -214,7 +193,6 @@ const SnackbarItem: React.FC = ({ classes, ...props }) => { unmountOnExit timeout={175} in={collapsed} - classes={omitNonCollapseKeys(classes, dense)} onExited={callbacks.onExited} > {/* @ts-ignore */} diff --git a/src/SnackbarItem/SnackbarItem.util.ts b/src/SnackbarItem/SnackbarItem.util.ts index 4944eb72..f13493f3 100644 --- a/src/SnackbarItem/SnackbarItem.util.ts +++ b/src/SnackbarItem/SnackbarItem.util.ts @@ -1,7 +1,4 @@ -import clsx from 'clsx'; -import { SnackbarItemProps } from './SnackbarItem'; import { Snack } from '../SnackbarProvider'; -import { SnackbarProviderProps } from '..'; const DIRECTION = { right: 'left', @@ -17,12 +14,3 @@ export const getTransitionDirection = (anchorOrigin: Snack['anchorOrigin']): Dir } return DIRECTION[anchorOrigin.vertical]; }; - -/** - * Omit all class keys except what we need for collapse component - */ -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, -});