This commit is contained in:
seb
2026-10-11 15:01:26 +02:00
parent 95523ce9f3
commit a96a80a036

View File

@@ -1,6 +1,7 @@
import { useCallback, useEffect, useRef, useState } from 'react';
import Box from '@mui/material/Box';
import IconButton from '@mui/material/IconButton';
import Portal from '@mui/material/Portal';
import MapRoundedIcon from '@mui/icons-material/MapRounded';
import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
@@ -202,18 +203,19 @@ export default function PageMinimap({ sourceSelector = 'main' }) {
// Collapsed: a single centered pill to reopen the overview.
if (!open) {
return (
<Box
sx={{
position: 'fixed',
left: '50%',
bottom: 16,
transform: 'translateX(-50%)',
zIndex: 1300,
opacity: visible ? 1 : 0,
transition: 'opacity 300ms ease',
pointerEvents: visible ? 'auto' : 'none',
}}
>
<Portal>
<Box
sx={{
position: 'fixed',
left: '50%',
bottom: 16,
transform: 'translateX(-50%)',
zIndex: 1300,
opacity: visible ? 1 : 0,
transition: 'opacity 300ms ease',
pointerEvents: visible ? 'auto' : 'none',
}}
>
<IconButton
type="button"
size="small"
@@ -230,12 +232,14 @@ export default function PageMinimap({ sourceSelector = 'main' }) {
>
<MapRoundedIcon fontSize="small" />
</IconButton>
</Box>
</Box>
</Portal>
);
}
return (
<Box
<Portal>
<Box
sx={{
position: 'fixed',
left: '50%',
@@ -366,5 +370,6 @@ export default function PageMinimap({ sourceSelector = 'main' }) {
</Box>
</Box>
</Box>
);
</Portal>
);
}