From 26085c61fa72cc0f40d631aa2bbb31a722b7c35f Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Tue, 14 Dec 2021 19:26:50 -0600 Subject: Added speed to replay page slider --- modern/src/reports/ReplayPage.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'modern/src/reports') diff --git a/modern/src/reports/ReplayPage.js b/modern/src/reports/ReplayPage.js index afb7d04..fa94a06 100644 --- a/modern/src/reports/ReplayPage.js +++ b/modern/src/reports/ReplayPage.js @@ -12,9 +12,10 @@ import MainToolbar from '../MainToolbar'; import Map from '../map/Map'; import ReplayPathMap from '../map/ReplayPathMap'; import PositionsMap from '../map/PositionsMap'; -import { formatPosition } from '../common/formatter'; +import { formatPosition, formatSpeed } from '../common/formatter'; import ReportFilter from './ReportFilter'; import { useTranslation } from '../LocalizationProvider'; +import { useAttributePreference } from '../common/preferences'; const useStyles = makeStyles((theme) => ({ root: { @@ -49,6 +50,8 @@ const ReplayPage = () => { const { id } = useParams(); const t = useTranslation(); + const speedUnit = useAttributePreference('speedUnit'); + const [expanded, setExpanded] = useState(true); const [positions, setPositions] = useState([]); const [index, setIndex] = useState(0); @@ -80,9 +83,17 @@ const ReplayPage = () => { setIndex(index - 1)}> + + {/* Date time */} {formatPosition(positions[index], 'fixTime', t)} + {/* Speed */} + {positions[index].speed != undefined && + <> +
{formatSpeed(positions[index].speed, speedUnit, t)} + }
+ {/* Speed */} {/* Next position button*/} setIndex(index + 1)}> -- cgit v1.2.3