Skip to content

Commit abe80ae

Browse files
committed
fix(seo): retrait des h1 dupliqués
1 parent b3788f8 commit abe80ae

File tree

8 files changed

+166
-24
lines changed

8 files changed

+166
-24
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { DsfrLayout } from "../../src/modules/layout";
2+
import { generateDefaultMetadata } from "../../src/modules/common/metas";
3+
import { BesoinPlusInformations } from "../../src/modules/besoin-plus-informations";
4+
5+
export const metadata = generateDefaultMetadata({
6+
title: "Besoin de plus d'informations",
7+
description:
8+
"Les services du ministère du Travail en région informent, conseillent et orientent les salariés et les employeurs du secteur privé sur leurs questions en droit du travail.",
9+
path: "/besoin-plus-informations",
10+
});
11+
12+
function Index() {
13+
return (
14+
<DsfrLayout>
15+
<BesoinPlusInformations />
16+
</DsfrLayout>
17+
);
18+
}
19+
20+
export default Index;

packages/code-du-travail-frontend/app/layout.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ export default function RootLayout({
2424
}) {
2525
const headersData = headers();
2626
const nonce = headersData.get("x-nonce") ?? undefined;
27-
const pathname = headersData.get("x-url") ?? "";
2827

2928
return (
30-
<DefaultLayout
31-
nonce={nonce}
32-
defaultColorScheme={pathname.includes("/widgets") ? "light" : "system"}
33-
>
29+
<DefaultLayout nonce={nonce} defaultColorScheme={"light"}>
3430
{children}
3531
</DefaultLayout>
3632
);

packages/code-du-travail-frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"clean:redirects": "yarn tsup && node dist/clean-redirects.js"
3636
},
3737
"dependencies": {
38-
"@codegouvfr/react-dsfr": "^1.13.9",
38+
"@codegouvfr/react-dsfr": "^1.16.0",
3939
"@elastic/elasticsearch": "^8.13.1",
4040
"@matejmazur/react-katex": "^3.1.3",
4141
"@opentelemetry/instrumentation-generic-pool": "^0.37.0",
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
"use client";
2+
3+
import { fr } from "@codegouvfr/react-dsfr";
4+
import { Container } from "../layout/Container";
5+
import { useState } from "react";
6+
import { useNeedMoreInfoEvents } from "../layout/infos/tracking";
7+
import Image from "next/image";
8+
import { Input } from "@codegouvfr/react-dsfr/Input";
9+
import { Button } from "@codegouvfr/react-dsfr/Button";
10+
import { css } from "@styled-system/css";
11+
import servicesDeRenseignement from "../../data/services-de-renseignement.json";
12+
import { CallOut } from "@codegouvfr/react-dsfr/CallOut";
13+
14+
type ServiceRenseignement = {
15+
name: string;
16+
url: string;
17+
};
18+
19+
export const BesoinPlusInformations = () => {
20+
const [department, setDepartment] = useState<string>("");
21+
const [hasSearched, setHasSearched] = useState<boolean>(false);
22+
const [result, setResult] = useState<undefined | ServiceRenseignement>(
23+
undefined
24+
);
25+
const { emitTrackNumber } = useNeedMoreInfoEvents();
26+
27+
const onSearchInput = () => {
28+
const departmentNum = (department.replace(/^0+/, "") || "").toLowerCase();
29+
const departmentData = servicesDeRenseignement[departmentNum];
30+
setResult(departmentData);
31+
setHasSearched(true);
32+
};
33+
34+
const onClickLinkPhoneNumber = () => {
35+
emitTrackNumber();
36+
};
37+
38+
return (
39+
<Container>
40+
<h1 id="mentions-legales" className={fr.cx("fr-mt-0")}>
41+
Besoin de plus d&apos;informations
42+
</h1>
43+
44+
<CallOut>
45+
Les services du ministère du Travail en région informent, conseillent et
46+
orientent les salariés et les employeurs du secteur privé sur leurs
47+
questions en droit du travail.
48+
</CallOut>
49+
50+
<h2 className={fr.cx("fr-h5")}>Contact téléphonique</h2>
51+
52+
<a href="tel:+33806000126" onClick={onClickLinkPhoneNumber}>
53+
<Image
54+
src="/static/assets/img/srdt.svg"
55+
alt="Contactez les services de renseignements au droit du travail au 0800 026 080"
56+
width={350}
57+
height={100}
58+
/>
59+
</a>
60+
<h2 className={fr.cx("fr-h5", "fr-mt-3w")}>
61+
Contact par email et prise de rendez-vous
62+
</h2>
63+
<Input
64+
id="search-service"
65+
label="Saisissez le numéro de votre département"
66+
nativeInputProps={{
67+
maxLength: 3,
68+
onChange: (e) => setDepartment(e.target.value),
69+
onKeyDown: (e) => {
70+
if (e.key === "Enter") {
71+
onSearchInput();
72+
}
73+
},
74+
}}
75+
addon={
76+
<Button
77+
iconId="fr-icon-search-line"
78+
onClick={onSearchInput}
79+
title="Lancer la recherche par numéro de département"
80+
/>
81+
}
82+
classes={{
83+
nativeInputOrTextArea: inputCss,
84+
}}
85+
/>
86+
{result && (
87+
<a className={fr.cx("fr-link")} href={result.url} target="_blank">
88+
{result.url}
89+
</a>
90+
)}
91+
{hasSearched && !result && (
92+
<p className={fr.cx("fr-error-text", "fr-text--md")}>
93+
Aucun service de renseignement n&apos;a été trouvé pour ce
94+
département.
95+
</p>
96+
)}
97+
<div className={fr.cx("fr-mt-3w")}>
98+
<p className={fr.cx("fr-text--sm", "fr-mb-0")}>
99+
Attention, ces services délivrent une information juridique, ils ne
100+
sont pas compétents pour :
101+
</p>
102+
<ul>
103+
<li className={fr.cx("fr-text--sm", "fr-mb-0")}>
104+
les demandes d&apos;intervention en entreprise
105+
</li>
106+
<li className={fr.cx("fr-text--sm", "fr-mb-0")}>
107+
la constitution des dossiers prud’homaux
108+
</li>
109+
<li className={fr.cx("fr-text--sm", "fr-mb-0")}>
110+
les calculs de droit au chômage
111+
</li>
112+
<li className={fr.cx("fr-text--sm", "fr-mb-0")}>
113+
vous renseigner sur les cotisations sociales
114+
</li>
115+
</ul>
116+
</div>
117+
</Container>
118+
);
119+
};
120+
121+
const inputCss = css({
122+
maxWidth: "280px",
123+
});

packages/code-du-travail-frontend/src/modules/layout/Footer.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Footer as FooterDsfr } from "@codegouvfr/react-dsfr/Footer";
22
import { PACKAGE_VERSION } from "../../config";
3-
import { headerFooterDisplayItem } from "@codegouvfr/react-dsfr/Display";
43
import { BrandTop } from "./BrandTop";
54
import { homeLinksProps } from "./common";
65

