Skip to content

Commit eb88fec

Browse files
committed
feat(web): refactor layout to improve component structure and user experience
- Updated the layout to ensure the AppHeader is consistently rendered within the JobsProvider for authenticated users. - Simplified the conditional rendering logic for the AppHeader and children components, enhancing readability and maintainability. This change streamlines the layout structure, ensuring a cohesive user experience regardless of authentication status.
1 parent a4ce715 commit eb88fec

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

apps/web/src/app/layout.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,17 @@ export default async function RootLayout({
8686
<div className={wrappedTheme.backgroundOrbs.orbC} />
8787
<div className={wrappedTheme.backgroundOrbs.vignette} />
8888
</div>
89-
<AppHeader isAuthed={Boolean(user)} isAdmin={isAdmin} signOut={signOut} />
90-
{user ? <JobsProvider>{children}</JobsProvider> : children}
89+
{user ? (
90+
<JobsProvider>
91+
<AppHeader isAuthed={Boolean(user)} isAdmin={isAdmin} signOut={signOut} />
92+
{children}
93+
</JobsProvider>
94+
) : (
95+
<>
96+
<AppHeader isAuthed={Boolean(user)} isAdmin={isAdmin} signOut={signOut} />
97+
{children}
98+
</>
99+
)}
91100
<Toaster />
92101
</body>
93102
</html>

0 commit comments

Comments
 (0)