Skip to content

Commit

Permalink
Fix show SecondaryHeaderPlaceholder in Not Found page
Browse files Browse the repository at this point in the history
  • Loading branch information
mpabarca committed Oct 14, 2024
1 parent 686a1ab commit 14d9711
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/app/(authed)/(project-doc)/[...slug]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,33 @@ import { Box, Stack } from "@mui/material"
import { useTheme } from "@mui/material/styles"
import TrailingToolbarItem from "@/features/projects/view/toolbar/TrailingToolbarItem"
import MobileToolbar from "@/features/projects/view/toolbar/MobileToolbar"
import { useProjectSelection } from "@/features/projects/data"
import SecondaryHeaderPlaceholder from "@/features/sidebar/view/SecondarySplitHeaderPlaceholder"
import SecondarySplitHeader from "@/features/sidebar/view/SecondarySplitHeader"
import { useContext } from "react"
import { ProjectsContext } from "@/common"
import LoadingIndicator from "@/common/ui/LoadingIndicator"
import SecondarySplitHeader from "@/features/sidebar/view/SecondarySplitHeader"

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

const theme = useTheme()

return (
<Stack sx={{ height: "100%" }}>
{refreshed ?
<>
{project &&
{!refreshed ? <SecondaryHeaderPlaceholder/> :
<SecondarySplitHeader mobileToolbar={<MobileToolbar/>}>
<TrailingToolbarItem/>
</SecondarySplitHeader>
}
{!project && <SecondaryHeaderPlaceholder/>}
<Box sx={{ height: "0.5px", background: theme.palette.divider }} />
<main style={{ flexGrow: "1", overflowY: "auto" }}>
{children}
</main>
{refreshed ?
<main style={{ flexGrow: "1", overflowY: "auto" }}>
{children}
</main> :
<LoadingIndicator />
}
</>
: <LoadingIndicator />
}
</Stack>
)
}

0 comments on commit 14d9711

Please sign in to comment.