Skip to content

Commit df31681

Browse files
fix(frontend): add skip link to LegalPage 404 and landmark fixes
Add skip link and main-content id to LegalPage 404 branch. Add aria-labelledby on legal document sections linking to their h2.
1 parent b185c11 commit df31681

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/frontend/src/pages/LegalPage.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ const LegalPage = ({ slug }: LegalPageProps) => {
1212
if (!document) {
1313
return (
1414
<div className="min-h-screen bg-dark-950 flex flex-col">
15+
<a
16+
href="#main-content"
17+
className="sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 focus:z-50 focus:px-4 focus:py-2 focus:bg-gold-500 focus:text-dark-950 focus:rounded-lg focus:font-medium"
18+
>
19+
Aller au contenu principal
20+
</a>
1521
<Header />
16-
<main className="flex-1 flex items-center justify-center">
22+
<main id="main-content" role="main" className="flex-1 flex items-center justify-center">
1723
<div className="text-center">
1824
<h1 className="font-display text-3xl text-cream-100 mb-4">Page introuvable</h1>
1925
<p className="text-cream-400 mb-6">Le document demandé n'existe pas.</p>
@@ -74,8 +80,8 @@ const LegalPage = ({ slug }: LegalPageProps) => {
7480

7581
<div className="space-y-8">
7682
{document.sections.map((section, index) => (
77-
<section key={index}>
78-
<h2 className="font-display text-xl font-semibold text-gold-400 mb-3">
83+
<section key={index} aria-labelledby={`legal-section-${index}`}>
84+
<h2 id={`legal-section-${index}`} className="font-display text-xl font-semibold text-gold-400 mb-3">
7985
{section.title}
8086
</h2>
8187
<div

0 commit comments

Comments
 (0)