Skip to content

Commit 85e7f86

Browse files
committed
Refactor Grid components to v2 variant
1 parent 3a5c0e8 commit 85e7f86

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/App.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function App() {
3636

3737
<Container maxWidth="lg" sx={{ py: { xs: 3, md: 6 } }}>
3838
<Grid container spacing={isMdUp ? 4 : 2} alignItems="stretch">
39-
<Grid item xs={12} md={8}>
39+
<Grid size={{ xs: 12, md: 8 }}>
4040
<Paper
4141
elevation={2}
4242
sx={{ p: { xs: 2, sm: 3 }, borderRadius: 3, height: "100%" }}
@@ -45,7 +45,7 @@ export default function App() {
4545
</Paper>
4646
</Grid>
4747

48-
<Grid item xs={12} md={4}>
48+
<Grid size={{ xs: 12, md: 4 }}>
4949
<Paper
5050
elevation={2}
5151
sx={{

src/components/calculator/ImageEditor.jsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ export default function ImageEditor() {
3636
<Card key={idx} variant="outlined" sx={{ position: "relative" }}>
3737
<CardContent>
3838
<Grid container spacing={2}>
39-
<Grid item xs={12}>
39+
<Grid size={{ xs: 12 }}>
4040
<Typography variant="subtitle1" gutterBottom>
4141
Image {idx + 1}
4242
</Typography>
4343
</Grid>
4444

45-
<Grid item xs={12} sm={12} md={6}>
45+
<Grid size={{ xs: 12, sm: 12, md: 6 }}>
4646
<Autocomplete
4747
options={[{ label: "Custom" }, ...presetOptions]}
4848
groupBy={(o) => o.group || ""}
@@ -68,7 +68,7 @@ export default function ImageEditor() {
6868
/>
6969
</Grid>
7070

71-
<Grid item xs={6} md={3}>
71+
<Grid size={{ xs: 6, md: 3 }}>
7272
<TextField
7373
label="Height (px)"
7474
type="number"
@@ -80,7 +80,7 @@ export default function ImageEditor() {
8080
}}
8181
/>
8282
</Grid>
83-
<Grid item xs={6} md={3}>
83+
<Grid size={{ xs: 6, md: 3 }}>
8484
<TextField
8585
label="Width (px)"
8686
type="number"
@@ -93,7 +93,7 @@ export default function ImageEditor() {
9393
/>
9494
</Grid>
9595

96-
<Grid item xs={6} md={3}>
96+
<Grid size={{ xs: 6, md: 3 }}>
9797
<TextField
9898
label="Count"
9999
type="number"
@@ -107,9 +107,7 @@ export default function ImageEditor() {
107107
</Grid>
108108

109109
<Grid
110-
item
111-
xs={6}
112-
md={3}
110+
size={{ xs: 6, md: 3 }}
113111
sx={{ display: "flex", alignItems: "center", gap: 1 }}
114112
>
115113
<IconButton

0 commit comments

Comments
 (0)