forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Grid] Improve Grid2 upgrade experience (@DiegoAndai) (mui#45372)
- Loading branch information
1 parent
551d995
commit 79b5c71
Showing
17 changed files
with
361 additions
and
171 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
36 changes: 36 additions & 0 deletions
36
docs/data/material/components/grid2/ColumnLayoutInsideGrid.js
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,36 @@ | ||
import * as React from 'react'; | ||
import { styled } from '@mui/material/styles'; | ||
import Box from '@mui/material/Box'; | ||
import Paper from '@mui/material/Paper'; | ||
import Grid from '@mui/material/Grid2'; | ||
import Stack from '@mui/material/Stack'; | ||
|
||
const Item = styled(Paper)(({ theme }) => ({ | ||
backgroundColor: '#fff', | ||
...theme.typography.body2, | ||
padding: theme.spacing(1), | ||
textAlign: 'center', | ||
color: theme.palette.text.secondary, | ||
...theme.applyStyles('dark', { | ||
backgroundColor: '#1A2027', | ||
}), | ||
})); | ||
|
||
export default function ColumnLayoutInsideGrid() { | ||
return ( | ||
<Box sx={{ flexGrow: 1 }}> | ||
<Grid container spacing={2}> | ||
<Grid size={4}> | ||
<Stack spacing={2}> | ||
<Item>Column 1 - Row 1</Item> | ||
<Item>Column 1 - Row 2</Item> | ||
<Item>Column 1 - Row 3</Item> | ||
</Stack> | ||
</Grid> | ||
<Grid size={8}> | ||
<Item sx={{ height: '100%', boxSizing: 'border-box' }}>Column 2</Item> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
); | ||
} |
36 changes: 36 additions & 0 deletions
36
docs/data/material/components/grid2/ColumnLayoutInsideGrid.tsx
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,36 @@ | ||
import * as React from 'react'; | ||
import { styled } from '@mui/material/styles'; | ||
import Box from '@mui/material/Box'; | ||
import Paper from '@mui/material/Paper'; | ||
import Grid from '@mui/material/Grid2'; | ||
import Stack from '@mui/material/Stack'; | ||
|
||
const Item = styled(Paper)(({ theme }) => ({ | ||
backgroundColor: '#fff', | ||
...theme.typography.body2, | ||
padding: theme.spacing(1), | ||
textAlign: 'center', | ||
color: theme.palette.text.secondary, | ||
...theme.applyStyles('dark', { | ||
backgroundColor: '#1A2027', | ||
}), | ||
})); | ||
|
||
export default function ColumnLayoutInsideGrid() { | ||
return ( | ||
<Box sx={{ flexGrow: 1 }}> | ||
<Grid container spacing={2}> | ||
<Grid size={4}> | ||
<Stack spacing={2}> | ||
<Item>Column 1 - Row 1</Item> | ||
<Item>Column 1 - Row 2</Item> | ||
<Item>Column 1 - Row 3</Item> | ||
</Stack> | ||
</Grid> | ||
<Grid size={8}> | ||
<Item sx={{ height: '100%', boxSizing: 'border-box' }}>Column 2</Item> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
); | ||
} |
12 changes: 12 additions & 0 deletions
12
docs/data/material/components/grid2/ColumnLayoutInsideGrid.tsx.preview
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,12 @@ | ||
<Grid container spacing={2}> | ||
<Grid size={4}> | ||
<Stack spacing={2}> | ||
<Item>Column 1 - Row 1</Item> | ||
<Item>Column 1 - Row 2</Item> | ||
<Item>Column 1 - Row 3</Item> | ||
</Stack> | ||
</Grid> | ||
<Grid size={8}> | ||
<Item sx={{ height: '100%', boxSizing: 'border-box' }}>Column 2</Item> | ||
</Grid> | ||
</Grid> |
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
66 changes: 0 additions & 66 deletions
66
docs/data/material/migration/migration-grid-v2/GridsDiff.js
This file was deleted.
Oops, something went wrong.
89 changes: 0 additions & 89 deletions
89
docs/data/material/migration/migration-grid-v2/migration-grid-v2.md
This file was deleted.
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
Oops, something went wrong.