diff --git a/packages/code-du-travail-frontend/src/modules/besoin-plus-informations/index.tsx b/packages/code-du-travail-frontend/src/modules/besoin-plus-informations/index.tsx index 83b48abf55..10b2315149 100644 --- a/packages/code-du-travail-frontend/src/modules/besoin-plus-informations/index.tsx +++ b/packages/code-du-travail-frontend/src/modules/besoin-plus-informations/index.tsx @@ -13,6 +13,7 @@ import { getServiceInfo, ServiceRenseignement, } from "./data/servicesDeRenseignement"; +import Link from "../common/Link"; export const BesoinPlusInformations = () => { const [department, setDepartment] = useState(""); @@ -111,7 +112,7 @@ export const BesoinPlusInformations = () => { }} /> {result && ( - { ref={setLinkRef} > {result.url} - + )} Source :{" "} - + Code du travail - {" "} + {" "} - Mis à jour le : {date}

diff --git a/packages/code-du-travail-frontend/src/modules/common/Link.tsx b/packages/code-du-travail-frontend/src/modules/common/Link.tsx index 166849480b..63fa3abfcd 100644 --- a/packages/code-du-travail-frontend/src/modules/common/Link.tsx +++ b/packages/code-du-travail-frontend/src/modules/common/Link.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from "react"; +import React, { ReactNode, Ref } from "react"; import BaseLink, { LinkProps } from "next/link"; type Props = LinkProps & { @@ -7,6 +7,7 @@ type Props = LinkProps & { target?: string; className?: string; rel?: string; + ref?: Ref; }; const Link = ({ ...props }: Props): JSX.Element => { diff --git a/packages/code-du-travail-frontend/src/modules/common/ReferencesList.tsx b/packages/code-du-travail-frontend/src/modules/common/ReferencesList.tsx index d3c8f37bd4..daa362b8dd 100644 --- a/packages/code-du-travail-frontend/src/modules/common/ReferencesList.tsx +++ b/packages/code-du-travail-frontend/src/modules/common/ReferencesList.tsx @@ -2,6 +2,7 @@ import React from "react"; import { ServicePublicReference } from "@socialgouv/cdtn-types"; import { getRouteBySource, SOURCES } from "@socialgouv/cdtn-utils"; import { fr } from "@codegouvfr/react-dsfr"; +import Link from "./Link"; export const ReferenceList = ({ references, @@ -27,12 +28,12 @@ export const ReferenceList = ({ ); case SOURCES.EXTERNALS: return ( - {`Convention collective: ${ref.title}`} + >{`Convention collective: ${ref.title}`} ); } }) diff --git a/packages/code-du-travail-frontend/src/modules/common/Share.tsx b/packages/code-du-travail-frontend/src/modules/common/Share.tsx index bfa46d2e19..6d10a462ed 100644 --- a/packages/code-du-travail-frontend/src/modules/common/Share.tsx +++ b/packages/code-du-travail-frontend/src/modules/common/Share.tsx @@ -7,6 +7,7 @@ import { SITE_URL } from "../../config"; import { fr } from "@codegouvfr/react-dsfr"; import { css } from "@styled-system/css"; import { useCommonTracking } from "./tracking"; +import Link from "./Link"; type Props = { title: string; @@ -29,7 +30,7 @@ export const Share = ({ title, metaDescription }: Props): JSX.Element => {
  • - { }} > Facebook - +
  • - { }} > X (anciennement Twitter) - +
  • - { }} > Linkedin - +
  • {
  • - { }} > Whatsapp - +
  • {isUrlCopied ? ( diff --git a/packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/ReferenceList.test.tsx.snap b/packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/ReferenceList.test.tsx.snap index 2ccbedcc32..8d203df053 100644 --- a/packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/ReferenceList.test.tsx.snap +++ b/packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/ReferenceList.test.tsx.snap @@ -22,6 +22,7 @@ exports[` should render 1`] = ` href="https://article.jo/yyy" rel="noreferer noopener" target="_blank" + title="Convention collective: Article yyy du JO - nouvelle fenêtre" > Convention collective: Article yyy du JO @@ -35,6 +36,7 @@ exports[` should render 1`] = ` href="https://legifrance/ccn-metallurgie" rel="noreferer noopener" target="_blank" + title="Convention collective: CCN metallurgie - nouvelle fenêtre" > Convention collective: CCN metallurgie diff --git a/packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/Share.test.tsx.snap b/packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/Share.test.tsx.snap index fae0cb6ca9..80704b6122 100644 --- a/packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/Share.test.tsx.snap +++ b/packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/Share.test.tsx.snap @@ -23,7 +23,7 @@ exports[` renders 1`] = ` href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fapi.url%2Fmy-page"e=HELLO" rel="noopener noreferrer" target="_blank" - title="Partager sur Facebook" + title="Partager sur Facebook - nouvelle fenêtre" > Facebook @@ -34,7 +34,7 @@ exports[` renders 1`] = ` href="https://x.com/intent/post?text=HELLO%20%3A%20http%3A%2F%2Fapi.url%2Fmy-page" rel="noopener noreferrer" target="_blank" - title="Partager sur X (anciennement Twitter)" + title="Partager sur X (anciennement Twitter) - nouvelle fenêtre" > X (anciennement Twitter) @@ -45,7 +45,7 @@ exports[` renders 1`] = ` href="https://www.linkedin.com/shareArticle?mini=true&title=HELLO&url=http%3A%2F%2Fapi.url%2Fmy-page" rel="noopener noreferrer" target="_blank" - title="Partager sur LinkedIn" + title="Partager sur LinkedIn - nouvelle fenêtre" > Linkedin @@ -66,7 +66,7 @@ exports[` renders 1`] = ` href="https://wa.me/?text=HELLO%20%3A%20http%3A%2F%2Fapi.url%2Fmy-page" rel="noopener noreferrer" target="_blank" - title="Envoyer par Whatsapp" + title="Envoyer par Whatsapp - nouvelle fenêtre" > Whatsapp diff --git a/packages/code-du-travail-frontend/src/modules/layout/SourceData.tsx b/packages/code-du-travail-frontend/src/modules/layout/SourceData.tsx index 3b3f8a599c..04a9590627 100644 --- a/packages/code-du-travail-frontend/src/modules/layout/SourceData.tsx +++ b/packages/code-du-travail-frontend/src/modules/layout/SourceData.tsx @@ -1,5 +1,6 @@ import React from "react"; import { fr } from "@codegouvfr/react-dsfr"; +import Link from "../common/Link"; type Props = { source: { @@ -12,9 +13,9 @@ type Props = { export const SourceData = ({ source, updatedAt }: Props) => (

    Source :{" "} - + {source.name} - + {/* On place un span dans un span car la class fr-unhidden-lg fait un display: inherit qui va récupérer le display du parent Si on retire le span, on va hériter du display du p qui n'est pas bon. diff --git a/packages/code-du-travail-frontend/src/modules/layout/footer/FooterBottom.tsx b/packages/code-du-travail-frontend/src/modules/layout/footer/FooterBottom.tsx index 7570e74075..80a37f613d 100644 --- a/packages/code-du-travail-frontend/src/modules/layout/footer/FooterBottom.tsx +++ b/packages/code-du-travail-frontend/src/modules/layout/footer/FooterBottom.tsx @@ -1,6 +1,7 @@ import { fr } from "@codegouvfr/react-dsfr"; import React from "react"; import { PACKAGE_VERSION } from "../../../config"; +import Link from "../../common/Link"; export const FooterBottom = () => (

    @@ -24,14 +25,14 @@ export const FooterBottom = () => (
  • - Contribuer sur Github - +
  • @@ -43,13 +44,13 @@ export const FooterBottom = () => (

    Sauf mention explicite de propriété intellectuelle détenue par des tiers, les contenus de ce site sont proposés sous{" "} - licence etalab-2.0 - +

    diff --git a/packages/code-du-travail-frontend/src/modules/layout/footer/FooterContent.tsx b/packages/code-du-travail-frontend/src/modules/layout/footer/FooterContent.tsx index 582344949a..838e69e700 100644 --- a/packages/code-du-travail-frontend/src/modules/layout/footer/FooterContent.tsx +++ b/packages/code-du-travail-frontend/src/modules/layout/footer/FooterContent.tsx @@ -1,5 +1,6 @@ import { fr } from "@codegouvfr/react-dsfr"; import React from "react"; +import Link from "../../common/Link"; const DOMAINS = [ "travail-emploi.gouv.fr", @@ -14,14 +15,14 @@ export const FooterContent = () => ( diff --git a/packages/code-du-travail-frontend/src/modules/layout/footer/__tests__/__snapshots__/index.test.tsx.snap b/packages/code-du-travail-frontend/src/modules/layout/footer/__tests__/__snapshots__/index.test.tsx.snap index 1e4726d367..31bf911c0d 100644 --- a/packages/code-du-travail-frontend/src/modules/layout/footer/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/code-du-travail-frontend/src/modules/layout/footer/__tests__/__snapshots__/index.test.tsx.snap @@ -292,6 +292,7 @@ exports[`