29 lines
894 B
TypeScript
29 lines
894 B
TypeScript
'use client'
|
|
|
|
import { Sidebar } from '@/components/Sidebar'
|
|
import { useTheme } from '@/lib/ThemeContext'
|
|
|
|
/**
|
|
* Shared layout for ALL /learn/* pages.
|
|
* Provides: Sidebar + gradient background + flex container.
|
|
* Individual pages only need to render their content.
|
|
*/
|
|
export default function LearnLayout({ children }: { children: React.ReactNode }) {
|
|
const { isDark } = useTheme()
|
|
|
|
return (
|
|
<div className={`min-h-screen flex relative overflow-hidden ${
|
|
isDark
|
|
? 'bg-gradient-to-br from-indigo-900 via-purple-900 to-pink-800'
|
|
: 'bg-gradient-to-br from-slate-100 via-blue-50 to-cyan-100'
|
|
}`}>
|
|
<div className="relative z-10 p-4 flex-shrink-0">
|
|
<Sidebar />
|
|
</div>
|
|
<div className="flex-1 flex flex-col relative z-10 overflow-y-auto scrollbar-hide" style={{ scrollbarWidth: 'none' }}>
|
|
{children}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|