aboutsummaryrefslogtreecommitdiff
path: root/modern/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-03 13:08:16 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-03 13:08:16 -0700
commit5aed7b5c541f8eb4de1ec47fa07be3f777eaf32c (patch)
tree8beecd7897623695b0cde282f9e94c1d03c77264 /modern/src/main
parentf06773eca33fd99bbdaf8163e6e6598bd75d25f7 (diff)
downloadtrackermap-web-5aed7b5c541f8eb4de1ec47fa07be3f777eaf32c.tar.gz
trackermap-web-5aed7b5c541f8eb4de1ec47fa07be3f777eaf32c.tar.bz2
trackermap-web-5aed7b5c541f8eb4de1ec47fa07be3f777eaf32c.zip
Respect events feature flag
Diffstat (limited to 'modern/src/main')
-rw-r--r--modern/src/main/MainPage.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/modern/src/main/MainPage.js b/modern/src/main/MainPage.js
index 31248271..fb748a68 100644
--- a/modern/src/main/MainPage.js
+++ b/modern/src/main/MainPage.js
@@ -38,6 +38,7 @@ import MapGeocoder from '../map/geocoder/MapGeocoder';
import MapScale from '../map/MapScale';
import MapNotification from '../map/notification/MapNotification';
import EventsDrawer from './EventsDrawer';
+import useFeatures from '../common/util/useFeatures';
const useStyles = makeStyles((theme) => ({
root: {
@@ -143,6 +144,8 @@ const MainPage = () => {
const desktop = useMediaQuery(theme.breakpoints.up('md'));
const phone = useMediaQuery(theme.breakpoints.down('sm'));
+ const features = useFeatures();
+
const [mapMapOnSelect] = usePersistedState('mapOnSelect', false);
const [mapLiveRoutes] = usePersistedState('mapLiveRoutes', false);
@@ -223,7 +226,7 @@ const MainPage = () => {
<MapScale />
<MapCurrentLocation />
<MapGeocoder />
- <MapNotification enabled={eventsAvailable} onClick={eventHandler} />
+ {!features.disableEvents && <MapNotification enabled={eventsAvailable} onClick={eventHandler} />}
{desktop && <MapPadding left={parseInt(theme.dimensions.drawerWidthDesktop, 10)} />}
<Button
variant="contained"
@@ -334,7 +337,7 @@ const MainPage = () => {
<BottomMenu />
</div>
)}
- <EventsDrawer open={eventsOpen} onClose={() => setEventsOpen(false)} />
+ {!features.disableEvents && <EventsDrawer open={eventsOpen} onClose={() => setEventsOpen(false)} />}
{selectedDeviceId && (
<div className={classes.statusCard}>
<StatusCard