10
10
* governing permissions and limitations under the License.
11
11
*/
12
12
13
- import { ActionButton , defaultTheme , Provider , Text } from '@adobe/react-spectrum' ;
13
+ import { ActionButton , Text } from '@adobe/react-spectrum' ;
14
14
import algoliasearch from 'algoliasearch/lite' ;
15
15
import docsStyle from './docs.css' ;
16
16
import DOMPurify from 'dompurify' ;
@@ -19,7 +19,7 @@ import {listen} from 'quicklink';
19
19
import React , { useEffect , useRef , useState } from 'react' ;
20
20
import ReactDOM from 'react-dom' ;
21
21
import ShowMenu from '@spectrum-icons/workflow/ShowMenu' ;
22
- import { ThemeSwitcher } from './ThemeSwitcher' ;
22
+ import { ThemeProvider , ThemeSwitcher } from './ThemeSwitcher' ;
23
23
import { watchModals } from '@react-aria/aria-modal-polyfill' ;
24
24
25
25
if ( process . env . NODE_ENV === 'production' ) {
@@ -255,7 +255,6 @@ function DocSearch() {
255
255
) ;
256
256
} ) ;
257
257
let titles = Object . values ( sectionTitles ) ;
258
- sections . forEach ( ( section , index ) => console . log ( index , section . title , titles . indexOf ( section . title ) ) ) ;
259
258
sections = sections . sort ( ( a , b ) => titles . indexOf ( a . title ) < titles . indexOf ( b . title ) ? - 1 : 1 ) ;
260
259
let suggestions = sections . map ( ( section , index ) => < Section key = { `${ index } -${ section . title } ` } title = { section . title } > { section . items } </ Section > ) ;
261
260
setSuggestions ( suggestions ) ;
@@ -284,17 +283,19 @@ function DocSearch() {
284
283
} ;
285
284
286
285
return (
287
- < Provider theme = { defaultTheme } role = "search" >
288
- < SearchAutocomplete
289
- aria-label = "Search"
290
- UNSAFE_className = { docsStyle . docSearchBox }
291
- id = "algolia-doc-search"
292
- value = { searchValue }
293
- onInputChange = { onInputChange }
294
- onSubmit = { onSubmit } >
295
- { suggestions }
296
- </ SearchAutocomplete >
297
- </ Provider >
286
+ < ThemeProvider >
287
+ < span role = "search" >
288
+ < SearchAutocomplete
289
+ aria-label = "Search"
290
+ UNSAFE_className = { docsStyle . docSearchBox }
291
+ id = "algolia-doc-search"
292
+ value = { searchValue }
293
+ onInputChange = { onInputChange }
294
+ onSubmit = { onSubmit } >
295
+ { suggestions }
296
+ </ SearchAutocomplete >
297
+ </ span >
298
+ </ ThemeProvider >
298
299
) ;
299
300
}
300
301
0 commit comments