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/StopReportPage.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/StopReportPage.js')
-rw-r--r-- | modern/src/reports/StopReportPage.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/modern/src/reports/StopReportPage.js b/modern/src/reports/StopReportPage.js index 78731510..d572742f 100644 --- a/modern/src/reports/StopReportPage.js +++ b/modern/src/reports/StopReportPage.js @@ -1,10 +1,11 @@ import React, { useState } from 'react'; import { DataGrid } from '@material-ui/data-grid'; -import t from '../common/localization'; +import { useTheme } from "@material-ui/core/styles"; import { formatDistance, formatHours, formatDate, formatVolume } from '../common/formatter'; import ReportFilter from './ReportFilter'; import ReportLayoutPage from './ReportLayoutPage'; import { useAttributePreference } from '../common/preferences'; +import t from '../common/localization'; const Filter = ({ setItems }) => { @@ -28,6 +29,8 @@ const Filter = ({ setItems }) => { const StopReportPage = () => { + const theme = useTheme(); + const distanceUnit = useAttributePreference('distanceUnit'); const volumeUnit = useAttributePreference('volumeUnit'); @@ -37,43 +40,43 @@ const StopReportPage = () => { headerName: t('reportStartTime'), field: 'startTime', type: 'dateTime', - flex: 1, + width: theme.dimensions.dateColumnWidth, valueFormatter: ({ value }) => formatDate(value), }, { headerName: t('positionOdometer'), field: 'startOdometer', type: 'number', - flex: 1, + width: theme.dimensions.numberColumnWidth, valueFormatter: ({ value }) => formatDistance(value, distanceUnit), }, { headerName: t('positionAddress'), field: 'address', type: 'string', hide: true, - flex: 1, + width: theme.dimensions.stringColumnWidth, }, { headerName: t('reportEndTime'), field: 'endTime', type: 'dateTime', - flex: 1, + width: theme.dimensions.dateColumnWidth, valueFormatter: ({ value }) => formatDate(value), }, { headerName: t('reportDuration'), field: 'duration', type: 'string', - flex: 1, + width: theme.dimensions.stringColumnWidth, valueFormatter: ({ value }) => formatHours(value), }, { headerName: t('reportEngineHours'), field: 'engineHours', type: 'string', - flex: 1, + width: theme.dimensions.stringColumnWidth, valueFormatter: ({ value }) => formatHours(value), }, { headerName: t('reportSpentFuel'), field: 'spentFuel', type: 'number', - flex: 1, + width: theme.dimensions.numberColumnWidth, hide: true, valueFormatter: ({ value }) => formatVolume(value, volumeUnit), }] |