From 14d971160a511653c4bb3de0588fe6140d7944b2 Mon Sep 17 00:00:00 2001 From: mpabarca Date: Mon, 7 Oct 2024 15:27:12 +0200 Subject: [PATCH] Fix show SecondaryHeaderPlaceholder in Not Found page --- .../(project-doc)/[...slug]/layout.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/app/(authed)/(project-doc)/[...slug]/layout.tsx b/src/app/(authed)/(project-doc)/[...slug]/layout.tsx index 34796836..98306516 100644 --- a/src/app/(authed)/(project-doc)/[...slug]/layout.tsx +++ b/src/app/(authed)/(project-doc)/[...slug]/layout.tsx @@ -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 ( - {refreshed ? <> - {project && + {!refreshed ? : }> } - {!project && } -
- {children} -
+ {refreshed ? +
+ {children} +
: + + } - : - }
) } \ No newline at end of file