Skip to content

Commit 41679d1

Browse files
committed
Fix search not displaying on mobile
1 parent 353689a commit 41679d1

File tree

3 files changed

+125
-1
lines changed

3 files changed

+125
-1
lines changed

src/Header/Header.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ export const Header = memo(
150150
classes.navbar
151151
)}
152152
>
153+
<button
154+
className={fr.cx("fr-btn--search", "fr-btn")}
155+
data-fr-opened={false}
156+
aria-controls={searchModalId}
157+
title={t("search")}
158+
>
159+
{t("search")}
160+
</button>
153161
<button
154162
className={fr.cx("fr-btn--menu", "fr-btn")}
155163
data-fr-opened="false"

stories/DisplaySettingsDialog.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const { meta, getStory } = getStoryFactory({
1515
A button that opens a dialog to enable the user to select light or dark mode.
1616
1717
- [See DSFR documentation](https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/parametres-d-affichage),
18-
- [See source code](https://github.com/codegouvfr/react-dsfr/blob/main/src/DarkModeSwitch.tsx)
18+
- [See source code](https://github.com/codegouvfr/react-dsfr/blob/main/src/DisplaySettingsDialog.tsx)
1919
2020
Optionally, you can also use \`import { useIsDark } from "@codegouvfr/react-dsfr"\` to manually monitor and controls
2121
the theme state.

stories/Header.stories.tsx

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,119 @@ export const SimpleHeader = getStory({
5858
}
5959
]
6060
});
61+
62+
export const SimpleHeaderWithServiceTitleAndTagline = getStory({
63+
"brandTop": (
64+
<>
65+
INTITULE
66+
<br />
67+
OFFICIEL
68+
</>
69+
),
70+
"homeLinkProps": {
71+
"href": "/",
72+
"title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)"
73+
},
74+
"serviceTitle": "Nom du site / service",
75+
"serviceTagline": "baseline - précisions sur l'organisation"
76+
});
77+
78+
export const HeaderWithQuickAccessItems = getStory({
79+
"brandTop": (
80+
<>
81+
INTITULE
82+
<br />
83+
OFFICIEL
84+
</>
85+
),
86+
"homeLinkProps": {
87+
"href": "/",
88+
"title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)"
89+
},
90+
"serviceTitle": "Nom du site / service",
91+
"serviceTagline": "baseline - précisions sur l'organisation",
92+
"quickAccessItems": [
93+
{
94+
"iconId": "fr-icon-add-circle-line",
95+
"text": "Créer un espace",
96+
"linkProps": {
97+
"href": "#"
98+
}
99+
},
100+
{
101+
"iconId": "fr-icon-lock-line",
102+
"text": "Se connecter",
103+
"linkProps": {
104+
"href": "#"
105+
}
106+
},
107+
{
108+
"iconId": "fr-icon-account-line",
109+
"text": "S’enregistrer",
110+
"linkProps": {
111+
"href": "#"
112+
}
113+
}
114+
]
115+
});
116+
117+
export const HeaderWithSearchEngine = getStory({
118+
"brandTop": (
119+
<>
120+
INTITULE
121+
<br />
122+
OFFICIEL
123+
</>
124+
),
125+
"homeLinkProps": {
126+
"href": "/",
127+
"title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)"
128+
},
129+
"serviceTitle": "Nom du site / service",
130+
"serviceTagline": "baseline - précisions sur l'organisation",
131+
"renderSearchInput": ({ className, id, name, placeholder, type }) => (
132+
<input className={className} id={id} name={name} placeholder={placeholder} type={type} />
133+
)
134+
});
135+
136+
export const HeaderWithQuickAccessItemsAndSearchEngine = getStory({
137+
"brandTop": (
138+
<>
139+
INTITULE
140+
<br />
141+
OFFICIEL
142+
</>
143+
),
144+
"homeLinkProps": {
145+
"href": "/",
146+
"title": "Accueil - Nom de l’entité (ministère, secrétariat d‘état, gouvernement)"
147+
},
148+
"serviceTitle": "Nom du site / service",
149+
"serviceTagline": "baseline - précisions sur l'organisation",
150+
"quickAccessItems": [
151+
{
152+
"iconId": "fr-icon-add-circle-line",
153+
"text": "Créer un espace",
154+
"linkProps": {
155+
"href": "#"
156+
}
157+
},
158+
{
159+
"iconId": "fr-icon-lock-line",
160+
"text": "Se connecter",
161+
"linkProps": {
162+
"href": "#"
163+
}
164+
},
165+
{
166+
"iconId": "fr-icon-account-line",
167+
"text": "S’enregistrer",
168+
"linkProps": {
169+
"href": "#"
170+
}
171+
}
172+
],
173+
"renderSearchInput": ({ className, id, name, placeholder, type }) => (
174+
<input className={className} id={id} name={name} placeholder={placeholder} type={type} />
175+
)
176+
});

0 commit comments

Comments
 (0)