aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports/ReportLayoutPage.js
diff options
context:
space:
mode:
authorAshutosh Bishnoi <mail2bishnoi@gmail.com>2020-11-27 16:31:49 +0530
committerAshutosh Bishnoi <mail2bishnoi@gmail.com>2020-11-27 16:31:49 +0530
commit9c2dbcf00b944cca546875af4f0bcab695119a40 (patch)
treea6ff401d8ccd615abfd9166f1d45a5626c479ac1 /modern/src/reports/ReportLayoutPage.js
parent032d1a787384430a5bd93a3caf7e92bb0a5fa8aa (diff)
downloadtrackermap-web-9c2dbcf00b944cca546875af4f0bcab695119a40.tar.gz
trackermap-web-9c2dbcf00b944cca546875af4f0bcab695119a40.tar.bz2
trackermap-web-9c2dbcf00b944cca546875af4f0bcab695119a40.zip
Chart report code improvements and refactoring
Diffstat (limited to 'modern/src/reports/ReportLayoutPage.js')
-rw-r--r--modern/src/reports/ReportLayoutPage.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/modern/src/reports/ReportLayoutPage.js b/modern/src/reports/ReportLayoutPage.js
index 53b7039a..51e41010 100644
--- a/modern/src/reports/ReportLayoutPage.js
+++ b/modern/src/reports/ReportLayoutPage.js
@@ -1,7 +1,6 @@
import React from 'react';
import { Grid, Paper, makeStyles, FormControl, InputLabel, Select, MenuItem } from '@material-ui/core';
import MainToolbar from '../MainToolbar';
-import { chartTypes } from '../common/chartTypes';
import t from '../common/localization';
const useStyles = makeStyles(theme => ({
@@ -24,7 +23,7 @@ const useStyles = makeStyles(theme => ({
},
}));
-const ReportLayoutPage = ({ reportFilterForm:ReportFilterForm, setItems, setType, showChartType, children }) => {
+const ReportLayoutPage = ({ reportFilterForm:ReportFilterForm, setItems, type, setType, showChartType, children }) => {
const classes = useStyles();
return (
<div className={classes.root}>
@@ -39,10 +38,10 @@ const ReportLayoutPage = ({ reportFilterForm:ReportFilterForm, setItems, setType
<Paper className={classes.chart}>
<FormControl variant="filled" margin="normal" fullWidth>
<InputLabel>{t('reportChartType')}</InputLabel>
- <Select defaultValue="speed" onChange={e => setType(e.target.value)}>
- {chartTypes.map(item => (
- <MenuItem key={item.id} value={item.id}>{item.name}</MenuItem>
- ))}
+ <Select value={type} onChange={e => setType(e.target.value)}>
+ <MenuItem value="speed">{t('positionSpeed')}</MenuItem>
+ <MenuItem value="accuracy">{t('positionAccuracy')}</MenuItem>
+ <MenuItem value="altitude">{t('positionAltitude')}</MenuItem>
</Select>
</FormControl>
</Paper>