aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-09-05 11:29:52 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-09-05 11:29:52 -0700
commit1aefaf62068c9d74df8cebe39616dc9f8bdc6596 (patch)
tree7a589d1b1decd2a4e5ec165cb2787c52ea75e54f
parenteb6b175435a804b051159c20341c94ef485b6b34 (diff)
downloadtrackermap-web-1aefaf62068c9d74df8cebe39616dc9f8bdc6596.tar.gz
trackermap-web-1aefaf62068c9d74df8cebe39616dc9f8bdc6596.tar.bz2
trackermap-web-1aefaf62068c9d74df8cebe39616dc9f8bdc6596.zip
Remove incorrect status
-rw-r--r--modern/src/map/SelectedDeviceMap.js43
1 files changed, 2 insertions, 41 deletions
diff --git a/modern/src/map/SelectedDeviceMap.js b/modern/src/map/SelectedDeviceMap.js
index 38cb6abf..63847176 100644
--- a/modern/src/map/SelectedDeviceMap.js
+++ b/modern/src/map/SelectedDeviceMap.js
@@ -1,20 +1,9 @@
-import React, { useEffect } from 'react';
-import ReactDOM from 'react-dom';
+import { useEffect } from 'react';
-import { ThemeProvider } from '@material-ui/core/styles';
-import maplibregl from 'maplibre-gl';
-import { Provider, useSelector } from 'react-redux';
-import { useHistory } from 'react-router-dom';
+import { useSelector } from 'react-redux';
import { map } from './Map';
-import store from '../store';
-import StatusView from './StatusView';
-import theme from '../theme';
-
-let popup;
const SelectedDeviceMap = () => {
- const history = useHistory();
-
const mapCenter = useSelector((state) => {
if (state.devices.selectedId) {
const position = state.positions.items[state.devices.selectedId] || null;
@@ -25,34 +14,6 @@ const SelectedDeviceMap = () => {
return null;
});
- const showStatus = (deviceId, coordinates) => {
- const placeholder = document.createElement('div');
- ReactDOM.render(
- <Provider store={store}>
- <ThemeProvider theme={theme}>
- <StatusView
- deviceId={deviceId}
- onShowDetails={(positionId) => history.push(`/position/${positionId}`)}
- onShowHistory={() => history.push('/replay')}
- onEditClick={(deviceId) => history.push(`/device/${deviceId}`)}
- />
- </ThemeProvider>
- </Provider>,
- placeholder,
- );
-
- if (popup) {
- popup.remove();
- }
- popup = new maplibregl.Popup({
- offset: 25,
- anchor: 'top',
- closeOnClick: true,
- });
-
- popup.setDOMContent(placeholder).setLngLat(coordinates).addTo(map);
- };
-
useEffect(() => {
if (mapCenter) {
map.easeTo({ center: mapCenter.position });