Session 13: The Slate, Africa geo-restriction, OAuth providers, PropRow + GameCard (1311 tests)
This commit is contained in:
@@ -14,7 +14,7 @@ import CookieConsent from '@/components/CookieConsent';
|
||||
import SentryInit from '@/components/SentryInit';
|
||||
import { LocaleProvider } from '@/contexts/LocaleContext';
|
||||
import { headers } from 'next/headers';
|
||||
import { LOCALE_HEADER, isLocale, DEFAULT_LOCALE, LOCALE_META } from '@/lib/locales';
|
||||
import { LOCALE_HEADER, COUNTRY_HEADER, isLocale, DEFAULT_LOCALE, LOCALE_META } from '@/lib/locales';
|
||||
import './globals.css';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
@@ -97,6 +97,10 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
const localeHeader = hdrs.get(LOCALE_HEADER);
|
||||
const locale = isLocale(localeHeader) ? localeHeader : DEFAULT_LOCALE;
|
||||
const dir = LOCALE_META[locale].dir;
|
||||
// Session 13 — country from CF-IPCountry (set by middleware).
|
||||
// Empty string when traffic bypasses Cloudflare (local dev, direct
|
||||
// origin hits). The Africa-tier gate degrades closed on empty.
|
||||
const country = hdrs.get(COUNTRY_HEADER) || '';
|
||||
|
||||
return (
|
||||
<html lang={locale} dir={dir} className="dark">
|
||||
@@ -109,7 +113,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
/>
|
||||
</head>
|
||||
<body className="antialiased tex-grain">
|
||||
<LocaleProvider locale={locale}>
|
||||
<LocaleProvider locale={locale} country={country}>
|
||||
<PostHogProvider>
|
||||
<AuthProvider>
|
||||
<ExplainModeProvider>
|
||||
|
||||
Reference in New Issue
Block a user