aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/ComputedAttributesPage.js
diff options
context:
space:
mode:
authorDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-01 14:03:37 +0000
committerDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-01 14:03:37 +0000
commite5b727e1bc85e6c38a15c8917aae57a70533da46 (patch)
treebdef36c1f371aae8293f277f187d58bc90d2e194 /modern/src/settings/ComputedAttributesPage.js
parent70fd67f635fbcd75ceab50934419999cdb71e78e (diff)
downloadtrackermap-web-e5b727e1bc85e6c38a15c8917aae57a70533da46.tar.gz
trackermap-web-e5b727e1bc85e6c38a15c8917aae57a70533da46.tar.bz2
trackermap-web-e5b727e1bc85e6c38a15c8917aae57a70533da46.zip
Apply OptionsLayout to settings pages
Diffstat (limited to 'modern/src/settings/ComputedAttributesPage.js')
-rw-r--r--modern/src/settings/ComputedAttributesPage.js34
1 files changed, 21 insertions, 13 deletions
diff --git a/modern/src/settings/ComputedAttributesPage.js b/modern/src/settings/ComputedAttributesPage.js
index 1a6feab5..49c35d6d 100644
--- a/modern/src/settings/ComputedAttributesPage.js
+++ b/modern/src/settings/ComputedAttributesPage.js
@@ -6,19 +6,22 @@ import { useSelector } from 'react-redux';
import t from '../common/localization';
import { useEffectAsync } from '../reactHelper';
import EditCollectionView from '../EditCollectionView';
+import OptionsLayout from './OptionsLayout';
const useStyles = makeStyles(theme => ({
columnAction: {
width: theme.spacing(1),
- padding: theme.spacing(0, 1),
- },
+ padding: theme.spacing(0, 1)
+ }
}));
const ComputedAttributeView = ({ updateTimestamp, onMenuClick }) => {
const classes = useStyles();
const [items, setItems] = useState([]);
- const adminEnabled = useSelector(state => state.session.user && state.session.user.administrator);
+ const adminEnabled = useSelector(
+ state => state.session.user && state.session.user.administrator
+ );
useEffectAsync(async () => {
const response = await fetch('/api/attributes/computed');
@@ -40,15 +43,17 @@ const ComputedAttributeView = ({ updateTimestamp, onMenuClick }) => {
</TableRow>
</TableHead>
<TableBody>
- {items.map((item) => (
+ {items.map(item => (
<TableRow key={item.id}>
- {adminEnabled &&
+ {adminEnabled && (
<TableCell className={classes.columnAction} padding="none">
- <IconButton onClick={(event) => onMenuClick(event.currentTarget, item.id)}>
+ <IconButton
+ onClick={event => onMenuClick(event.currentTarget, item.id)}
+ >
<MoreVertIcon />
</IconButton>
</TableCell>
- }
+ )}
<TableCell>{item.description}</TableCell>
<TableCell>{item.attribute}</TableCell>
<TableCell>{item.expression}</TableCell>
@@ -59,15 +64,18 @@ const ComputedAttributeView = ({ updateTimestamp, onMenuClick }) => {
</Table>
</TableContainer>
);
-}
+};
const ComputedAttributesPage = () => {
return (
- <>
- <MainToolbar />
- <EditCollectionView content={ComputedAttributeView} editPath="/settings/attribute" endpoint="attributes/computed" />
- </>
+ <OptionsLayout>
+ <EditCollectionView
+ content={ComputedAttributeView}
+ editPath="/settings/attribute"
+ endpoint="attributes/computed"
+ />
+ </OptionsLayout>
);
-}
+};
export default ComputedAttributesPage;