fix: amélioration accessibilité WAVE - corrections multiples

- Ajout h2 sr-only dans Footer, login, register, forgot-password pour hiérarchie titres
- Correction contraste TicketTableRow (text-gray-700)
- Correction contraste StatusBadge (couleurs -900)
- Correction contraste page jeux (text-gray-700)
- Correction labels orphelins page profil (label → span)
- Mise à jour FAQContent

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
soufiane 2025-12-08 15:06:30 +01:00
parent 54a15d392c
commit 618b689091
9 changed files with 43 additions and 32 deletions

View File

@ -198,7 +198,9 @@ export default function FAQContent() {
{/* FAQ Questions */} {/* FAQ Questions */}
<section className="py-12 md:py-16"> <section className="py-12 md:py-16">
<div className="container mx-auto px-4"> <div className="container mx-auto px-4">
<div className="max-w-3xl mx-auto space-y-4"> <div className="max-w-3xl mx-auto">
<h2 className="sr-only">Liste des questions fréquentes</h2>
<div className="space-y-4">
{filteredFAQs.length === 0 ? ( {filteredFAQs.length === 0 ? (
<div className="bg-white rounded-2xl shadow-sm p-12 text-center"> <div className="bg-white rounded-2xl shadow-sm p-12 text-center">
<div className="w-16 h-16 bg-[#2d4a3e]/10 rounded-full flex items-center justify-center mx-auto mb-4"> <div className="w-16 h-16 bg-[#2d4a3e]/10 rounded-full flex items-center justify-center mx-auto mb-4">
@ -255,6 +257,7 @@ export default function FAQContent() {
</div> </div>
)) ))
)} )}
</div>
</div> </div>
</div> </div>
</section> </section>

View File

