-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14edec4
commit 8a51140
Showing
4 changed files
with
117 additions
and
55 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
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,65 +1,55 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import { withStyles } from '@material-ui/core/styles'; | ||
import Box from '@material-ui/core/Box'; | ||
import Grid from '@material-ui/core/Grid'; | ||
|
||
const styles = (theme) => ({ | ||
root: { | ||
width: 400, | ||
backgroundColor: theme.palette.secondary.main, | ||
}, | ||
paper: { | ||
padding: 16, | ||
textAlign: 'center', | ||
}, | ||
}); | ||
|
||
function StressGrid(props) { | ||
const { classes } = props; | ||
|
||
export default function StressGrid() { | ||
return ( | ||
<div className={classes.root}> | ||
<Box | ||
sx={{ | ||
width: 400, | ||
display: 'flex', | ||
bgcolor: 'secondary.main', | ||
'& .MuiPaper-root': { | ||
p: 2, | ||
textAlign: 'center', | ||
}, | ||
}} | ||
> | ||
<Grid container spacing={3} direction="column"> | ||
<Grid container item spacing={1}> | ||
<Grid item xs={3}> | ||
<Paper className={classes.paper}>xs=3</Paper> | ||
<Paper>xs=3</Paper> | ||
</Grid> | ||
<Grid item xs={9}> | ||
<Paper className={classes.paper}>xs=9</Paper> | ||
<Paper>xs=9</Paper> | ||
</Grid> | ||
</Grid> | ||
<Grid container item spacing={1} direction="row-reverse"> | ||
<Grid item xs={3}> | ||
<Paper className={classes.paper}>first</Paper> | ||
<Paper>first</Paper> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<Paper className={classes.paper}>last</Paper> | ||
<Paper>last</Paper> | ||
</Grid> | ||
</Grid> | ||
<Grid container item spacing={1} justifyContent="space-between"> | ||
<Grid item xs={3}> | ||
<Paper className={classes.paper}>space</Paper> | ||
<Paper>space</Paper> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<Paper className={classes.paper}>between</Paper> | ||
<Paper>between</Paper> | ||
</Grid> | ||
</Grid> | ||
<Grid container item spacing={1} alignItems="stretch" direction="column-reverse"> | ||
<Grid item> | ||
<Paper className={classes.paper}>reverse</Paper> | ||
<Paper>reverse</Paper> | ||
</Grid> | ||
<Grid item> | ||
<Paper className={classes.paper}>column</Paper> | ||
<Paper>column</Paper> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</div> | ||
</Box> | ||
); | ||
} | ||
|
||
StressGrid.propTypes = { | ||
classes: PropTypes.object.isRequired, | ||
}; | ||
|
||
export default withStyles(styles)(StressGrid); |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import React from 'react'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import Box from '@material-ui/core/Box'; | ||
import Grid from '@material-ui/core/Grid'; | ||
|
||
export default function StressNestedGrid() { | ||
return ( | ||
<Box | ||
sx={{ | ||
width: 600, | ||
display: 'flex', | ||
bgcolor: 'secondary.main', | ||
'& .MuiPaper-root': { | ||
p: 2, | ||
textAlign: 'center', | ||
}, | ||
}} | ||
> | ||
<Grid container spacing={1}> | ||
<Grid item xs={12}> | ||
<Paper>xs=12</Paper> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<Paper>xs=6</Paper> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<Paper>xs=6</Paper> | ||
</Grid> | ||
<Grid item container direction="column-reverse" xs={6} spacing={3}> | ||
<Grid item xs={6}> | ||
<Paper>xs=6</Paper> | ||
</Grid> | ||
<Grid item container spacing={2} xs={6}> | ||
<Grid item container spacing={1} xs={6}> | ||
<Grid item xs={7}> | ||
<Paper>xs=7</Paper> | ||
</Grid> | ||
<Grid item xs={5}> | ||
<Paper>xs=5</Paper> | ||
</Grid> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<Paper>xs=6</Paper> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
<Grid item container direction="column" xs={6} spacing={3}> | ||
<Grid item xs={6}> | ||
<Paper>xs=6</Paper> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<Paper>xs=6</Paper> | ||
</Grid> | ||
</Grid> | ||
<Grid item container xs={6} spacing={3}> | ||
<Grid item xs={8}> | ||
<Paper>xs=8</Paper> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<Paper>xs=4</Paper> | ||
</Grid> | ||
</Grid> | ||
<Grid item container xs={6} spacing={2}> | ||
<Grid item xs={4}> | ||
<Paper>xs=4</Paper> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<Paper>xs=4</Paper> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<Paper>xs=4</Paper> | ||
</Grid> | ||
</Grid> | ||
<Grid item container xs={6} spacing={5}> | ||
<Grid item xs={6}> | ||
<Paper>xs=6</Paper> | ||
</Grid> | ||
<Grid item xs={6}> | ||
<Paper>xs=6</Paper> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
); | ||
} |