Created
January 13, 2019 20:10
-
-
Save bennycode/beedd00484c80a5e5d0724bed2a4426b to your computer and use it in GitHub Desktop.
Material UI example (TypeScript)
This file contains hidden or 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 {createStyles, Grid, Paper, Theme, WithStyles, withStyles,} from '@material-ui/core'; | |
| import * as React from 'react'; | |
| const styles = (theme: Theme) => | |
| createStyles({ | |
| root: { | |
| flexGrow: 1, | |
| }, | |
| paper: { | |
| padding: theme.spacing.unit * 2, | |
| textAlign: 'center', | |
| color: theme.palette.text.secondary, | |
| }, | |
| }); | |
| interface Props extends WithStyles<typeof styles> { | |
| } | |
| interface State { | |
| } | |
| class Skeleton extends React.Component<Props, State> { | |
| constructor(props: Props) { | |
| super(props); | |
| } | |
| render() { | |
| const {classes} = this.props; | |
| return ( | |
| <div className={classes.root}> | |
| <Grid container spacing={24}> | |
| <Grid item xs={12}> | |
| <Paper className={classes.paper}>xs=12</Paper> | |
| </Grid> | |
| <Grid item xs={12} sm={6}> | |
| <Paper className={classes.paper}>xs=12 sm=6</Paper> | |
| </Grid> | |
| <Grid item xs={12} sm={6}> | |
| <Paper className={classes.paper}>xs=12 sm=6</Paper> | |
| </Grid> | |
| <Grid item xs={6} sm={3}> | |
| <Paper className={classes.paper}>xs=6 sm=3</Paper> | |
| </Grid> | |
| <Grid item xs={6} sm={3}> | |
| <Paper className={classes.paper}>xs=6 sm=3</Paper> | |
| </Grid> | |
| <Grid item xs={6} sm={3}> | |
| <Paper className={classes.paper}>xs=6 sm=3</Paper> | |
| </Grid> | |
| <Grid item xs={6} sm={3}> | |
| <Paper className={classes.paper}>xs=6 sm=3</Paper> | |
| </Grid> | |
| </Grid> | |
| </div> | |
| ); | |
| } | |
| } | |
| export default withStyles(styles)(Skeleton); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment