@@ -3,7 +3,7 @@ import {Button, Box} from '@primer/react'
3
3
import { XIcon , SearchIcon } from '@primer/octicons-react'
4
4
import { AnimatePresence , motion } from 'framer-motion'
5
5
import { FocusOn } from 'react-focus-on'
6
- import DarkTextInput from './dark- text-input'
6
+ import TextInput from './text-input'
7
7
import SearchResults from './search-results'
8
8
import useSiteMetadata from '../hooks/use-site-metadata'
9
9
@@ -21,7 +21,7 @@ function MobileSearch({onDismiss, ...props}) {
21
21
< Box
22
22
sx = { {
23
23
position : 'fixed' ,
24
- top : '10px' ,
24
+ top : '10px' , // TODO: use constant
25
25
left : 0 ,
26
26
right : 0 ,
27
27
bottom : 0 ,
@@ -35,7 +35,7 @@ function MobileSearch({onDismiss, ...props}) {
35
35
left : 0 ,
36
36
right : 0 ,
37
37
bottom : 0 ,
38
- bg : 'rgba(0,0,0,0.5) ' ,
38
+ bg : 'primer.canvas.backdrop ' ,
39
39
zIndex : - 1 ,
40
40
} }
41
41
as = { motion . div }
@@ -45,19 +45,20 @@ function MobileSearch({onDismiss, ...props}) {
45
45
onClick = { handleDismiss }
46
46
/>
47
47
< Box sx = { { display : 'flex' , flexDirection : 'column' , height : isOpen ? '100%' : 'auto' } } >
48
- < Box sx = { { display : 'flex' , bg : 'gray.9 ' , color : 'white ' , p : 3 , flex : '0 0 auto' } } >
48
+ < Box sx = { { display : 'flex' , bg : 'canvas.default ' , color : 'fg.default ' , p : 3 , flex : '0 0 auto' } } >
49
49
< motion . div
50
50
initial = { { scaleX : 0.1 } }
51
51
animate = { { scaleX : 1 } }
52
52
exit = { { scaleX : 0.1 , transition : { duration : 0.1 } } }
53
53
transition = { { type : 'tween' , duration : 0.2 } }
54
54
style = { { width : '100%' , originX : '100%' } }
55
55
>
56
- < DarkTextInput
56
+ < TextInput
57
+ leadingVisual = { SearchIcon }
57
58
{ ...getInputProps ( {
58
59
placeholder : `Search ${ siteMetadata . title } ` ,
59
60
'aria-label' : `Search ${ siteMetadata . title } ` ,
60
- width : '100%' ,
61
+ sx : { width : '100%' } ,
61
62
} ) }
62
63
/>
63
64
</ motion . div >
@@ -66,16 +67,19 @@ function MobileSearch({onDismiss, ...props}) {
66
67
</ Button >
67
68
</ Box >
68
69
< Box
69
- { ...getMenuProps ( ) }
70
- sx = { {
71
- display : 'flex' ,
72
- bg : 'white' ,
73
- py : isOpen ? 1 : 0 ,
74
- flexDirection : 'column' ,
75
- flex : '1 1 auto' ,
76
- overflow : 'auto' ,
77
- WebkitOverflowScrolling : 'touch' ,
78
- } }
70
+ { ...getMenuProps ( {
71
+ sx : {
72
+ display : 'flex' ,
73
+ bg : 'canvas.default' ,
74
+ py : isOpen ? 1 : 0 ,
75
+ flexDirection : 'column' ,
76
+ flex : '1 1 auto' ,
77
+ } ,
78
+ style : {
79
+ overflow : 'auto' ,
80
+ WebkitOverflowScrolling : 'touch' ,
81
+ } ,
82
+ } ) }
79
83
>
80
84
{ isOpen ? < SearchResults { ...{ results, getItemProps, highlightedIndex} } /> : null }
81
85
</ Box >
0 commit comments