aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/NotificationPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-23 17:28:00 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-23 17:28:00 -0700
commitae22e17de1d9745b0f49c09ccc11ea92dd976907 (patch)
tree4f2df47079cd519aa55a35448c5635caa8ee24ba /modern/src/settings/NotificationPage.js
parent6007d38d572066d3aa6381964a863f2b291c8903 (diff)
downloadtrackermap-web-ae22e17de1d9745b0f49c09ccc11ea92dd976907.tar.gz
trackermap-web-ae22e17de1d9745b0f49c09ccc11ea92dd976907.tar.bz2
trackermap-web-ae22e17de1d9745b0f49c09ccc11ea92dd976907.zip
Fix forms
Diffstat (limited to 'modern/src/settings/NotificationPage.js')
-rw-r--r--modern/src/settings/NotificationPage.js45
1 files changed, 24 insertions, 21 deletions
diff --git a/modern/src/settings/NotificationPage.js b/modern/src/settings/NotificationPage.js
index a7c06f68..d307be9b 100644
--- a/modern/src/settings/NotificationPage.js
+++ b/modern/src/settings/NotificationPage.js
@@ -15,10 +15,14 @@ import EditItemView from './components/EditItemView';
import { prefixString, unprefixString } from '../common/util/stringUtils';
import SelectField from '../common/components/SelectField';
import SettingsMenu from './components/SettingsMenu';
+import { FormGroup } from '@material-ui/core';
-const useStyles = makeStyles(() => ({
+const useStyles = makeStyles((theme) => ({
details: {
+ display: 'flex',
flexDirection: 'column',
+ gap: theme.spacing(2),
+ paddingBottom: theme.spacing(3),
},
}));
@@ -53,7 +57,6 @@ const NotificationPage = () => {
</AccordionSummary>
<AccordionDetails className={classes.details}>
<SelectField
- margin="normal"
value={item.type}
emptyValue={null}
onChange={(e) => setItem({ ...item, type: e.target.value })}
@@ -64,7 +67,6 @@ const NotificationPage = () => {
/>
<SelectField
multiple
- margin="normal"
value={item.notificators ? item.notificators.split(/[, ]+/) : []}
onChange={(e) => setItem({ ...item, notificators: e.target.value.join() })}
endpoint="/api/notifications/notificators"
@@ -73,25 +75,26 @@ const NotificationPage = () => {
label={t('notificationNotificators')}
/>
{(!item.type || item.type === 'alarm') && (
- <SelectField
- multiple
- margin="normal"
- value={item.attributes && item.attributes.alarms ? item.attributes.alarms.split(/[, ]+/) : []}
- onChange={(e) => setItem({ ...item, attributes: { ...item.attributes, alarms: e.target.value.join() } })}
- data={alarms}
- keyGetter={(it) => it.key}
- label={t('sharedAlarms')}
- />
+ <SelectField
+ multiple
+ value={item.attributes && item.attributes.alarms ? item.attributes.alarms.split(/[, ]+/) : []}
+ onChange={(e) => setItem({ ...item, attributes: { ...item.attributes, alarms: e.target.value.join() } })}
+ data={alarms}
+ keyGetter={(it) => it.key}
+ label={t('sharedAlarms')}
+ />
)}
- <FormControlLabel
- control={(
- <Checkbox
- checked={item.always}
- onChange={(event) => setItem({ ...item, always: event.target.checked })}
- />
- )}
- label={t('notificationAlways')}
- />
+ <FormGroup>
+ <FormControlLabel
+ control={(
+ <Checkbox
+ checked={item.always}
+ onChange={(event) => setItem({ ...item, always: event.target.checked })}
+ />
+ )}
+ label={t('notificationAlways')}
+ />
+ </FormGroup>
</AccordionDetails>
</Accordion>
)}