Skip to content

Commit 3beaec5

Browse files
committed
Better base layout
1 parent 8fdf58a commit 3beaec5

File tree

7 files changed

+35
-13
lines changed

7 files changed

+35
-13
lines changed

test/integration/cra/src/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ function Root() {
2626
const route = useRoute();
2727

2828
return (
29-
<>
29+
<div style={{
30+
"height": "100vh",
31+
"display": "flex",
32+
"flexDirection": "column",
33+
}}>
3034
<Header
3135
brandTop={<>INTITULE<br />OFFICIEL</>}
3236
serviceTitle="Nom du site / service"
@@ -46,6 +50,7 @@ function Root() {
4650
]}
4751
/>
4852
<div style={{
53+
"flex": 1,
4954
"margin": "auto",
5055
"maxWidth": 1000,
5156
...fr.spacing("padding", { "topBottom": "10v" })
@@ -59,7 +64,7 @@ function Root() {
5964
})()}
6065
</div>
6166
<Display />
62-
</>
67+
</div>
6368
);
6469

6570

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ export default function RootLayout({ children }: { children: JSX.Element; }) {
3838
]}
3939
/>
4040
</head>
41-
<body>
41+
<body
42+
style={{
43+
"height": "100vh",
44+
"display": "flex",
45+
"flexDirection": "column"
46+
}}
47+
>
4248
<DsfrProvider defaultColorScheme={defaultColorScheme}>
4349
<NextAppDirEmotionCacheProvider options={{ "key": "css" }}>
4450
<MuiDsfrThemeProvider>
@@ -50,9 +56,9 @@ export default function RootLayout({ children }: { children: JSX.Element; }) {
5056
navigation={<Navigation />}
5157
/>
5258
<div style={{
59+
"flex": 1,
5360
"margin": "auto",
5461
"maxWidth": 1000,
55-
"minHeight": "calc(100vh - 208px - 231px - 37px)",
5662
...fr.spacing("padding", {
5763
"topBottom": "10v"
5864
})

test/integration/next-appdir/app/mui/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ const { DataGridDemo } = (() => {
637637

638638
function DataGridDemo() {
639639
return (
640-
<Box sx={{ height: 400, width: '100%', mt: 7 }}>
640+
<Box sx={{ height: 400, width: 800, mt: 7 }}>
641641
<DataGrid
642642
rows={rows}
643643
columns={columns}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { Summary } from "@codegouvfr/react-dsfr/Summary";
55
import { Button } from "@codegouvfr/react-dsfr/Button";
66
import { createModal } from "@codegouvfr/react-dsfr/Modal";
77

8-
const { SimpleModal, simpleModalButtonProps } = createModal("simple");
8+
const { SimpleModal, simpleModalButtonProps } = createModal({
9+
"name": "simple",
10+
"isOpenedByDefault": false
11+
});
912

1013
export default function Page() {
1114

@@ -59,7 +62,6 @@ export default function Page() {
5962
]}
6063
/>
6164
<ClientComponent />
62-
6365
<Button {...simpleModalButtonProps}>Open simple modal</Button>
6466
<SimpleModal
6567
title="simple modal title"

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ function App({ Component, pageProps }: AppProps) {
5757
const router = useRouter()
5858

5959
return (
60-
<>
60+
<div
61+
style={{
62+
"height": "100vh",
63+
"display": "flex",
64+
"flexDirection": "column"
65+
}}
66+
>
6167
<Header
6268
brandTop={brandTop}
6369
serviceTitle="Nom du site / service"
@@ -81,9 +87,9 @@ function App({ Component, pageProps }: AppProps) {
8187
quickAccessItems={[headerFooterDisplayItem]}
8288
/>
8389
<div className={css({
90+
"flex": 1,
8491
"margin": "auto",
8592
"maxWidth": 1000,
86-
"minHeight": "calc(100vh - 208px - 231px - 5px)",
8793
...fr.spacing("padding", {
8894
"topBottom": "10v"
8995
})
@@ -104,7 +110,7 @@ function App({ Component, pageProps }: AppProps) {
104110
bottomItems={[headerFooterDisplayItem]}
105111
/>
106112
<Display />
107-
</>
113+
</div>
108114
);
109115
}
110116

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,8 @@ const { DataGridDemo } = (() => {
636636

637637
function DataGridDemo() {
638638
return (
639-
<Box sx={{ height: 400, width: '100%', mt: 7 }}>
639+
<div style={{ width: 800 }} >
640+
<Box sx={{ height: 400, mt: 7, width: "100%" }}>
640641
<DataGrid
641642
rows={rows}
642643
columns={columns}
@@ -647,6 +648,7 @@ const { DataGridDemo } = (() => {
647648
experimentalFeatures={{ newEditingApi: true }}
648649
/>
649650
</Box>
651+
</div>
650652
);
651653
}
652654

test/integration/vite/src/main.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function Root() {
3030
const location = useLocation();
3131

3232
return (
33-
<>
33+
<div style={{ "height": "100vh", "display": "flex", "flexDirection": "column" }}>
3434
<Header
3535
brandTop={<>INTITULE<br />OFFICIEL</>}
3636
serviceTitle="Nom du site / service"
@@ -54,6 +54,7 @@ function Root() {
5454
]}
5555
/>
5656
<div style={{
57+
"flex": 1,
5758
"margin": "auto",
5859
"maxWidth": 1000,
5960
...fr.spacing("padding", { "topBottom": "10v" })
@@ -65,7 +66,7 @@ function Root() {
6566
</Routes>
6667
</div>
6768
<Display />
68-
</>
69+
</div>
6970

7071
);
7172

0 commit comments

Comments
 (0)