Skip to content

Commit e427c0a

Browse files
committed
Improved Layout for multiple devices
1 parent cc31954 commit e427c0a

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/App.tsx

+5-10
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ import {HexColorPicker} from "react-colorful";
2727

2828
const useStyles = makeStyles({
2929
app: {
30-
display: 'flex',
31-
alignItems: 'center',
32-
flexDirection: 'column',
33-
justifyContent: 'center',
34-
height: '100vh',
3530
background: '#555555',
3631
},
3732
boxCenter: {
@@ -269,8 +264,8 @@ function App() {
269264
</Snackbar>
270265
<Container>
271266
<Grid container>
272-
<Grid item xs={2}/>
273-
<Grid item xs={4}>
267+
<Grid item md={2}/>
268+
<Grid item xs={12} md={4}>
274269
<Card className={classes.imageBox}>
275270
<CardContent>
276271
<Typography gutterBottom variant="h5" component="div">Original Image</Typography>
@@ -292,13 +287,13 @@ function App() {
292287
</div>
293288
</Card>
294289
</Grid>
295-
<Grid item xs={6}>
290+
<Grid item xs={12} md={6}>
296291
<Card className={classes.configBox}>
297292
<CardContent>
298293
<Typography gutterBottom variant="h5" component="div">Configuration</Typography>
299294
</CardContent>
300295
<Grid container>
301-
<Grid item xs={6}>
296+
<Grid item xs={12} lg={6}>
302297
<div className={classes.selectBox}>
303298
<FormControl sx={{m: 1, minWidth: 200}}>
304299
<InputLabel id="block-label">Block</InputLabel>
@@ -347,7 +342,7 @@ function App() {
347342
</FormControl>
348343
</div>
349344
</Grid>
350-
<Grid item xs={6}>
345+
<Grid item xs={12} lg={6}>
351346
<FormControl sx={{m: 1, minWidth: 200}}>
352347
<FormControlLabel control={<Checkbox/>} onChange={stretchedChange}
353348
label="Stretch"/>

src/index.css

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
html { height: 100%; }
2+
13
body {
2-
margin: 0;
4+
margin-top: 5vh;
5+
margin-left: 0;
6+
margin-right: 0;
7+
margin-bottom: 0;
8+
background: #555555;
39
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
410
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
511
sans-serif;

0 commit comments

Comments
 (0)