From 8f35d7f5655c5f5652936614bca48482ff48fb28 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 21 Jan 2023 12:23:50 -0800 Subject: Fix card events (fix #1076) --- modern/src/common/components/StatusCard.js | 176 +++++++++++++++-------------- 1 file changed, 90 insertions(+), 86 deletions(-) (limited to 'modern/src/common/components') diff --git a/modern/src/common/components/StatusCard.js b/modern/src/common/components/StatusCard.js index 0c1ea492..386dd3f1 100644 --- a/modern/src/common/components/StatusCard.js +++ b/modern/src/common/components/StatusCard.js @@ -35,6 +35,7 @@ import { useAttributePreference } from '../util/preferences'; const useStyles = makeStyles((theme) => ({ card: { + pointerEvents: 'auto', width: theme.dimensions.popupMaxWidth, }, media: { @@ -78,6 +79,7 @@ const useStyles = makeStyles((theme) => ({ justifyContent: 'space-between', }, root: ({ desktopPadding }) => ({ + pointerEvents: 'none', position: 'fixed', zIndex: 5, left: '50%', @@ -167,97 +169,99 @@ const StatusCard = ({ deviceId, position, onClose, disableActions, desktopPaddin }, [navigate, position]); return ( -
- {device && ( - - - {deviceImage ? ( - + <> +
+ {device && ( + + + {deviceImage ? ( + + + + + + ) : ( +
+ + {device.name} + + + + +
+ )} + {position && ( + + + + {positionItems.split(',').filter((key) => position.hasOwnProperty(key) || position.attributes.hasOwnProperty(key)).map((key) => ( + + )} + /> + ))} + +
+
+ )} + setAnchorEl(e.currentTarget)} + disabled={!position} > - + - - ) : ( -
- - {device.name} - navigate('/replay')} + disabled={disableActions || !position} > - + -
- )} - {position && ( - - - - {positionItems.split(',').filter((key) => position.hasOwnProperty(key) || position.attributes.hasOwnProperty(key)).map((key) => ( - - )} - /> - ))} - -
-
- )} - - setAnchorEl(e.currentTarget)} - disabled={!position} - > - - - navigate('/replay')} - disabled={disableActions || !position} - > - - - navigate(`/settings/command-send/${deviceId}`)} - disabled={disableActions || readonly} - > - - - navigate(`/settings/device/${deviceId}`)} - disabled={disableActions || deviceReadonly} - > - - - setRemoving(true)} - disabled={disableActions || deviceReadonly} - className={classes.negative} - > - - - -
-
- )} + navigate(`/settings/command-send/${deviceId}`)} + disabled={disableActions || readonly} + > + + + navigate(`/settings/device/${deviceId}`)} + disabled={disableActions || deviceReadonly} + > + + + setRemoving(true)} + disabled={disableActions || deviceReadonly} + className={classes.negative} + > + + + + + + )} +
{position && ( setAnchorEl(null)}> navigate(`/position/${position.id}`)}>{t('sharedShowDetails')} @@ -273,7 +277,7 @@ const StatusCard = ({ deviceId, position, onClose, disableActions, desktopPaddin itemId={deviceId} onResult={(removed) => handleRemove(removed)} /> -
+ ); }; -- cgit v1.2.3