Skip to content

Commit

Permalink
fix: rgaa review 1 (#6383)
Browse files Browse the repository at this point in the history
* titre article lié et partage en h2

* fix: feedback answer focus

* fix: utiliser même intitulé dans le titre du lien que dans le children

* chore: snap

---------

Co-authored-by: victor <[email protected]>
  • Loading branch information
Viczei and victor authored Jan 9, 2025
1 parent d9a2a58 commit 6226cb9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const RelatedItems = ({
<div
className={fr.cx("fr-mb-2w", "fr-text--lead")}
role="heading"
aria-level={3}
aria-level={2}
>
<strong>{title}&nbsp;:</strong>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const Share = ({ title, metaDescription }: Props): JSX.Element => {

return (
<div className={fr.cx("fr-follow__social")}>
<div className={fr.cx("fr-mb-2w")} role="heading" aria-level={3}>
<div className={fr.cx("fr-mb-2w")} role="heading" aria-level={2}>
<span>Partager la page</span>
</div>
<ul className={fr.cx("fr-btns-group")}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`<RelatedItems /> should render 1`] = `
>
<div>
<div
aria-level="3"
aria-level="2"
class="fr-mb-2w fr-text--lead"
role="heading"
>
Expand Down Expand Up @@ -51,7 +51,7 @@ exports[`<RelatedItems /> should render 1`] = `
</div>
<div>
<div
aria-level="3"
aria-level="2"
class="fr-mb-2w fr-text--lead"
role="heading"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`<Share /> renders 1`] = `
class="fr-follow__social"
>
<div
aria-level="3"
aria-level="2"
class="fr-mb-2w"
role="heading"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { fr } from "@codegouvfr/react-dsfr";
import { useEffect, useState } from "react";

export const FeedbackAnswered = () => {
const [titleRef, setTitleRef] = useState<HTMLHeadingElement | null>();
useEffect(() => {
titleRef?.focus();
}, [titleRef]);
return (
<>
<h2 className={fr.cx("fr-h5")}>Merci pour votre réponse.</h2>
<h2 className={fr.cx("fr-h5")} tabIndex={-1} ref={setTitleRef}>
Merci pour votre réponse.
</h2>
<p>
L’équipe du Code du travail numérique vous remercie pour votre réponse.
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`<FeedbackAnswered /> should match snapshot 1`] = `
<div>
<h2
class="fr-h5"
tabindex="-1"
>
Merci pour votre réponse.
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ exports[`<LetterModel /> affiche un modèle de document 1`] = `
class="fr-follow__social"
>
<div
aria-level="3"
aria-level="2"
class="fr-mb-2w"
role="heading"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const PrivacyPolicy = () => {
Vous êtes également en droit de saisir la Commission Nationale de
l’Informatique et des Libertés pour toute réclamation à{" "}
<Link
title="Adresser une réclamation (plainte) à la CNIL"
title="Utiliser l’adresse suivante pour adresser une réclamation (plainte) à la CNIL"
target="_blank"
href="https://www.cnil.fr/fr/cnil-direct/question/844"
>
Expand Down

0 comments on commit 6226cb9

Please sign in to comment.