aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-18 17:19:20 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-18 17:19:20 -0700
commitf2529d17e6594eaa62f982629c6cf1079a254a84 (patch)
tree5992bb0af6b861e74374fc43a820c71f8d6c5476 /modern/src/common
parentc8d49e57b95e3e91e35740967e1197f251f0c754 (diff)
downloadtrackermap-web-f2529d17e6594eaa62f982629c6cf1079a254a84.tar.gz
trackermap-web-f2529d17e6594eaa62f982629c6cf1079a254a84.tar.bz2
trackermap-web-f2529d17e6594eaa62f982629c6cf1079a254a84.zip
Unify status card styles
Diffstat (limited to 'modern/src/common')
-rw-r--r--modern/src/common/components/StatusCard.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/modern/src/common/components/StatusCard.js b/modern/src/common/components/StatusCard.js
index 6b8a9fd3..c6ab1f51 100644
--- a/modern/src/common/components/StatusCard.js
+++ b/modern/src/common/components/StatusCard.js
@@ -77,6 +77,20 @@ const useStyles = makeStyles((theme) => ({
actions: {
justifyContent: 'space-between',
},
+ root: ({ desktopPadding }) => ({
+ position: 'fixed',
+ zIndex: 5,
+ left: '50%',
+ [theme.breakpoints.up('md')]: {
+ left: `calc(50% + ${desktopPadding} / 2)`,
+ bottom: theme.spacing(3),
+ },
+ [theme.breakpoints.down('md')]: {
+ left: '50%',
+ bottom: `calc(${theme.spacing(3)} + ${theme.dimensions.bottomBarHeight}px)`,
+ },
+ transform: 'translateX(-50%)',
+ }),
}));
const StatusRow = ({ name, content }) => {
@@ -94,8 +108,8 @@ const StatusRow = ({ name, content }) => {
);
};
-const StatusCard = ({ deviceId, position, onClose, disableActions }) => {
- const classes = useStyles();
+const StatusCard = ({ deviceId, position, onClose, disableActions, desktopPadding = 0 }) => {
+ const classes = useStyles({ desktopPadding });
const navigate = useNavigate();
const dispatch = useDispatch();
const t = useTranslation();
@@ -153,7 +167,7 @@ const StatusCard = ({ deviceId, position, onClose, disableActions }) => {
}, [navigate]);
return (
- <>
+ <div className={classes.root}>
{device && (
<Draggable
handle={`.${classes.media}, .${classes.header}`}
@@ -259,7 +273,7 @@ const StatusCard = ({ deviceId, position, onClose, disableActions }) => {
itemId={deviceId}
onResult={(removed) => handleRemove(removed)}
/>
- </>
+ </div>
);
};