124 lines
4.7 KiB
TypeScript
124 lines
4.7 KiB
TypeScript
import DevToolbar from '@/components/dev/DevToolbar';
|
|
import { EnhancedErrorBoundary } from '@/components/errors/EnhancedErrorBoundary';
|
|
import { NotificationIntegration } from '@/components/errors/NotificationIntegration';
|
|
import NotificationProvider from '@/components/notifications/NotificationProvider';
|
|
import { AuthProvider } from '@/lib/auth/AuthContext';
|
|
import { FeatureFlagService } from '@/lib/feature/FeatureFlagService';
|
|
import { FeatureFlagProvider } from '@/lib/feature/FeatureFlagProvider';
|
|
import { ContainerProvider } from '@/lib/di/providers/ContainerProvider';
|
|
import { QueryClientProvider } from '@/lib/providers/QueryClientProvider';
|
|
import { initializeGlobalErrorHandling } from '@/lib/infrastructure/GlobalErrorHandler';
|
|
import { initializeApiLogger } from '@/lib/infrastructure/ApiRequestLogger';
|
|
import { Metadata, Viewport } from 'next';
|
|
import Image from 'next/image';
|
|
import Link from 'next/link';
|
|
import React from 'react';
|
|
import './globals.css';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export const viewport: Viewport = {
|
|
width: 'device-width',
|
|
initialScale: 1,
|
|
maximumScale: 1,
|
|
userScalable: false,
|
|
viewportFit: 'cover',
|
|
};
|
|
|
|
export const metadata: Metadata = {
|
|
title: 'GridPilot - SimRacing Platform',
|
|
description: 'The dedicated home for serious sim racing leagues. Automatic results, standings, team racing, and professional race control.',
|
|
themeColor: '#0a0a0a',
|
|
appleWebApp: {
|
|
capable: true,
|
|
statusBarStyle: 'black-translucent',
|
|
},
|
|
openGraph: {
|
|
title: 'GridPilot - iRacing League Racing Platform',
|
|
description: 'Structure over chaos. The professional platform for iRacing league racing.',
|
|
type: 'website',
|
|
},
|
|
twitter: {
|
|
card: 'summary_large_image',
|
|
title: 'GridPilot - iRacing League Racing Platform',
|
|
description: 'Structure over chaos. The professional platform for iRacing league racing.',
|
|
},
|
|
icons: {
|
|
icon: '/favicon.svg',
|
|
},
|
|
};
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
// Initialize debug tools in development
|
|
if (process.env.NODE_ENV === 'development') {
|
|
try {
|
|
initializeGlobalErrorHandling({
|
|
showDevOverlay: true,
|
|
verboseLogging: true,
|
|
captureEnhancedStacks: true,
|
|
});
|
|
initializeApiLogger({
|
|
logToConsole: true,
|
|
logBodies: true,
|
|
logResponses: true,
|
|
});
|
|
} catch (error) {
|
|
console.warn('Failed to initialize debug tools:', error);
|
|
}
|
|
}
|
|
|
|
// Initialize feature flag service
|
|
const featureService = FeatureFlagService.fromEnv();
|
|
const enabledFlags = featureService.getEnabledFlags();
|
|
|
|
return (
|
|
<html lang="en" className="scroll-smooth overflow-x-hidden">
|
|
<head>
|
|
<meta name="mobile-web-app-capable" content="yes" />
|
|
</head>
|
|
<body className="antialiased overflow-x-hidden">
|
|
<ContainerProvider>
|
|
<QueryClientProvider>
|
|
<AuthProvider>
|
|
<FeatureFlagProvider flags={enabledFlags}>
|
|
<NotificationProvider>
|
|
<NotificationIntegration />
|
|
<EnhancedErrorBoundary enableDevOverlay={process.env.NODE_ENV === 'development'}>
|
|
<header className="fixed top-0 left-0 right-0 z-50 bg-deep-graphite/80 backdrop-blur-sm border-b border-white/5">
|
|
<div className="max-w-7xl mx-auto px-6 py-4">
|
|
<div className="flex items-center justify-between">
|
|
<div className="flex items-center space-x-3">
|
|
<Link href="/" className="inline-flex items-center">
|
|
<Image
|
|
src="/images/logos/wordmark-rectangle-dark.svg"
|
|
alt="GridPilot"
|
|
width={160}
|
|
height={30}
|
|
className="h-6 w-auto md:h-8"
|
|
priority
|
|
/>
|
|
</Link>
|
|
<p className="hidden sm:block text-sm text-gray-400 font-light">
|
|
Making league racing less chaotic
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div className="pt-16">{children}</div>
|
|
{/* Development Tools */}
|
|
{process.env.NODE_ENV === 'development' && <DevToolbar />}
|
|
</EnhancedErrorBoundary>
|
|
</NotificationProvider>
|
|
</FeatureFlagProvider>
|
|
</AuthProvider>
|
|
</QueryClientProvider>
|
|
</ContainerProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
} |