Files
breakpilot-lehrer/studio-v2/app/learn/layout.tsx
Benjamin Admin d14826b199 Fix: Build error + explanation above exercise + aligned columns + impressum link
1. Removed stale 'explanations' export that broke build
2. Explanation banner now spans full width ABOVE the 2/3+1/3 layout
   so exercise cards and native words start at the same height
3. Both columns use items-start for visual alignment
4. Impressum link added at bottom of learn layout

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 14:54:12 +02:00

44 lines
1.5 KiB
TypeScript

'use client'
import { Sidebar } from '@/components/Sidebar'
import { useTheme } from '@/lib/ThemeContext'
import { useNativeLanguage } from '@/lib/useNativeLanguage'
import { LanguageSwitcher } from '@/components/learn/LanguageSwitcher'
/**
* Shared layout for ALL /learn/* pages.
* Provides: Sidebar + gradient background + language switcher.
*/
export default function LearnLayout({ children }: { children: React.ReactNode }) {
const { isDark } = useTheme()
const { nativeLang, setNativeLang, isThirdLanguage } = useNativeLanguage()
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' }}>
{/* Sticky language switcher at top-right */}
<div className="sticky top-0 z-20 flex justify-end px-4 py-2">
<LanguageSwitcher
currentLang={nativeLang}
onLangChange={setNativeLang}
isDark={isDark}
/>
</div>
{children}
<div className="text-center py-4">
<a href="/impressum" className={`text-[10px] ${isDark ? 'text-white/20 hover:text-white/40' : 'text-slate-300 hover:text-slate-500'}`}>
Impressum
</a>
</div>
</div>
</div>
)
}