@@ -173,7 +172,6 @@ export const Footer = () => {
173172
},
174173
text: "Plan du site",
175174
},
176-
headerFooterDisplayItem,
177175
]}
178176
/>
179177
);

packages/code-du-travail-frontend/src/modules/layout/header/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const Header = () => {
7070
/>
7171
)}
7272
onSearchButtonClick={onSearchSubmit}
73+
disableDisplay={true}
7374
/>
7475
);
7576
};

packages/code-du-travail-frontend/src/modules/layout/infos/index.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { fr } from "@codegouvfr/react-dsfr";
44
import { Button } from "@codegouvfr/react-dsfr/Button";
55
import { css } from "@styled-system/css";
66
import { createModal } from "@codegouvfr/react-dsfr/Modal";
7-
import { PopupContent } from "./PopupContent";
87
import { useIsModalOpen } from "@codegouvfr/react-dsfr/Modal/useIsModalOpen";
98
import { useNeedMoreInfoEvents } from "./tracking";
109
import { useEffect } from "react";
@@ -27,24 +26,29 @@ export const NeedMoreInfo = () => {
2726
<div className={fr.cx("fr-container")}>
2827
<div className={fr.cx("fr-grid-row", "fr-grid-row--center")}>
2928
<div className={`${fr.cx("fr-col-md-6", "fr-py-6w")}`}>
30-
<h2 className={title}>Besoin de plus d&apos;informations ?</h2>
29+
<div
30+
role="heading"
31+
aria-level={2}
32+
className={`${fr.cx("fr-h2")} ${title}`}
33+
>
34+
Besoin de plus d&apos;informations ?
35+
</div>
3136
<p className={paragraph}>
3237
Les services du ministère du Travail en région informent,
3338
conseillent et orientent les salariés et les employeurs du secteur
3439
privé sur leurs questions en droit du travail.
3540
</p>
3641
<div className={buttonContainer}>
3742
<Button
43+
linkProps={{
44+
href: "/besoin-plus-informations",
45+
}}
3846
iconId="fr-icon-chat-3-line"
3947
iconPosition="right"
4048
priority="secondary"
41-
nativeButtonProps={needMoreInfoModal.buttonProps}
4249
>
4350
Trouver les services près de chez moi
4451
</Button>
45-
<needMoreInfoModal.Component title="Les services du ministère du Travail">
46-
<PopupContent />
47-
</needMoreInfoModal.Component>
4852
</div>
4953
</div>
5054
</div>

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,7 @@ __metadata:
18741874
version: 0.0.0-use.local
18751875
resolution: "@cdt/frontend@workspace:packages/code-du-travail-frontend"
18761876
dependencies:
1877-
"@codegouvfr/react-dsfr": ^1.13.9
1877+
"@codegouvfr/react-dsfr": ^1.16.0
18781878
"@elastic/elasticsearch": ^8.13.1
18791879
"@matejmazur/react-katex": ^3.1.3
18801880
"@opentelemetry/instrumentation-generic-pool": ^0.37.0
@@ -1984,11 +1984,11 @@ __metadata:
19841984
languageName: node
19851985
linkType: hard
19861986

1987-
"@codegouvfr/react-dsfr@npm:^1.13.9":
1988-
version: 1.13.9
1989-
resolution: "@codegouvfr/react-dsfr@npm:1.13.9"
1987+
"@codegouvfr/react-dsfr@npm:^1.16.0":
1988+
version: 1.16.0
1989+
resolution: "@codegouvfr/react-dsfr@npm:1.16.0"
19901990
dependencies:
1991-
tsafe: ^1.7.2
1991+
tsafe: ^1.8.5
19921992
yargs-parser: ^21.1.1
19931993
peerDependencies:
19941994
"@gouvfr/dsfr-chart": ^1.0.0
@@ -1999,7 +1999,7 @@ __metadata:
19991999
copy-dsfr-to-public: bin/copy-dsfr-to-public.js
20002000
only-include-used-icons: bin/only-include-used-icons.js
20012001
react-dsfr: bin/react-dsfr.js
2002-
checksum: 32914874809571944dc905a231d4bd968d0ca3ea2f1f49e21dad30e10e500dda884d1cb69ac1526f9af244d42bd8994081f4bcf71c71f37a5eb7b1aabb561a8b
2002+
checksum: 5302efd815882d8daad8780255ac34279b6ed7528ae245fd98e9ec6a9168cf5cb5ab77b5ecd35b8deea3e4a098205be44f2b56afebb091010336273ffea9da66
20032003
languageName: node
20042004
linkType: hard
20052005

@@ -25422,10 +25422,10 @@ __metadata:
2542225422
languageName: node
2542325423
linkType: hard
2542425424

25425-
"tsafe@npm:^1.7.2":
25426-
version: 1.7.2
25427-
resolution: "tsafe@npm:1.7.2"
25428-
checksum: a02da1bb81fed3c35b1ce1ea5f6118a632c436d41536ca7a8a399d5890add53a0352da6f48b5fbb66d9f80c66c71de45de6071f696781fa03e738058d112ee80
25425+
"tsafe@npm:^1.8.5":
25426+
version: 1.8.5
25427+
resolution: "tsafe@npm:1.8.5"
25428+
checksum: 2bd0490681e86f00d3d21ed2c42a2294ed816c84d861bf5cbf2c3535ad67aa99dbd025804e40c0bba846c8cdcb6d5ab6fc64a3a82bd8ec3728ee8919b7275d85
2542925429
languageName: node
2543025430
linkType: hard
2543125431

0 commit comments

Comments
 (0)