diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-09-02 23:20:12 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-09-02 23:20:12 -0700 |
commit | e6f906dbb565abdb29297ec67db3c922135c628c (patch) | |
tree | a6d1c89436d066ec9171b6a68e8d5e7eeb56d2de /modern/src/reports/ChartReportPage.js | |
parent | e5f07d30df69c1fff28cf1ff8502e4843a8b543c (diff) | |
download | trackermap-web-e6f906dbb565abdb29297ec67db3c922135c628c.tar.gz trackermap-web-e6f906dbb565abdb29297ec67db3c922135c628c.tar.bz2 trackermap-web-e6f906dbb565abdb29297ec67db3c922135c628c.zip |
Migrate components
Diffstat (limited to 'modern/src/reports/ChartReportPage.js')
-rw-r--r-- | modern/src/reports/ChartReportPage.js | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/modern/src/reports/ChartReportPage.js b/modern/src/reports/ChartReportPage.js index ba476ef8..6679fe4f 100644 --- a/modern/src/reports/ChartReportPage.js +++ b/modern/src/reports/ChartReportPage.js @@ -8,7 +8,7 @@ import Graph from './Graph'; import { useAttributePreference } from '../common/preferences'; import { formatDate } from '../common/formatter'; import { speedFromKnots } from '../common/converter'; -import t from '../LocalizationProvider'; +import { useTranslation } from '../LocalizationProvider'; const Filter = ({ children, setItems }) => { const speedUnit = useAttributePreference('speedUnit'); @@ -37,20 +37,24 @@ const Filter = ({ children, setItems }) => { ); }; -const ChartType = ({ type, setType }) => ( - <Grid container spacing={3}> - <Grid item xs={12} sm={6}> - <FormControl variant="filled" margin="normal" fullWidth> - <InputLabel>{t('reportChartType')}</InputLabel> - <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> +const ChartType = ({ type, setType }) => { + const t = useTranslation(); + + return ( + <Grid container spacing={3}> + <Grid item xs={12} sm={6}> + <FormControl variant="filled" margin="normal" fullWidth> + <InputLabel>{t('reportChartType')}</InputLabel> + <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> + </Grid> </Grid> - </Grid> -); + ); +}; const ChartReportPage = () => { const [items, setItems] = useState([]); |