Skip to content

Commit b3e3cfc

Browse files
committed
Reorganize demo setup next appdir
1 parent 8332feb commit b3e3cfc

File tree

1 file changed

+78
-78
lines changed
  • test/integration/next-appdir/app

1 file changed

+78
-78
lines changed

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

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -8,79 +8,11 @@ import { createModal } from "@codegouvfr/react-dsfr/Modal";
88
import { SideMenu } from "@codegouvfr/react-dsfr/SideMenu";
99
import { GdprStoreViewer } from '#/ui/GdprStoreViewer';
1010

11-
const { SimpleModal, simpleModalNativeButtonProps } = createModal({
12-
"name": "simple",
11+
const modal = createModal({
12+
"id": "simple-modal",
1313
"isOpenedByDefault": false
1414
});
1515

16-
const sideMenuItems = [
17-
{
18-
text: "Niveau 1",
19-
items: [
20-
{
21-
text: "Accès direct niveau 2",
22-
linkProps: { href: "#" }
23-
},
24-
{
25-
text: "Accès direct niveau 2",
26-
linkProps: { href: "#" }
27-
},
28-
{
29-
text: "Accès direct niveau 2",
30-
linkProps: { href: "#" }
31-
}
32-
]
33-
},
34-
{
35-
isActive: true,
36-
text: "Entrée menu active",
37-
items: [
38-
{
39-
text: "Accès direct niveau 2",
40-
linkProps: { href: "#" }
41-
},
42-
{
43-
isActive: true,
44-
text: "Accès direct niveau 2",
45-
linkProps: { href: "#" }
46-
},
47-
{
48-
text: "Accès direct niveau 2",
49-
linkProps: { href: "#" }
50-
},
51-
{
52-
text: "Accès direct niveau 2",
53-
linkProps: { href: "#" }
54-
},
55-
]
56-
},
57-
{
58-
text: "Accès direct",
59-
linkProps: { href: "#" }
60-
},
61-
{
62-
text: "Accès direct",
63-
linkProps: { href: "#" }
64-
},
65-
{
66-
text: "Niveau 1",
67-
items: [
68-
{
69-
text: "Accès direct niveau 2",
70-
linkProps: { href: "#" }
71-
},
72-
{
73-
text: "Accès direct niveau 2",
74-
linkProps: { href: "#" }
75-
},
76-
{
77-
text: "Accès direct niveau 2",
78-
linkProps: { href: "#" }
79-
}
80-
]
81-
},
82-
];
83-
8416
export default function Page() {
8517

8618
return (
@@ -133,8 +65,8 @@ export default function Page() {
13365
]}
13466
/>
13567
<ClientComponent />
136-
<Button nativeButtonProps={simpleModalNativeButtonProps}>Open simple modal (control button)</Button>
137-
<SimpleModal
68+
<Button nativeButtonProps={modal.buttonProps}>Open simple modal (control button)</Button>
69+
<modal.Component
13870
title="simple modal title"
13971
buttons={
14072
[
@@ -152,9 +84,77 @@ export default function Page() {
15284

15385
>
15486
Modal content
155-
</SimpleModal>
87+
</modal.Component>
15688
<SideMenu
157-
items={sideMenuItems}
89+
items={[
90+
91+
{
92+
text: "Niveau 1",
93+
items: [
94+
{
95+
text: "Accès direct niveau 2",
96+
linkProps: { href: "#" }
97+
},
98+
{
99+
text: "Accès direct niveau 2",
100+
linkProps: { href: "#" }
101+
},
102+
{
103+
text: "Accès direct niveau 2",
104+
linkProps: { href: "#" }
105+
}
106+
]
107+
},
108+
{
109+
isActive: true,
110+
text: "Entrée menu active",
111+
items: [
112+
{
113+
text: "Accès direct niveau 2",
114+
linkProps: { href: "#" }
115+
},
116+
{
117+
isActive: true,
118+
text: "Accès direct niveau 2",
119+
linkProps: { href: "#" }
120+
},
121+
{
122+
text: "Accès direct niveau 2",
123+
linkProps: { href: "#" }
124+
},
125+
{
126+
text: "Accès direct niveau 2",
127+
linkProps: { href: "#" }
128+
},
129+
]
130+
},
131+
{
132+
text: "Accès direct",
133+
linkProps: { href: "#" }
134+
},
135+
{
136+
text: "Accès direct",
137+
linkProps: { href: "#" }
138+
},
139+
{
140+
text: "Niveau 1",
141+
items: [
142+
{
143+
text: "Accès direct niveau 2",
144+
linkProps: { href: "#" }
145+
},
146+
{
147+
text: "Accès direct niveau 2",
148+
linkProps: { href: "#" }
149+
},
150+
{
151+
text: "Accès direct niveau 2",
152+
linkProps: { href: "#" }
153+
}
154+
]
155+
}
156+
157+
]}
158158
title="Titre de rubrique"
159159
burgerMenuButtonText="Dans cette rubrique"
160160
/>
@@ -168,10 +168,10 @@ export default function Page() {
168168
function TableExample() {
169169
return (
170170
<Table
171-
caption = "Titre du tableau"
172-
colorVariant = "green-emeraude"
173-
headers = {["Titre", "Titre", "Titre", "Titre", "Titre"]}
174-
data = {[
171+
caption="Titre du tableau"
172+
colorVariant="green-emeraude"
173+
headers={["Titre", "Titre", "Titre", "Titre", "Titre"]}
174+
data={[
175175
["Donnée", "Donnée", "Donnée", "Donnée", "Donnée"],
176176
["Donnée", "Donnée", "Donnée", "Donnée", "Donnée"],
177177
["Donnée", "Donnée", "Donnée", "Donnée", "Donnée"],

0 commit comments

Comments
 (0)