aboutsummaryrefslogtreecommitdiff
path: root/modern/src/other/EventPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-24 21:50:03 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-24 21:50:03 -0700
commitc000fa00d3a4b71a814864b9c805885f85bdd8dc (patch)
treec32c23d4d11bb8f89d9ac5b9f8598cf43918a1ec /modern/src/other/EventPage.js
parentd307f8f7e0556c0a7f4544618a081eb9a80c5845 (diff)
downloadtrackermap-web-c000fa00d3a4b71a814864b9c805885f85bdd8dc.tar.gz
trackermap-web-c000fa00d3a4b71a814864b9c805885f85bdd8dc.tar.bz2
trackermap-web-c000fa00d3a4b71a814864b9c805885f85bdd8dc.zip
Improve map markers
Diffstat (limited to 'modern/src/other/EventPage.js')
-rw-r--r--modern/src/other/EventPage.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/modern/src/other/EventPage.js b/modern/src/other/EventPage.js
index 9da8be79..8adc142c 100644
--- a/modern/src/other/EventPage.js
+++ b/modern/src/other/EventPage.js
@@ -13,6 +13,7 @@ import MapCamera from '../map/MapCamera';
import MapPositions from '../map/MapPositions';
import MapGeofence from '../map/MapGeofence';
import StatusCard from '../common/components/StatusCard';
+import { formatNotificationTitle } from '../common/util/formatter';
const useStyles = makeStyles(() => ({
root: {
@@ -39,6 +40,13 @@ const EventPage = () => {
const [position, setPosition] = useState();
const [showCard, setShowCard] = useState(false);
+ const formatType = (event) => formatNotificationTitle(t, {
+ type: event.type,
+ attributes: {
+ alarms: event.attributes.alarm,
+ },
+ });
+
const onMarkerClick = useCallback((positionId) => {
setShowCard(!!positionId);
}, [setShowCard]);
@@ -75,13 +83,13 @@ const EventPage = () => {
<IconButton color="inherit" edge="start" sx={{ mr: 2 }} onClick={() => navigate('/')}>
<ArrowBackIcon />
</IconButton>
- <Typography variant="h6">{t('positionEvent')}</Typography>
+ <Typography variant="h6">{formatType(event)}</Typography>
</Toolbar>
</AppBar>
<div className={classes.mapContainer}>
<MapView>
<MapGeofence />
- {position && <MapPositions positions={[position]} onClick={onMarkerClick} />}
+ {position && <MapPositions positions={[position]} onClick={onMarkerClick} titleField="fixTime" />}
</MapView>
{position && <MapCamera latitude={position.latitude} longitude={position.longitude} />}
{position && showCard && (