fix(ux): replace buggy margin-based centering with reliable flexbox wrapper to permanently center floating action bars
This commit is contained in:
1 parent
2097bc477a
commit
d5d79a1eda
1 file changed
+12
-4
@@ -2,6 +2,7 @@ import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Box from "@mui/material/Box";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
@@ -31,16 +32,22 @@ export const FloatingActionBar: React.FC<FloatingActionBarProps> = ({
|
||||
mountOnEnter
|
||||
unmountOnExit
|
||||
>
|
||||
<Paper
|
||||
elevation={6}
|
||||
<Box
|
||||
sx={{
|
||||
position: "fixed",
|
||||
bottom: theme.spacing(LAYOUT.XS),
|
||||
left: 0,
|
||||
right: 0,
|
||||
margin: "0 auto",
|
||||
width: "max-content",
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
pointerEvents: "none",
|
||||
zIndex: theme.zIndex.snackbar,
|
||||
}}
|
||||
>
|
||||
<Paper
|
||||
elevation={6}
|
||||
sx={{
|
||||
pointerEvents: "auto",
|
||||
px: LAYOUT.MD,
|
||||
py: LAYOUT.XS,
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
@@ -83,6 +90,7 @@ export const FloatingActionBar: React.FC<FloatingActionBarProps> = ({
|
||||
</Stack>
|
||||
)}
|
||||
</Paper>
|
||||
</Box>
|
||||
</Slide>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user