mirror of https://github.com/MaxLeiter/Drift
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			35 lines
		
	
	
		
			811 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			35 lines
		
	
	
		
			811 B
		
	
	
	
		
			TypeScript
		
	
import "@styles/globals.css"
 | 
						|
import { LayoutWrapper } from "./root-layout-wrapper"
 | 
						|
import { getSession } from "@lib/server/session"
 | 
						|
import { ServerThemeProvider } from "@wits/next-themes"
 | 
						|
 | 
						|
interface RootLayoutProps {
 | 
						|
	children: React.ReactNode
 | 
						|
}
 | 
						|
 | 
						|
export default async function RootLayout({ children }: RootLayoutProps) {
 | 
						|
	// TODO: this opts out of SSG
 | 
						|
	const session = await getSession()
 | 
						|
	return (
 | 
						|
		<ServerThemeProvider
 | 
						|
			enableSystem={true}
 | 
						|
			disableTransitionOnChange
 | 
						|
			cookieName={"drift-theme"}
 | 
						|
			attribute="data-theme"
 | 
						|
			enableColorScheme={true}
 | 
						|
		>
 | 
						|
			<html lang="en">
 | 
						|
				<head />
 | 
						|
				<body>
 | 
						|
					<LayoutWrapper
 | 
						|
						signedIn={Boolean(session?.user)}
 | 
						|
						isAdmin={session?.user.role === "admin"}
 | 
						|
					>
 | 
						|
						{children}
 | 
						|
					</LayoutWrapper>
 | 
						|
				</body>
 | 
						|
			</html>
 | 
						|
		</ServerThemeProvider>
 | 
						|
	)
 | 
						|
}
 |