Skip to content

Commit

Permalink
More details in the list
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Nov 17, 2024
1 parent 62d85d9 commit 1822e09
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/common/components/StatusCard.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';
import { useNavigate, Link as RouterLink } from 'react-router-dom';
import Draggable from 'react-draggable';
import {
Card,
Expand All @@ -15,6 +15,8 @@ import {
Menu,
MenuItem,
CardMedia,
TableFooter,
Link,
} from '@mui/material';
import makeStyles from '@mui/styles/makeStyles';
import CloseIcon from '@mui/icons-material/Close';
Expand Down Expand Up @@ -223,7 +225,17 @@ const StatusCard = ({ deviceId, position, onClose, disableActions, desktopPaddin
)}
/>
))}

Check failure on line 228 in src/common/components/StatusCard.jsx

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
</TableBody>
<TableFooter>
<TableRow>
<TableCell colSpan={2} className={classes.cell}>
<Typography variant="body2">
<Link component={RouterLink} underline="none" to={`/position/${position.id}`}>{t('sharedShowDetails')}</Link>
</Typography>
</TableCell>
</TableRow>
</TableFooter>
</Table>
</CardContent>
)}
Expand Down Expand Up @@ -267,13 +279,14 @@ const StatusCard = ({ deviceId, position, onClose, disableActions, desktopPaddin
</div>
{position && (
<Menu anchorEl={anchorEl} open={Boolean(anchorEl)} onClose={() => setAnchorEl(null)}>
<MenuItem onClick={() => navigate(`/position/${position.id}`)}><Typography color="secondary">{t('sharedShowDetails')}</Typography></MenuItem>
<MenuItem onClick={handleGeofence}>{t('sharedCreateGeofence')}</MenuItem>
<MenuItem component="a" target="_blank" href={`https://www.google.com/maps/search/?api=1&query=${position.latitude}%2C${position.longitude}`}>{t('linkGoogleMaps')}</MenuItem>
<MenuItem component="a" target="_blank" href={`http://maps.apple.com/?ll=${position.latitude},${position.longitude}`}>{t('linkAppleMaps')}</MenuItem>
<MenuItem component="a" target="_blank" href={`https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=${position.latitude}%2C${position.longitude}&heading=${position.course}`}>{t('linkStreetView')}</MenuItem>
{navigationAppTitle && <MenuItem component="a" target="_blank" href={navigationAppLink.replace('{latitude}', position.latitude).replace('{longitude}', position.longitude)}>{navigationAppTitle}</MenuItem>}
{!shareDisabled && !user.temporary && <MenuItem onClick={() => navigate(`/settings/device/${deviceId}/share`)}>{t('deviceShare')}</MenuItem>}
{!shareDisabled && !user.temporary && (
<MenuItem onClick={() => navigate(`/settings/device/${deviceId}/share`)}><Typography color="secondary">{t('deviceShare')}</Typography></MenuItem>
)}
</Menu>
)}
<RemoveDialog
Expand Down

0 comments on commit 1822e09

Please sign in to comment.