From 88514a2ff053490b4342caeeaf5abf13355fc5d8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 4 Jul 2022 10:27:06 -0700 Subject: Better image layout (fix #678) --- modern/src/main/StatusCard.js | 45 ++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'modern/src/main') diff --git a/modern/src/main/StatusCard.js b/modern/src/main/StatusCard.js index e4734437..4067ac1e 100644 --- a/modern/src/main/StatusCard.js +++ b/modern/src/main/StatusCard.js @@ -26,7 +26,6 @@ import InfoIcon from '@mui/icons-material/Info'; import { useTranslation } from '../common/components/LocalizationProvider'; import RemoveDialog from '../common/components/RemoveDialog'; import PositionValue from '../common/components/PositionValue'; -import dimensions from '../common/theme/dimensions'; import { useDeviceReadonly, useReadonly } from '../common/util/permissions'; import usePersistedState from '../common/util/usePersistedState'; import usePositionAttributes from '../common/attributes/usePositionAttributes'; @@ -35,16 +34,26 @@ import { useCatch } from '../reactHelper'; const useStyles = makeStyles((theme) => ({ card: { - width: dimensions.popupMaxWidth, + width: theme.dimensions.popupMaxWidth, + }, + media: { + height: theme.dimensions.popupImageHeight, + display: 'flex', + justifyContent: 'flex-end', + alignItems: 'flex-start', + }, + mediaButton: { + color: theme.palette.colors.white, + mixBlendMode: 'difference', }, header: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', - padding: theme.spacing(1, 1, 1, 2), + padding: theme.spacing(1, 1, 0, 2), }, content: { - paddingTop: 0, + paddingTop: theme.spacing(1), paddingBottom: theme.spacing(1), }, negative: { @@ -121,21 +130,25 @@ const StatusCard = ({ deviceId, onClose }) => { <> {device && ( - {deviceImage && ( + {deviceImage ? ( + > + + + + + ) : ( +
+ + {device.name} + + + + +
)} -
- - {device.name} - - - - -
{position && ( -- cgit v1.2.3