Skip to content

Commit d6b7908

Browse files
committed
Fix integration setup
1 parent e6db70b commit d6b7908

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

test/integration/next-pagesdir/pages/_document.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ const { augmentDocumentForDsfr, getColorSchemeHtmlAttributes } = dsfrDocumentApi
66

77
export default function Document(props: DocumentProps) {
88
return (
9-
<Html {...getColorSchemeHtmlAttributes(props)}>
9+
<Html
10+
{...getColorSchemeHtmlAttributes(props)}
11+
style={{
12+
"overflow": "-moz-scrollbars-vertical",
13+
"overflowY": "scroll"
14+
}}
15+
>
1016
<Head />
1117
<body>
1218
<Main />

test/integration/vite/src/main.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Footer } from "@codegouvfr/react-dsfr/Footer";
88
import { BrowserRouter } from "react-router-dom";
99
import { Routes, Route, Link, useLocation } from "react-router-dom";
1010
import { headerFooterDisplayItem } from "@codegouvfr/react-dsfr/Display";
11+
import { GlobalStyles } from "tss-react";
1112
import { fr } from "@codegouvfr/react-dsfr";
1213
import { GdprStoreProvider } from "@codegouvfr/react-dsfr/gdpr";
1314
import { ConsentBanner } from '@codegouvfr/react-dsfr/ConsentBanner';
@@ -21,13 +22,22 @@ declare module "@codegouvfr/react-dsfr/spa" {
2122
}
2223

2324
declare module "@codegouvfr/react-dsfr/gdpr" {
24-
interface RegisterGdprServices {
25+
interface RegisterGdprServices {
2526
matomo: never;
2627
}
2728
}
2829

2930
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
3031
<React.StrictMode>
32+
<GlobalStyles
33+
styles={{
34+
"html": {
35+
//NOTE: Always show scrollbar to avoid layout shift when modals are opened
36+
"overflow": "-moz-scrollbars-vertical",
37+
"overflowY": "scroll"
38+
}
39+
}}
40+
/>
3141
<BrowserRouter>
3242
<Root />
3343
</BrowserRouter>
@@ -36,15 +46,15 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
3646

3747
const brandTop = <>INTITULE<br />OFFICIEL</>;
3848

39-
const homeLinkProps= { "to": "/", "title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)" };
49+
const homeLinkProps = { "to": "/", "title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)" };
4050

4151
function Root() {
4252

4353
const location = useLocation();
4454

4555
return (
4656
<GdprStoreProvider>
47-
<ConsentBanner gdprLinkProps={{to: "/mui"}} siteName='Next Test App' services={[
57+
<ConsentBanner gdprLinkProps={{ to: "/mui" }} siteName='Next Test App' services={[
4858
{
4959
name: "matomo",
5060
title: "Matomo",
@@ -116,7 +126,7 @@ function Root() {
116126
bottomItems={[headerFooterDisplayItem]}
117127
/>
118128
</div>
119-
</GdprStoreProvider>
129+
</GdprStoreProvider>
120130
);
121131

122132
}

0 commit comments

Comments
 (0)