Skip to content

Commit 38d3ad6

Browse files
committed
fix(#1999): use ThemeProvider, remove console.log
1 parent 138527e commit 38d3ad6

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

packages/dev/docs/src/client.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
import {ActionButton, defaultTheme, Provider, Text} from '@adobe/react-spectrum';
13+
import {ActionButton, Text} from '@adobe/react-spectrum';
1414
import algoliasearch from 'algoliasearch/lite';
1515
import docsStyle from './docs.css';
1616
import DOMPurify from 'dompurify';
@@ -19,7 +19,7 @@ import {listen} from 'quicklink';
1919
import React, {useEffect, useRef, useState} from 'react';
2020
import ReactDOM from 'react-dom';
2121
import ShowMenu from '@spectrum-icons/workflow/ShowMenu';
22-
import {ThemeSwitcher} from './ThemeSwitcher';
22+
import {ThemeProvider, ThemeSwitcher} from './ThemeSwitcher';
2323
import {watchModals} from '@react-aria/aria-modal-polyfill';
2424

2525
if (process.env.NODE_ENV === 'production') {
@@ -255,7 +255,6 @@ function DocSearch() {
255255
);
256256
});
257257
let titles = Object.values(sectionTitles);
258-
sections.forEach((section, index) => console.log(index, section.title, titles.indexOf(section.title)));
259258
sections = sections.sort((a, b) => titles.indexOf(a.title) < titles.indexOf(b.title) ? -1 : 1);
260259
let suggestions = sections.map((section, index) => <Section key={`${index}-${section.title}`} title={section.title}>{section.items}</Section>);
261260
setSuggestions(suggestions);
@@ -284,17 +283,19 @@ function DocSearch() {
284283
};
285284

286285
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>
298299
);
299300
}
300301

0 commit comments

Comments
 (0)