-
-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
6afc009
commit e09bff2
Showing
8 changed files
with
812 additions
and
718 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
import React, { forwardRef } from 'react'; | ||
import clsx from 'clsx'; | ||
import { createStyles, Theme, withStyles, WithStyles } from '@material-ui/core/styles'; | ||
import { styled } from '@material-ui/core/styles'; | ||
import { SnackbarContentProps } from '../index'; | ||
|
||
const styles = (theme: Theme) => createStyles({ | ||
root: { | ||
const componentName = 'SnackbarContent'; | ||
|
||
const classes = { | ||
root: `${componentName}-root`, | ||
}; | ||
|
||
const Root = styled('div')(({ theme }) => ({ | ||
[`&.${classes.root}`]: { | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
flexGrow: 1, | ||
[theme.breakpoints.up('sm')]: { | ||
flexGrow: 'initial', | ||
minWidth: 288, | ||
}, | ||
} | ||
}); | ||
|
||
interface Props extends WithStyles<typeof styles>, SnackbarContentProps { } | ||
}, | ||
})); | ||
|
||
const SnackbarContent = forwardRef<HTMLDivElement, Props>(({ classes, className, ...props }, ref) => ( | ||
<div ref={ref} className={clsx(classes.root, className)} {...props} /> | ||
)) | ||
const SnackbarContent = forwardRef<HTMLDivElement, SnackbarContentProps>(({ className, ...props }, ref) => ( | ||
<Root ref={ref} className={clsx(classes.root, className)} {...props} /> | ||
)); | ||
|
||
export default withStyles(styles)(SnackbarContent); | ||
export default SnackbarContent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.