diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-05-31 14:17:13 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-05-31 14:17:13 +0530 |
commit | 8e1bddcc608ba4e52699c30084f5ef950bd7e329 (patch) | |
tree | 540c52116542c484f74a09042d83653582b5dc77 /modern/src/reports/RouteReportPage.js | |
parent | 402b30df63f6dfafda32ae37aa2d4df9ef638fd2 (diff) | |
download | trackermap-web-8e1bddcc608ba4e52699c30084f5ef950bd7e329.tar.gz trackermap-web-8e1bddcc608ba4e52699c30084f5ef950bd7e329.tar.bz2 trackermap-web-8e1bddcc608ba4e52699c30084f5ef950bd7e329.zip |
Finalizing reports implemetations
Diffstat (limited to 'modern/src/reports/RouteReportPage.js')
-rw-r--r-- | modern/src/reports/RouteReportPage.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js index 02d41a2e..6befa479 100644 --- a/modern/src/reports/RouteReportPage.js +++ b/modern/src/reports/RouteReportPage.js @@ -1,11 +1,12 @@ import React, { useState } from 'react'; +import { Paper } from '@material-ui/core'; import { DataGrid } from '@material-ui/data-grid'; -import t from '../common/localization'; +import { useTheme } from "@material-ui/core/styles"; import { formatDistance, formatSpeed, formatBoolean, formatDate, formatCoordinate } from '../common/formatter'; import ReportFilter from './ReportFilter'; import ReportLayoutPage from './ReportLayoutPage'; import { useAttributePreference, usePreference } from '../common/preferences'; -import { Paper } from '@material-ui/core'; +import t from '../common/localization'; const Filter = ({ setItems }) => { @@ -31,41 +32,42 @@ const RouteReportPage = () => { const distanceUnit = useAttributePreference('distanceUnit'); const speedUnit = useAttributePreference('speedUnit'); const coordinateFormat = usePreference('coordinateFormat'); + const theme = useTheme(); const columns = [{ headerName: t('positionFixTime'), field: 'fixTime', type: 'dateTime', - flex: 1, + width: theme.dimensions.dateColumnWidth, valueFormatter: ({ value }) => formatDate(value), }, { headerName: t('positionLatitude'), field: 'latitude', type: 'number', - flex: 1, + width: theme.dimensions.numberColumnWidth, valueFormatter: ({ value }) => formatCoordinate('latitude', value, coordinateFormat), }, { headerName: t('positionLongitude'), field: 'longitude', type: 'number', - flex: 1, + width: theme.dimensions.numberColumnWidth, valueFormatter: ({ value }) => formatCoordinate('longitude', value, coordinateFormat), }, { headerName: t('positionSpeed'), field: 'speed', type: 'number', - flex: 1, + width: theme.dimensions.stringColumnWidth, valueFormatter: ({ value }) => formatSpeed(value, speedUnit), }, { headerName: t('positionAddress'), field: 'address', type: 'string', - flex: 1, + width: theme.dimensions.stringColumnWidth, }, { headerName: t('positionIgnition'), field: 'ignition', type: 'boolean', - flex: 1, + width: theme.dimensions.booleanColumnWidth, valueGetter: ({ row }) => row.attributes.ignition, valueFormatter: ({ value }) => formatBoolean(value), }, { @@ -73,7 +75,7 @@ const RouteReportPage = () => { field: 'totalDistance', type: 'number', hide: true, - flex: 1, + width: theme.dimensions.numberColumnWidth, valueGetter: ({ row }) => row.attributes.totalDistance, valueFormatter: ({ value }) => formatDistance(value, distanceUnit), }] |