aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports/TripReportPage.js
diff options
context:
space:
mode:
authorDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-11 22:14:39 +0000
committerDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-11 22:14:39 +0000
commit1b93de84e2bf6a6532bdb03e1ae75e47061a4dca (patch)
tree8989ce8c6c5bb1d2a748ffe91895fe929c99dd5e /modern/src/reports/TripReportPage.js
parentefe18c504a834760242937572b369530c552e589 (diff)
downloadtrackermap-web-1b93de84e2bf6a6532bdb03e1ae75e47061a4dca.tar.gz
trackermap-web-1b93de84e2bf6a6532bdb03e1ae75e47061a4dca.tar.bz2
trackermap-web-1b93de84e2bf6a6532bdb03e1ae75e47061a4dca.zip
Fixed linting
Diffstat (limited to 'modern/src/reports/TripReportPage.js')
-rw-r--r--modern/src/reports/TripReportPage.js33
1 files changed, 18 insertions, 15 deletions
diff --git a/modern/src/reports/TripReportPage.js b/modern/src/reports/TripReportPage.js
index e8c91295..f611dde1 100644
--- a/modern/src/reports/TripReportPage.js
+++ b/modern/src/reports/TripReportPage.js
@@ -1,16 +1,19 @@
import React, { useState } from 'react';
import { DataGrid } from '@material-ui/data-grid';
-import { useTheme } from "@material-ui/core/styles";
-import { formatDistance, formatSpeed, formatHours, formatDate, formatVolume } from '../common/formatter';
+import { useTheme } from '@material-ui/core/styles';
+import {
+ formatDistance, formatSpeed, formatHours, formatDate, formatVolume,
+} from '../common/formatter';
import ReportFilter from './ReportFilter';
import ReportLayout from './ReportLayout';
import { useAttributePreference } from '../common/preferences';
import t from '../common/localization';
const Filter = ({ setItems }) => {
-
const handleSubmit = async (deviceId, from, to, mail, headers) => {
- const query = new URLSearchParams({ deviceId, from, to, mail });
+ const query = new URLSearchParams({
+ deviceId, from, to, mail,
+ });
const response = await fetch(`/api/reports/trips?${query.toString()}`, { headers });
if (response.ok) {
const contentType = response.headers.get('content-type');
@@ -22,15 +25,14 @@ const Filter = ({ setItems }) => {
}
}
}
- }
+ };
return <ReportFilter handleSubmit={handleSubmit} />;
-}
+};
const TripReportPage = () => {
-
const theme = useTheme();
-
+
const distanceUnit = useAttributePreference('distanceUnit');
const speedUnit = useAttributePreference('speedUnit');
const volumeUnit = useAttributePreference('volumeUnit');
@@ -109,19 +111,20 @@ const TripReportPage = () => {
field: 'driverName',
type: 'string',
width: theme.dimensions.columnWidthString,
- hide: true
- }]
+ hide: true,
+ }];
return (
<ReportLayout filter={<Filter setItems={setItems} />}>
<DataGrid
- rows={items}
- columns={columns}
- hideFooter
+ rows={items}
+ columns={columns}
+ hideFooter
autoHeight
- getRowId={() => Math.random()} />
+ getRowId={() => Math.random()}
+ />
</ReportLayout>
);
-}
+};
export default TripReportPage;