I am trying to make a bloglike application using next.js 13 and sanity for the CMS. I have created a navbar that I would like to only show on the standard page but not on the stanity studio page. The app looks as it should on initial load, however, if I navigate to the /studio the nav is there. If I then go back to the app using a navigation button the page loads but without the navbar. Here is the folder structure from the app directory.
| head.tsx
|
+---(admin)
| | layout.tsx
| |
| \---studio
| \---[[...index]]
| head.tsx
| loading.tsx
| page.tsx
|
\---(user)
layout.tsx
page.tsx
Here is the app(user)\layout.tsx
import Header from '@/components/Header'
import '../../styles/globals.css'
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html>
<body>
<Header />
{children}
</body>
</html>
)
}
Here is the app(admin)\layout.tsx
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html>
<body>
{children}
</body>
</html>
)
}
My understanding was that having a layout for the admin and one for the user, the former without the and the latter with would mean it would only show in one. The documentation for Next.js is a little confused at the moment due to the changes brought in in 13.