diff --git a/maternal-web/app/track/page.tsx b/maternal-web/app/track/page.tsx index dfd515b..6382cc2 100644 --- a/maternal-web/app/track/page.tsx +++ b/maternal-web/app/track/page.tsx @@ -55,9 +55,9 @@ export default function TrackPage() { {t('selectActivity')} - + {trackingOptions.map((option) => ( - + - + {option.icon} - + {option.title} diff --git a/maternal-web/components/features/analytics/InsightsDashboard.tsx b/maternal-web/components/features/analytics/InsightsDashboard.tsx index 20c7253..a970a67 100644 --- a/maternal-web/components/features/analytics/InsightsDashboard.tsx +++ b/maternal-web/components/features/analytics/InsightsDashboard.tsx @@ -363,8 +363,8 @@ export const InsightsDashboard: React.FC = () => { animate={{ opacity: 1, scale: 1 }} transition={{ duration: 0.3, delay: 0 }} > - - + + @@ -388,8 +388,8 @@ export const InsightsDashboard: React.FC = () => { animate={{ opacity: 1, scale: 1 }} transition={{ duration: 0.3, delay: 0.1 }} > - - + + @@ -413,8 +413,8 @@ export const InsightsDashboard: React.FC = () => { animate={{ opacity: 1, scale: 1 }} transition={{ duration: 0.3, delay: 0.2 }} > - - + + @@ -438,8 +438,8 @@ export const InsightsDashboard: React.FC = () => { animate={{ opacity: 1, scale: 1 }} transition={{ duration: 0.3, delay: 0.3 }} > - - + + @@ -461,8 +461,8 @@ export const InsightsDashboard: React.FC = () => { {/* Charts */} - - + + @@ -483,8 +483,8 @@ export const InsightsDashboard: React.FC = () => { - - + + @@ -513,8 +513,8 @@ export const InsightsDashboard: React.FC = () => { {diaperData.length > 0 && ( - - + + @@ -546,8 +546,8 @@ export const InsightsDashboard: React.FC = () => { )} 0 ? 6 : 12}> - - + + diff --git a/maternal-web/lib/auth/AuthContext.tsx b/maternal-web/lib/auth/AuthContext.tsx index 3bcb4d4..03d8498 100644 --- a/maternal-web/lib/auth/AuthContext.tsx +++ b/maternal-web/lib/auth/AuthContext.tsx @@ -28,6 +28,9 @@ export interface RegisterData { password: string; name: string; role?: string; + dateOfBirth: string; // COPPA compliance - required + parentalEmail?: string; // For users 13-17 + coppaConsentGiven?: boolean; // For users 13-17 } interface AuthContextType { @@ -144,13 +147,26 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => { // Auto-detect timezone from user's device const detectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone; - const response = await apiClient.post('/api/v1/auth/register', { + const payload: any = { email: data.email, password: data.password, name: data.name, timezone: detectedTimezone || 'UTC', + dateOfBirth: data.dateOfBirth, deviceInfo, - }); + }; + + // Add optional COPPA fields if provided + if (data.parentalEmail) { + payload.parentalEmail = data.parentalEmail; + } + if (data.coppaConsentGiven !== undefined) { + payload.coppaConsentGiven = data.coppaConsentGiven; + } + + console.log('[Auth] Registration payload:', JSON.stringify(payload, null, 2)); + + const response = await apiClient.post('/api/v1/auth/register', payload); // Backend returns { success, data: { user, family, tokens } } const { data: responseData } = response.data;