Skip to content

Commit 8485cd3

Browse files
committed
Update integrations app, there is no longer need to offset for modal
1 parent afa49ac commit 8485cd3

File tree

4 files changed

+44
-81
lines changed

4 files changed

+44
-81
lines changed

test/integration/cra/src/index.tsx

Lines changed: 42 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { StrictMode } from "react";
22
import { createRoot } from "react-dom/client";
33
import { startReactDsfr } from "@codegouvfr/react-dsfr/spa";
4-
import { GlobalStyles } from "tss-react";
54
import { Home } from "./Home";
65
import { Mui } from "./Mui";
76
import { useRoute, RouteProvider } from "./router";
@@ -29,66 +28,53 @@ function Root() {
2928
const route = useRoute();
3029

3130
return (
32-
<>
33-
<GlobalStyles
34-
styles={{
35-
"html": {
36-
//NOTE: Always show scrollbar to avoid layout shift when modals are opened
37-
"overflow": "-moz-scrollbars-vertical",
38-
"overflowY": "scroll"
31+
<div style={{
32+
"minHeight": "100vh",
33+
"display": "flex",
34+
"flexDirection": "column",
35+
}}>
36+
<Header
37+
brandTop={<>INTITULE<br />OFFICIEL</>}
38+
serviceTitle="Nom du site / service"
39+
quickAccessItems={[
40+
headerFooterDisplayItem,
41+
{
42+
iconId: "ri-mail-line",
43+
linkProps: {
44+
href: `mailto:${"joseph.garrone@code.gouv.fr"}`,
45+
},
46+
text: "Nous contacter",
47+
}
48+
]}
49+
homeLinkProps={{ ...routes.home().link, "title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)" }}
50+
navigation={[
51+
{
52+
"text": "Home",
53+
"linkProps": routes.home().link,
54+
"isActive": route.name === "home"
55+
},
56+
{
57+
"text": "Mui playground",
58+
"linkProps": routes.mui().link,
59+
"isActive": route.name === "mui"
3960
}
40-
}}
61+
]}
4162
/>
4263
<div style={{
43-
"minHeight": "100vh",
44-
"display": "flex",
45-
"flexDirection": "column",
64+
"flex": 1,
65+
"margin": "auto",
66+
"maxWidth": 1000,
67+
...fr.spacing("padding", { "topBottom": "10v" })
4668
}}>
47-
<Header
48-
brandTop={<>INTITULE<br />OFFICIEL</>}
49-
serviceTitle="Nom du site / service"
50-
quickAccessItems={[
51-
headerFooterDisplayItem,
52-
{
53-
iconId: "ri-mail-line",
54-
linkProps: {
55-
href: `mailto:${"joseph.garrone@code.gouv.fr"}`,
56-
},
57-
text: "Nous contacter",
58-
}
59-
]}
60-
homeLinkProps={{ ...routes.home().link, "title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)" }}
61-
navigation={[
62-
{
63-
"text": "Home",
64-
"linkProps": routes.home().link,
65-
"isActive": route.name === "home"
66-
},
67-
{
68-
"text": "Mui playground",
69-
"linkProps": routes.mui().link,
70-
"isActive": route.name === "mui"
71-
}
72-
]}
73-
/>
74-
<div style={{
75-
"flex": 1,
76-
"margin": "auto",
77-
"maxWidth": 1000,
78-
...fr.spacing("padding", { "topBottom": "10v" })
79-
}}>
80-
{(() => {
81-
switch (route.name) {
82-
case "mui": return <Mui />;
83-
case "home": return <Home />;
84-
case false: return <h1>404</h1>
85-
}
86-
})()}
87-
</div>
69+
{(() => {
70+
switch (route.name) {
71+
case "mui": return <Mui />;
72+
case "home": return <Home />;
73+
case false: return <h1>404</h1>
74+
}
75+
})()}
8876
</div>
89-
</>
77+
</div>
9078
);
9179

92-
93-
9480
}

test/integration/next-appdir/app/layout.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,7 @@ export default function RootLayout({ children }: { children: JSX.Element; }) {
2323
const lang = "fr";
2424

2525
return (
26-
<html
27-
{...getHtmlAttributes({ defaultColorScheme, lang })}
28-
//NOTE: Scrollbar always visible to avoid layout shift when modal are opened
29-
style={{
30-
"overflow": "-moz-scrollbars-vertical",
31-
"overflowY": "scroll"
32-
}}
33-
>
26+
<html {...getHtmlAttributes({ defaultColorScheme, lang })} >
3427
<head>
3528
<title>Next 13 AppDir Demo DSFR setup</title>
3629
<StartDsfr />

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

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

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

test/integration/vite/src/main.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ 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";
1211
import { fr } from "@codegouvfr/react-dsfr";
1312
import { ConsentBannerAndConsentManagement, FooterConsentManagementItem, FooterPersonalDataPolicyItem } from "./consentManagement";
1413

@@ -23,15 +22,6 @@ declare module "@codegouvfr/react-dsfr/spa" {
2322

2423
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
2524
<React.StrictMode>
26-
<GlobalStyles
27-
styles={{
28-
"html": {
29-
//NOTE: Always show scrollbar to avoid layout shift when modals are opened
30-
"overflow": "-moz-scrollbars-vertical",
31-
"overflowY": "scroll"
32-
}
33-
}}
34-
/>
3525
<BrowserRouter>
3626
<Root />
3727
</BrowserRouter>

0 commit comments

Comments
 (0)