Created
August 9, 2019 09:02
-
-
Save maruware/7da93377bfd4ecad82aad0b0b00eb0b4 to your computer and use it in GitHub Desktop.
materil-ui placeholder image
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
import React from 'react' | |
import { makeStyles } from '@material-ui/core/styles' | |
import ImageIcon from '@material-ui/icons/Image' | |
interface PlaceHolderImageProps { | |
width: number | |
height: number | |
} | |
const useStyles = makeStyles(theme => ({ | |
root: { | |
backgroundColor: theme.palette.grey[300], | |
display: 'flex', | |
alignItems: 'center', | |
justifyContent: 'center' | |
} | |
})) | |
const PlaceholderImage: React.FC<PlaceHolderImageProps> = ({ | |
width, | |
height | |
}) => { | |
const classes = useStyles() | |
return ( | |
<div style={{ width, height }} className={classes.root}> | |
<ImageIcon fontSize="large" /> | |
</div> | |
) | |
} | |
export default PlaceholderImage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment