clean routes
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import AlphaFooter from '@/components/alpha/AlphaFooter';
|
||||
import { AlphaNav } from '@/components/alpha/AlphaNav';
|
||||
import DevToolbar from '@/components/dev/DevToolbar';
|
||||
import { ApiErrorBoundary } from '@/components/errors/ApiErrorBoundary';
|
||||
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 { getAppMode } from '@/lib/mode';
|
||||
import { FeatureFlagService } from '@/lib/feature/FeatureFlagService';
|
||||
import { FeatureFlagProvider } from '@/lib/feature/FeatureFlagProvider';
|
||||
import { ServiceProvider } from '@/lib/services/ServiceProvider';
|
||||
import { initializeGlobalErrorHandling } from '@/lib/infrastructure/GlobalErrorHandler';
|
||||
import { initializeApiLogger } from '@/lib/infrastructure/ApiRequestLogger';
|
||||
@@ -54,8 +52,6 @@ export default async function RootLayout({
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const mode = getAppMode();
|
||||
|
||||
// Initialize debug tools in development
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
try {
|
||||
@@ -73,83 +69,52 @@ export default async function RootLayout({
|
||||
console.warn('Failed to initialize debug tools:', error);
|
||||
}
|
||||
}
|
||||
|
||||
if (mode === 'alpha') {
|
||||
//const session = await authService.getCurrentSession();
|
||||
const session = null;
|
||||
|
||||
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 min-h-screen bg-deep-graphite flex flex-col">
|
||||
<ServiceProvider>
|
||||
<AuthProvider initialSession={session}>
|
||||
<NotificationProvider>
|
||||
<NotificationIntegration />
|
||||
<EnhancedErrorBoundary enableDevOverlay={process.env.NODE_ENV === 'development'}>
|
||||
<AlphaNav />
|
||||
<main className="flex-1 max-w-7xl mx-auto px-6 py-8 w-full">
|
||||
{children}
|
||||
</main>
|
||||
<AlphaFooter />
|
||||
{/* Development Tools */}
|
||||
{process.env.NODE_ENV === 'development' && (
|
||||
<>
|
||||
<DevToolbar />
|
||||
</>
|
||||
)}
|
||||
</EnhancedErrorBoundary>
|
||||
</NotificationProvider>
|
||||
</AuthProvider>
|
||||
</ServiceProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
// 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">
|
||||
<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>
|
||||
<ServiceProvider>
|
||||
<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>
|
||||
</ServiceProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user