@ -104,6 +104,8 @@ export default function ForgotPasswordPage() {
{/* Form Container */} {/* Form Container */}
<div className="p-8"> <div className="p-8">
{/* Hidden h2 for accessibility - maintains heading hierarchy */}
<h2 className="sr-only">Formulaire de réinitialisation</h2>
{/* Error Message */} {/* Error Message */}
{error && ( {error && (

View File

@ -158,7 +158,7 @@ export default function JeuxPage() {
</Link> </Link>
</div> </div>
)} )}
<p className="mt-2 text-sm text-beige-600 text-center"> <p className="mt-2 text-sm text-gray-700 text-center">
Format: TTP2025ABC (10 caractères) Format: TTP2025ABC (10 caractères)
</p> </p>
</div> </div>

View File

@ -110,6 +110,8 @@ export default function LoginPage() {
{/* Form Container */} {/* Form Container */}
<div className="p-8"> <div className="p-8">
{/* Hidden h2 for accessibility - maintains heading hierarchy */}
<h2 className="sr-only">Formulaire de connexion</h2>
{/* Login Form */} {/* Login Form */}
<form onSubmit={handleSubmit(onSubmit)} className="space-y-5"> <form onSubmit={handleSubmit(onSubmit)} className="space-y-5">

View File

@ -128,35 +128,35 @@ export default function ProfilePage() {
{!isEditing ? ( {!isEditing ? (
<div className="space-y-4"> <div className="space-y-4">
<div> <div>
<label className="text-sm font-medium text-gray-600"> <span className="text-sm font-medium text-gray-700 block">
Prénom Prénom
</label> </span>
<p className="text-lg text-gray-800">{user.firstName}</p> <p className="text-lg text-gray-800">{user.firstName}</p>
</div> </div>
<div> <div>
<label className="text-sm font-medium text-gray-600"> <span className="text-sm font-medium text-gray-700 block">
Nom Nom
</label> </span>
<p className="text-lg text-gray-800">{user.lastName}</p> <p className="text-lg text-gray-800">{user.lastName}</p>
</div> </div>
<div> <div>
<label className="text-sm font-medium text-gray-600"> <span className="text-sm font-medium text-gray-700 block">
Email Email
</label> </span>
<p className="text-lg text-gray-800">{user.email}</p> <p className="text-lg text-gray-800">{user.email}</p>
</div> </div>
<div> <div>
<label className="text-sm font-medium text-gray-600"> <span className="text-sm font-medium text-gray-700 block">
Téléphone Téléphone
</label> </span>
<p className="text-lg text-gray-800"> <p className="text-lg text-gray-800">
{user.phone || "Non renseigné"} {user.phone || "Non renseigné"}
</p> </p>
</div> </div>
<div> <div>
<label className="text-sm font-medium text-gray-600"> <span className="text-sm font-medium text-gray-700 block">
Rôle Rôle
</label> </span>
<div className="mt-1"> <div className="mt-1">
<Badge variant={getRoleBadgeVariant(user.role)}> <Badge variant={getRoleBadgeVariant(user.role)}>
{getRoleLabel(user.role)} {getRoleLabel(user.role)}
@ -242,9 +242,9 @@ export default function ProfilePage() {
</div> </div>
<div className="p-6 space-y-4"> <div className="p-6 space-y-4">
<div> <div>
<label className="text-sm font-medium text-gray-600"> <span className="text-sm font-medium text-gray-700 block">
Membre depuis Membre depuis
</label> </span>
<p className="text-sm text-gray-800 mt-1"> <p className="text-sm text-gray-800 mt-1">
{formatDate(user.createdAt)} {formatDate(user.createdAt)}
</p> </p>

View File

@ -129,6 +129,8 @@ export default function RegisterPage() {
{/* Form Container */} {/* Form Container */}
<div className="p-8"> <div className="p-8">
{/* Hidden h2 for accessibility - maintains heading hierarchy */}
<h2 className="sr-only">Formulaire d'inscription</h2>
{/* Registration Form */} {/* Registration Form */}
<form onSubmit={handleSubmit(onSubmit)} className="space-y-5"> <form onSubmit={handleSubmit(onSubmit)} className="space-y-5">

View File

@ -41,6 +41,8 @@ export default function Footer() {
return ( return (
<footer className="bg-gradient-to-br from-beige-100 via-beige-50 to-beige-100 text-beige-800 border-t-2 border-beige-300"> <footer className="bg-gradient-to-br from-beige-100 via-beige-50 to-beige-100 text-beige-800 border-t-2 border-beige-300">
{/* Hidden h2 for accessibility - maintains heading hierarchy */}
<h2 className="sr-only">Pied de page</h2>
{/* Main Footer */} {/* Main Footer */}
<div className="container mx-auto px-4 py-12"> <div className="container mx-auto px-4 py-12">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8"> <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">

View File

@ -16,24 +16,24 @@ interface StatusBadgeProps {
} }
const roleColors: Record<string, string> = { const roleColors: Record<string, string> = {
ADMIN: 'bg-red-100 text-red-800', ADMIN: 'bg-red-100 text-red-900',
EMPLOYEE: 'bg-blue-100 text-blue-800', EMPLOYEE: 'bg-blue-100 text-blue-900',
CLIENT: 'bg-green-100 text-green-800', CLIENT: 'bg-green-100 text-green-900',
}; };
const ticketColors: Record<string, string> = { const ticketColors: Record<string, string> = {
AVAILABLE: 'bg-gray-100 text-gray-800', AVAILABLE: 'bg-gray-100 text-gray-900',
CLAIMED: 'bg-green-100 text-green-800', CLAIMED: 'bg-green-100 text-green-900',
PENDING: 'bg-yellow-100 text-yellow-800', PENDING: 'bg-yellow-100 text-yellow-900',
EXPIRED: 'bg-red-100 text-red-800', EXPIRED: 'bg-red-100 text-red-900',
REJECTED: 'bg-red-100 text-red-800', REJECTED: 'bg-red-100 text-red-900',
}; };
const statusColors: Record<string, string> = { const statusColors: Record<string, string> = {
active: 'bg-green-100 text-green-800', active: 'bg-green-100 text-green-900',
inactive: 'bg-gray-100 text-gray-800', inactive: 'bg-gray-100 text-gray-900',
verified: 'bg-green-100 text-green-800', verified: 'bg-green-100 text-green-900',
unverified: 'bg-yellow-100 text-yellow-800', unverified: 'bg-yellow-100 text-yellow-900',
}; };
const roleLabels: Record<string, string> = { const roleLabels: Record<string, string> = {
@ -74,7 +74,7 @@ export const StatusBadge: React.FC<StatusBadgeProps> = ({
className, className,
showIcon = false, showIcon = false,
}) => { }) => {
let colorClass = 'bg-gray-100 text-gray-800'; let colorClass = 'bg-gray-100 text-gray-900';
let label = value; let label = value;
let icon: React.ReactNode = null; let icon: React.ReactNode = null;
@ -115,15 +115,15 @@ export const StatusBadge: React.FC<StatusBadgeProps> = ({
// Utility functions for getting colors (for backward compatibility) // Utility functions for getting colors (for backward compatibility)
export const getRoleBadgeColor = (role: RoleType): string => { export const getRoleBadgeColor = (role: RoleType): string => {
return roleColors[role] || 'bg-gray-100 text-gray-800'; return roleColors[role] || 'bg-gray-100 text-gray-900';
}; };
export const getTicketStatusColor = (status: TicketStatusType): string => { export const getTicketStatusColor = (status: TicketStatusType): string => {
return ticketColors[status] || 'bg-gray-100 text-gray-800'; return ticketColors[status] || 'bg-gray-100 text-gray-900';
}; };
export const getStatusColor = (status: StatusType): string => { export const getStatusColor = (status: StatusType): string => {
return statusColors[status] || 'bg-gray-100 text-gray-800'; return statusColors[status] || 'bg-gray-100 text-gray-900';
}; };
export default StatusBadge; export default StatusBadge;

View File

@ -29,7 +29,7 @@ export const TicketTableRow: React.FC<TicketTableRowProps> = ({
<td className="px-6 py-4 whitespace-nowrap"> <td className="px-6 py-4 whitespace-nowrap">
<StatusBadge type="ticket" value={ticket.status} /> <StatusBadge type="ticket" value={ticket.status} />
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-[#8a8a7a]"> <td className="px-6 py-4 whitespace-nowrap text-sm text-gray-700">
{ticket.playedAt {ticket.playedAt
? new Date(ticket.playedAt).toLocaleDateString("fr-FR", showClaimedDate ? { ? new Date(ticket.playedAt).toLocaleDateString("fr-FR", showClaimedDate ? {
day: 'numeric', day: 'numeric',
@ -41,7 +41,7 @@ export const TicketTableRow: React.FC<TicketTableRowProps> = ({
: "-"} : "-"}
</td> </td>
{showClaimedDate && ( {showClaimedDate && (
<td className="px-6 py-4 whitespace-nowrap text-sm text-[#8a8a7a]"> <td className="px-6 py-4 whitespace-nowrap text-sm text-gray-700">
{ticket.claimedAt {ticket.claimedAt
? new Date(ticket.claimedAt).toLocaleDateString("fr-FR", { ? new Date(ticket.claimedAt).toLocaleDateString("fr-FR", {
day: 'numeric', day: 'numeric',