aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
authorDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-02 15:15:33 +0000
committerDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-02 15:15:33 +0000
commitca6f62e322ece99cb944ad341ebc4de9aa82c82d (patch)
treea2cc9edeae57163aae34b2e29b87bb2f8c6a73dc /modern
parentbf26504a27dbfc87c0280cb4909d85f4d5ecae7a (diff)
downloadetbsa-traccar-web-ca6f62e322ece99cb944ad341ebc4de9aa82c82d.tar.gz
etbsa-traccar-web-ca6f62e322ece99cb944ad341ebc4de9aa82c82d.tar.bz2
etbsa-traccar-web-ca6f62e322ece99cb944ad341ebc4de9aa82c82d.zip
Used options layout for EditItemView
Diffstat (limited to 'modern')
-rw-r--r--modern/src/EditItemView.js37
1 files changed, 23 insertions, 14 deletions
diff --git a/modern/src/EditItemView.js b/modern/src/EditItemView.js
index 16fbbae..bab56c7 100644
--- a/modern/src/EditItemView.js
+++ b/modern/src/EditItemView.js
@@ -1,5 +1,4 @@
import React from 'react';
-import MainToolbar from './MainToolbar';
import { useHistory, useParams } from 'react-router-dom';
import { makeStyles } from '@material-ui/core/styles';
import Container from '@material-ui/core/Container';
@@ -8,18 +7,19 @@ import FormControl from '@material-ui/core/FormControl';
import t from './common/localization';
import { useEffectAsync } from './reactHelper';
+import OptionsLayout from './settings/OptionsLayout';
const useStyles = makeStyles(theme => ({
container: {
- marginTop: theme.spacing(2),
+ marginTop: theme.spacing(2)
},
buttons: {
display: 'flex',
justifyContent: 'space-evenly',
'& > *': {
- flexBasis: '33%',
- },
- },
+ flexBasis: '33%'
+ }
+ }
}));
const EditItemView = ({ children, endpoint, item, setItem }) => {
@@ -47,7 +47,7 @@ const EditItemView = ({ children, endpoint, item, setItem }) => {
const response = await fetch(url, {
method: !id ? 'POST' : 'PUT',
headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify(item),
+ body: JSON.stringify(item)
});
if (response.ok) {
@@ -56,23 +56,32 @@ const EditItemView = ({ children, endpoint, item, setItem }) => {
};
return (
- <>
- <MainToolbar />
- <Container maxWidth='xs' className={classes.container}>
+ <OptionsLayout>
+ <Container maxWidth="xs" className={classes.container}>
{children}
- <FormControl fullWidth margin='normal'>
+ <FormControl fullWidth margin="normal">
<div className={classes.buttons}>
- <Button type='button' color='primary' variant='outlined' onClick={() => history.goBack()}>
+ <Button
+ type="button"
+ color="primary"
+ variant="outlined"
+ onClick={() => history.goBack()}
+ >
{t('sharedCancel')}
</Button>
- <Button type='button' color='primary' variant='contained' onClick={handleSave}>
+ <Button
+ type="button"
+ color="primary"
+ variant="contained"
+ onClick={handleSave}
+ >
{t('sharedSave')}
</Button>
</div>
</FormControl>
</Container>
- </>
+ </OptionsLayout>
);
-}
+};
export default EditItemView;