Added Redux Provider to app layout and simplified Redux store to work properly with Next.js SSR. **Changes:** - Added ReduxProvider wrapper to root layout (app/layout.tsx) - Fixed ReduxProvider TypeScript type (React.ReactNode) - Simplified store configuration by removing @redux-offline package - Removed packages incompatible with SSR: - @redux-offline/redux-offline - redux-persist - localforage - Re-added NetworkStatusIndicator to main page (now works with Redux) - Kept custom offline middleware and sync middleware for offline-first functionality **Why:** The @redux-offline package and localforage try to access browser APIs (IndexedDB, localStorage) during SSR, causing "No available storage method found" errors. Our custom offline middleware provides the same functionality without SSR issues. **Result:** Redux store now works correctly with: - Network status detection - Offline action queuing - Custom sync middleware - Activities and children slices with optimistic updates Next step: Can add redux-persist back with proper SSR guards if needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
import type { Metadata } from 'next';
|
|
import { Inter } from 'next/font/google';
|
|
import { ThemeRegistry } from '@/components/ThemeRegistry';
|
|
import { ErrorBoundary } from '@/components/common/ErrorBoundary';
|
|
import { ReduxProvider } from '@/components/providers/ReduxProvider';
|
|
// import { PerformanceMonitor } from '@/components/common/PerformanceMonitor'; // Temporarily disabled
|
|
import './globals.css';
|
|
|
|
const inter = Inter({ subsets: ['latin'] });
|
|
|
|
export const metadata: Metadata = {
|
|
title: 'Maternal - AI-Powered Child Care Assistant',
|
|
description: 'Track, analyze, and get AI-powered insights for your child\'s development, sleep, feeding, and more.',
|
|
manifest: '/manifest.json',
|
|
themeColor: '#FFB6C1',
|
|
viewport: {
|
|
width: 'device-width',
|
|
initialScale: 1,
|
|
maximumScale: 1,
|
|
userScalable: false,
|
|
},
|
|
appleWebApp: {
|
|
capable: true,
|
|
statusBarStyle: 'default',
|
|
title: 'Maternal',
|
|
},
|
|
};
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
return (
|
|
<html lang="en">
|
|
<head>
|
|
<link rel="manifest" href="/manifest.json" />
|
|
<meta name="theme-color" content="#FFB6C1" />
|
|
<link rel="apple-touch-icon" href="/icon-192x192.png" />
|
|
</head>
|
|
<body className={inter.className}>
|
|
<ErrorBoundary>
|
|
<ReduxProvider>
|
|
<ThemeRegistry>
|
|
{/* <PerformanceMonitor /> */}
|
|
{children}
|
|
</ThemeRegistry>
|
|
</ReduxProvider>
|
|
</ErrorBoundary>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|