From c8d49e57b95e3e91e35740967e1197f251f0c754 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 18 Oct 2022 09:10:42 -0700 Subject: Improve event page --- modern/src/other/EventPage.js | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/modern/src/other/EventPage.js b/modern/src/other/EventPage.js index 7bd5be30..b040bfb3 100644 --- a/modern/src/other/EventPage.js +++ b/modern/src/other/EventPage.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useCallback, useState } from 'react'; import { Typography, AppBar, Toolbar, IconButton, @@ -12,16 +12,32 @@ import MapView from '../map/core/MapView'; import MapCamera from '../map/MapCamera'; import MapPositions from '../map/MapPositions'; import MapGeofence from '../map/MapGeofence'; +import StatusCard from '../common/components/StatusCard'; -const useStyles = makeStyles(() => ({ +const useStyles = makeStyles((theme) => ({ root: { height: '100%', display: 'flex', flexDirection: 'column', }, + toolbar: { + zIndex: 1, + }, mapContainer: { flexGrow: 1, }, + statusCard: { + position: 'fixed', + zIndex: 5, + left: '50%', + [theme.breakpoints.up('md')]: { + bottom: theme.spacing(3), + }, + [theme.breakpoints.down('md')]: { + bottom: `calc(${theme.spacing(3)} + ${theme.dimensions.bottomBarHeight}px)`, + }, + transform: 'translateX(-50%)', + }, })); const EventPage = () => { @@ -33,6 +49,11 @@ const EventPage = () => { const [event, setEvent] = useState(); const [position, setPosition] = useState(); + const [showCard, setShowCard] = useState(false); + + const onMarkerClick = useCallback((positionId) => { + setShowCard(!!positionId); + }, [setShowCard]); useEffectAsync(async () => { if (id) { @@ -61,7 +82,7 @@ const EventPage = () => { return (
- + navigate('/')}> @@ -72,9 +93,19 @@ const EventPage = () => {
- {position && } + {position && } {position && } + {position && showCard && ( +
+ setShowCard(false)} + disableActions + /> +
+ )}
); -- cgit v1.2.3