Skip to content

Commit 2290a50

Browse files
committed
fix: fix padding on small devices
1 parent 92f9bef commit 2290a50

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/SettingsDialog.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import {
1212
ListItemText,
1313
makeStyles,
1414
TextField,
15-
Typography
15+
Typography,
16+
useTheme,
17+
useMediaQuery
1618
} from "@material-ui/core";
1719
import { useState } from "react";
1820
import { useDispatch, useSelector } from "react-redux";
@@ -57,6 +59,10 @@ const useStyles = makeStyles(theme => ({
5759
marginRight: theme.spacing(2),
5860
marginTop: theme.spacing(2)
5961
},
62+
smallPadding: {
63+
paddingLeft: theme.spacing(1),
64+
paddingRight: theme.spacing(1)
65+
},
6066
red: redStyle(theme),
6167
redBg: redBgStyle(theme)
6268
}));
@@ -67,6 +73,9 @@ function SettingsDialog(props: Props) {
6773
const settings = rootState.settings;
6874
const dispatch = useDispatch();
6975

76+
const theme = useTheme();
77+
const isSmallDevice = useMediaQuery(theme.breakpoints.down("xs"));
78+
7079
// Local states
7180
const [maxPriorities, setMaxPriorities] = useState(rootState.settings.maxPriorities.toString());
7281
const [errorPriorities, setErrorPriorities] = useState(false);
@@ -163,7 +172,7 @@ function SettingsDialog(props: Props) {
163172
fullWidth
164173
>
165174
<DialogTitle className={classes.title}>Settings</DialogTitle>
166-
<DialogContent>
175+
<DialogContent className={isSmallDevice ? classes.smallPadding : ""}>
167176
<ConfirmationDialog
168177
open={confirmationDialog}
169178
text={confirmationText}

0 commit comments

Comments
 (0)