diff --git a/apps/frontend/src/app/[locale]/courses/page.tsx b/apps/frontend/src/app/[locale]/courses/page.tsx index e4e5db0..3787c4b 100644 --- a/apps/frontend/src/app/[locale]/courses/page.tsx +++ b/apps/frontend/src/app/[locale]/courses/page.tsx @@ -14,13 +14,30 @@ export default function CoursesPage() { return (
-

{t('title')}

- {/* List semantics so screen readers announce item count */} -
+
); } diff --git a/apps/frontend/src/app/[locale]/page.tsx b/apps/frontend/src/app/[locale]/page.tsx index db81cba..c66192f 100644 --- a/apps/frontend/src/app/[locale]/page.tsx +++ b/apps/frontend/src/app/[locale]/page.tsx @@ -8,25 +8,33 @@ export default function HomePage() { return (
-

{t('title')}

-

- {t('description')} -

-
- - {t('browseCourses')} - - - {t('getStarted')} - -
-
+

{t('title')}

+

+ {t('description')} +

+
+ + {t('browseCourses')} + + +

+ {t('description')} +

+
+ + {t('browseCourses')} + + + {t('getStarted')} + +
+ ); } diff --git a/apps/frontend/src/lib/auth-context.tsx b/apps/frontend/src/lib/auth-context.tsx index b3063e5..1730e63 100644 --- a/apps/frontend/src/lib/auth-context.tsx +++ b/apps/frontend/src/lib/auth-context.tsx @@ -1,3 +1,5 @@ +'use client'; + import React, { createContext, useContext, useReducer, useEffect, ReactNode } from 'react'; interface AuthUser { @@ -21,6 +23,7 @@ type AuthAction = | { type: 'LOGOUT' } | { type: 'SET_USER'; payload: AuthUser }; +const authReducer = (state: AuthState, action: AuthAction): AuthState => { const decodeJWT = (token: string) => { try { const payload = JSON.parse(atob(token.split('.')[1])); @@ -45,6 +48,15 @@ const decodeJWT = (token: string) => { } }; +const decodeJWT = (token: string) => { + try { + const payload = JSON.parse(atob(token.split('.')[1])); + return payload; + } catch { + return null; + } +}; + const AuthContext = createContext<{ state: AuthState; dispatch: React.Dispatch;