aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modern/src/common/components/StatusCard.js (renamed from modern/src/main/StatusCard.js)19
-rw-r--r--modern/src/main/MainPage.js3
2 files changed, 11 insertions, 11 deletions
diff --git a/modern/src/main/StatusCard.js b/modern/src/common/components/StatusCard.js
index 5ca45066..b8d7ffc4 100644
--- a/modern/src/main/StatusCard.js
+++ b/modern/src/common/components/StatusCard.js
@@ -24,14 +24,14 @@ import EditIcon from '@mui/icons-material/Edit';
import DeleteIcon from '@mui/icons-material/Delete';
import PendingIcon from '@mui/icons-material/Pending';
-import { useTranslation } from '../common/components/LocalizationProvider';
-import RemoveDialog from '../common/components/RemoveDialog';
-import PositionValue from '../common/components/PositionValue';
-import { useDeviceReadonly, useRestriction } from '../common/util/permissions';
-import usePersistedState from '../common/util/usePersistedState';
-import usePositionAttributes from '../common/attributes/usePositionAttributes';
-import { devicesActions } from '../store';
-import { useCatch, useCatchCallback } from '../reactHelper';
+import { useTranslation } from './LocalizationProvider';
+import RemoveDialog from './RemoveDialog';
+import PositionValue from './PositionValue';
+import { useDeviceReadonly, useRestriction } from '../util/permissions';
+import usePersistedState from '../util/usePersistedState';
+import usePositionAttributes from '../attributes/usePositionAttributes';
+import { devicesActions } from '../../store';
+import { useCatch, useCatchCallback } from '../../reactHelper';
const useStyles = makeStyles((theme) => ({
card: {
@@ -94,7 +94,7 @@ const StatusRow = ({ name, content }) => {
);
};
-const StatusCard = ({ deviceId, onClose }) => {
+const StatusCard = ({ deviceId, position, onClose }) => {
const classes = useStyles();
const navigate = useNavigate();
const dispatch = useDispatch();
@@ -104,7 +104,6 @@ const StatusCard = ({ deviceId, onClose }) => {
const deviceReadonly = useDeviceReadonly();
const device = useSelector((state) => state.devices.items[deviceId]);
- const position = useSelector((state) => state.positions.items[deviceId]);
const deviceImage = device?.attributes?.deviceImage;
diff --git a/modern/src/main/MainPage.js b/modern/src/main/MainPage.js
index 90e1b920..a174096e 100644
--- a/modern/src/main/MainPage.js
+++ b/modern/src/main/MainPage.js
@@ -25,7 +25,7 @@ import BottomMenu from '../common/components/BottomMenu';
import { useTranslation } from '../common/components/LocalizationProvider';
import PoiMap from '../map/main/PoiMap';
import MapPadding from '../map/MapPadding';
-import StatusCard from './StatusCard';
+import StatusCard from '../common/components/StatusCard';
import { devicesActions } from '../store';
import MapDefaultCamera from '../map/main/MapDefaultCamera';
import usePersistedState from '../common/util/usePersistedState';
@@ -370,6 +370,7 @@ const MainPage = () => {
<div className={classes.statusCard}>
<StatusCard
deviceId={selectedDeviceId}
+ position={positions[selectedDeviceId]}
onClose={() => dispatch(devicesActions.select(null))}
/>
</div>