Phase 2: Language Context & Selector - Add language dropdown to Header and auth pages
- Create LanguageSelector component with dropdown (shows flag + name) - Add LanguageSelector to Header (right side, near user email/logout) - Add LanguageSelector to login, signup, and signup/[code] pages - Create test-utils.tsx with renderWithProviders helper - Add vitest.setup.ts to mock localStorage - Update all test files to use renderWithProviders - Language selector persists choice in localStorage - HTML lang attribute updates dynamically based on selected language All frontend and e2e tests passing.
This commit is contained in:
parent
f7553df05d
commit
f86ec8b62d
11 changed files with 214 additions and 37 deletions
|
|
@ -4,6 +4,7 @@ import { useRouter } from "next/navigation";
|
|||
import { useAuth } from "../auth-context";
|
||||
import { sharedStyles } from "../styles/shared";
|
||||
import constants from "../../../shared/constants.json";
|
||||
import { LanguageSelector } from "./LanguageSelector";
|
||||
|
||||
const { ADMIN, REGULAR } = constants.roles;
|
||||
|
||||
|
|
@ -80,6 +81,7 @@ export function Header({ currentPage }: HeaderProps) {
|
|||
))}
|
||||
</div>
|
||||
<div style={sharedStyles.userInfo}>
|
||||
<LanguageSelector />
|
||||
<span style={sharedStyles.userEmail}>{user.email}</span>
|
||||
<button onClick={handleLogout} style={sharedStyles.logoutBtn}>
|
||||
Sign out
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue