Skip to content

Commit

Permalink
fix(a11y): add "formulaire de connexion" to skiplinks & create dedica…
Browse files Browse the repository at this point in the history
…ted component (#91)

* accessibility(skiplink): add skiplink

* fix(tsx): add key on array to fix warning
  • Loading branch information
rebeccadumazert authored Feb 26, 2025
1 parent 70324b4 commit 1d3777a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/client/src/Pages/WrapperLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import Footer from "../components/Footer/Footer";
import Header from "../components/Header/Header";
import SkipLinks from "../components/SkipLinks/SkipLinks";
import "./layout.css";

function WrapperLayout(props: { children: JSX.Element }) {
return (
<div className="app">
<SkipLinks />
<Header />
<main role="main" className="content">
<main role="main" className="content" id="content">
{props.children}
</main>
<Footer />
Expand Down
1 change: 1 addition & 0 deletions src/client/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Footer as DsfrFooter } from "@codegouvfr/react-dsfr/Footer";
function Footer() {
return (
<DsfrFooter
id="footer"
accessibility="non compliant"
termsLinkProps={{
to: "/mentions-legales",
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Header() {
text: "Feuille de route",
},
...(isConnected
? [<DropDownLogout />]
? [<DropDownLogout key="dropDownLogout" />]
: [
{
iconId: "fr-icon-account-circle-line" as const,
Expand Down
25 changes: 25 additions & 0 deletions src/client/src/components/SkipLinks/SkipLinks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { SkipLinks as DsfrSkipLinks } from "@codegouvfr/react-dsfr/SkipLinks";

function SkipLinks() {
return (
<DsfrSkipLinks
links={[
{
anchor: "#content",
label: "Contenu",
},
{
anchor:
"#header-menu-modal-fr-header-header-with-quick-access-items-nav-items",
label: "Menu",
},
{
anchor: "#footer",
label: "Pied de page",
},
]}
/>
);
}

export default SkipLinks;

0 comments on commit 1d3777a

Please sign in to comment.