@@ -3,6 +3,7 @@ import styled from "styled-components"
3
3
import { useIntl } from "gatsby-plugin-intl"
4
4
import { motion } from "framer-motion"
5
5
6
+ import NakedButton from "../NakedButton"
6
7
import Translation from "../Translation"
7
8
import Icon from "../Icon"
8
9
import Link from "../Link"
@@ -11,6 +12,25 @@ import Emoji from "../Emoji"
11
12
import { NavLink } from "../../components/SharedStyledComponents"
12
13
import { translateMessageId } from "../../utils/translations"
13
14
15
+ const Container = styled . div `
16
+ display: none;
17
+ @media (max-width: ${ ( props ) => props . theme . breakpoints . l } ) {
18
+ display: flex;
19
+ }
20
+ `
21
+
22
+ const MenuIcon = styled ( Icon ) `
23
+ fill: ${ ( props ) => props . theme . colors . text } ;
24
+ `
25
+
26
+ const MenuButton = styled ( NakedButton ) `
27
+ margin-left: 1rem;
28
+ `
29
+
30
+ const SearchIcon = styled ( MenuIcon ) `
31
+ margin-right: 1rem;
32
+ `
33
+
14
34
const MobileModal = styled ( motion . div ) `
15
35
position: fixed;
16
36
background: ${ ( props ) => props . theme . colors . modalBackground } ;
@@ -179,10 +199,6 @@ const BottomItemText = styled.div`
179
199
}
180
200
`
181
201
182
- const MenuIcon = styled ( Icon ) `
183
- fill: ${ ( props ) => props . theme . colors . text } ;
184
- `
185
-
186
202
const BlankSearchState = styled . div `
187
203
color: ${ ( props ) => props . theme . colors . text } ;
188
204
background: ${ ( props ) => props . theme . colors . searchBackgroundEmpty } ;
@@ -211,14 +227,27 @@ const MobileNavMenu = ({
211
227
212
228
const isOpen = isMenuOpen || isSearchOpen
213
229
return (
214
- < >
230
+ < Container >
231
+ < MenuButton
232
+ onClick = { ( ) => toggleMenu ( "search" ) }
233
+ aria-label = { translateMessageId ( "aria-toggle-search-button" , intl ) }
234
+ >
235
+ < SearchIcon name = "search" />
236
+ </ MenuButton >
237
+ < MenuButton
238
+ onClick = { ( ) => toggleMenu ( "menu" ) }
239
+ aria-label = { translateMessageId ( "aria-toggle-menu-button" , intl ) }
240
+ >
241
+ < MenuIcon name = "menu" />
242
+ </ MenuButton >
215
243
< MobileModal
216
244
animate = { isOpen ? "open" : "closed" }
217
245
variants = { mobileModalVariants }
218
246
initial = "closed"
219
247
onClick = { toggleMenu }
220
248
/>
221
249
< MenuContainer
250
+ aria-hidden = { isMenuOpen ? false : true }
222
251
animate = { isMenuOpen ? "open" : "closed" }
223
252
variants = { mobileMenuVariants }
224
253
initial = "closed"
@@ -301,7 +330,7 @@ const MobileNavMenu = ({
301
330
< Translation id = "search-box-blank-state-text" />
302
331
</ BlankSearchState >
303
332
</ SearchContainer >
304
- </ >
333
+ </ Container >
305
334
)
306
335
}
307
336
0 commit comments