Skip to content

Commit 6dcbe69

Browse files
author
mpabarca
committed
Fix show SecondaryHeaderPlaceholder in Not Found page
1 parent f608678 commit 6dcbe69

File tree

1 file changed

+8
-11
lines changed
  • src/app/(authed)/(project-doc)/[...slug]

1 file changed

+8
-11
lines changed

src/app/(authed)/(project-doc)/[...slug]/layout.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,33 @@ import { Box, Stack } from "@mui/material"
44
import { useTheme } from "@mui/material/styles"
55
import TrailingToolbarItem from "@/features/projects/view/toolbar/TrailingToolbarItem"
66
import MobileToolbar from "@/features/projects/view/toolbar/MobileToolbar"
7-
import { useProjectSelection } from "@/features/projects/data"
87
import SecondaryHeaderPlaceholder from "@/features/sidebar/view/SecondarySplitHeaderPlaceholder"
9-
import SecondarySplitHeader from "@/features/sidebar/view/SecondarySplitHeader"
108
import { useContext } from "react"
119
import { ProjectsContext } from "@/common"
1210
import LoadingIndicator from "@/common/ui/LoadingIndicator"
11+
import SecondarySplitHeader from "@/features/sidebar/view/SecondarySplitHeader"
1312

1413
export default function Page({ children }: { children: React.ReactNode }) {
15-
const { project } = useProjectSelection()
1614
const { refreshed } = useContext(ProjectsContext)
1715

1816
const theme = useTheme()
1917

2018
return (
2119
<Stack sx={{ height: "100%" }}>
22-
{refreshed ?
2320
<>
24-
{project &&
21+
{!refreshed ? <SecondaryHeaderPlaceholder/> :
2522
<SecondarySplitHeader mobileToolbar={<MobileToolbar/>}>
2623
<TrailingToolbarItem/>
2724
</SecondarySplitHeader>
2825
}
29-
{!project && <SecondaryHeaderPlaceholder/>}
3026
<Box sx={{ height: "0.5px", background: theme.palette.divider }} />
31-
<main style={{ flexGrow: "1", overflowY: "auto" }}>
32-
{children}
33-
</main>
27+
{refreshed ?
28+
<main style={{ flexGrow: "1", overflowY: "auto" }}>
29+
{children}
30+
</main> :
31+
<LoadingIndicator />
32+
}
3433
</>
35-
: <LoadingIndicator />
36-
}
3734
</Stack>
3835
)
3936
}

0 commit comments

Comments
 (0)