Skip to content

Commit e8b9f55

Browse files
committed
Update storbook relative to client side Header quick access items
1 parent 7a02d14 commit e8b9f55

File tree

2 files changed

+50
-41
lines changed

2 files changed

+50
-41
lines changed

.storybook/DocsContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import React, { useEffect } from "react";
33
import { DocsContainer as BaseContainer } from "@storybook/addon-docs";
44
import { useDarkMode } from "storybook-dark-mode";
55
import { darkTheme, lightTheme } from "./customTheme";
6-
import "../dist/dsfr/dsfr.css";
76
import "../dist/dsfr/utility/icons/icons.min.css";
7+
import "../dist/dsfr/dsfr.css";
88
import { useIsDark } from "../dist/useIsDark";
99
import { startReactDsfr } from "../dist/spa";
1010
import { useColors } from "../dist/useColors";

stories/Header.stories.tsx

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ const { meta, getStory } = getStoryFactory({
1515
1616
See also [\\<MainNavigation \\/\\>](https://react-dsfr-components.etalab.studio/?path=/docs/components-mainnavigation)
1717
18-
> Note for Next App Router: If you want to have \`quickAccessItems\` client side without having to wrap the whole \`<Header />\`
19-
> component within a \`"use client";\` directive you can use the \`<HeaderQuickAccessItem />\` component as demonstrated
20-
[here](https://github.com/garronej/react-dsfr-next-appdir-demo/blob/b485bda99d6140e59584d3134ac9e203ae6b2208/app/layout.tsx#L72) and
21-
[here](https://github.com/garronej/react-dsfr-next-appdir-demo/blob/b485bda99d6140e59584d3134ac9e203ae6b2208/app/LoginHeaderItem.tsx#L1-L24).
2218
2319
`,
2420
"argTypes": {
@@ -106,44 +102,57 @@ export const SimpleHeaderWithServiceTitleAndTagline = getStory({
106102
"serviceTagline": "baseline - précisions sur l'organisation"
107103
});
108104

109-
export const HeaderWithQuickAccessItems = getStory({
110-
"brandTop": (
111-
<>
112-
INTITULE
113-
<br />
114-
OFFICIEL
115-
</>
116-
),
117-
"homeLinkProps": {
118-
"href": "/",
119-
"title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)"
120-
},
121-
"serviceTitle": "Nom du site / service",
122-
"serviceTagline": "baseline - précisions sur l'organisation",
123-
"quickAccessItems": [
124-
{
125-
"iconId": "fr-icon-add-circle-line",
126-
"text": "Créer un espace",
127-
"linkProps": {
128-
"href": "#"
129-
}
130-
},
131-
{
132-
"iconId": "fr-icon-lock-line",
133-
"text": "Se connecter",
134-
"linkProps": {
135-
"href": "#"
136-
}
105+
export const HeaderWithQuickAccessItems = getStory(
106+
{
107+
"brandTop": (
108+
<>
109+
INTITULE
110+
<br />
111+
OFFICIEL
112+
</>
113+
),
114+
"homeLinkProps": {
115+
"href": "/",
116+
"title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)"
137117
},
138-
{
139-
"iconId": "ri-account-circle-line",
140-
"text": "S’enregistrer",
141-
"linkProps": {
142-
"href": "#"
118+
"serviceTitle": "Nom du site / service",
119+
"serviceTagline": "baseline - précisions sur l'organisation",
120+
"quickAccessItems": [
121+
{
122+
"iconId": "fr-icon-add-circle-line",
123+
"text": "Créer un espace",
124+
"linkProps": {
125+
"href": "#"
126+
}
127+
},
128+
{
129+
"iconId": "fr-icon-mail-fill",
130+
"linkProps": {
131+
"href": "mailto:contact@code.gouv.fr"
132+
},
133+
"text": "Contact us"
134+
},
135+
{
136+
"iconId": "ri-account-box-line",
137+
"text": "Se connecter",
138+
"buttonProps": {
139+
"onClick": () => {
140+
alert("TODO: implement login");
141+
}
142+
}
143143
}
144-
}
145-
]
146-
});
144+
]
145+
},
146+
{
147+
"description": `See [\\<Display \\/\\>](https://react-dsfr-components.etalab.studio/?path=/docs/components-display) for instructions on how to integrate the Dark mode switch.
148+
149+
Note for Next App Router: If you want to have \`quickAccessItems\` client side without having to wrap the whole \`<Header />\`
150+
component within a \`"use client";\` directive you can use the \`<HeaderQuickAccessItem />\` component as demonstrated
151+
[here](https://github.com/garronej/react-dsfr-next-appdir-demo/blob/b485bda99d6140e59584d3134ac9e203ae6b2208/app/layout.tsx#L72) and
152+
[here](https://github.com/garronej/react-dsfr-next-appdir-demo/blob/b485bda99d6140e59584d3134ac9e203ae6b2208/app/LoginHeaderItem.tsx#L1-L24).
153+
`
154+
}
155+
);
147156

148157
export const HeaderWithSearchEngine = getStory({
149158
"brandTop": (

0 commit comments

Comments
 (0)