aboutsummaryrefslogtreecommitdiff
path: root/modern/src/StatusView.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-09-28 20:43:47 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-09-28 20:43:47 -0700
commit94e8c40f52b239562aded5e70e334ddbb2eea23b (patch)
treebd5d8b9425a08ac055f0617818e6e54930c4d557 /modern/src/StatusView.js
parent9d72339c8365da80154f635dc8184b135a53bab0 (diff)
downloadtrackermap-web-94e8c40f52b239562aded5e70e334ddbb2eea23b.tar.gz
trackermap-web-94e8c40f52b239562aded5e70e334ddbb2eea23b.tar.bz2
trackermap-web-94e8c40f52b239562aded5e70e334ddbb2eea23b.zip
Page for all attributes
Diffstat (limited to 'modern/src/StatusView.js')
-rw-r--r--modern/src/StatusView.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/modern/src/StatusView.js b/modern/src/StatusView.js
index 61fd1504..0713d47e 100644
--- a/modern/src/StatusView.js
+++ b/modern/src/StatusView.js
@@ -3,9 +3,14 @@ import React from 'react';
import { useSelector } from 'react-redux';
import { formatPosition } from './common/formatter';
-const StatusView = (props) => {
- const device = useSelector(state => state.devices.items[props.deviceId]);
- const position = useSelector(state => state.positions.items[props.deviceId]);
+const StatusView = ({ deviceId, onShowDetails }) => {
+ const device = useSelector(state => state.devices.items[deviceId]);
+ const position = useSelector(state => state.positions.items[deviceId]);
+
+ const handleClick = e => {
+ e.preventDefault();
+ onShowDetails(position.id);
+ };
return (
<>
@@ -17,6 +22,7 @@ const StatusView = (props) => {
{position.attributes.batteryLevel &&
<><b>{t('positionBattery')}:</b> {formatPosition(position.attributes.batteryLevel, 'batteryLevel')}<br /></>
}
+ <a href="#" onClick={handleClick}>{t('sharedShowDetails')}</a>
</>
);
};