Skip to content

Commit e8cfdad

Browse files
committed
fix: fix layout shift caused by navigation progress bar
1 parent 631f10a commit e8cfdad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/layouts/Layout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ const Layout = ({ children }: LayoutProps) => {
1717
return (
1818
<Box sx={{ display: "flex", flexDirection: "column", minHeight: "100vh" }}>
1919
<Header />
20-
{!!isTransitioning && <LinearProgress />}
20+
{/* Reserve space for the LinearProgress to avoid layout shift */}
21+
<Box sx={{ minHeight: 4 }}>
22+
{!!isTransitioning && <LinearProgress />}
23+
</Box>
2124
{/* <Slide appear direction="right" in={!isTransitioning}> */}
2225
<Box component="main" sx={{ paddingY: 2 }}>
2326
{children}

0 commit comments

Comments
 (0)