Skip to content

Commit

Permalink
Only show "everywhere" if useAllContextsWithNoSearchContext is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
aericson committed Feb 10, 2023
1 parent 1da65ad commit c8b9175
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions docusaurus-search-local/src/client/theme/SearchPage/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import { highlightStemmed } from "../../utils/highlightStemmed";
import { getStemmedPositions } from "../../utils/getStemmedPositions";
import LoadingRing from "../LoadingRing/LoadingRing";
import { concatDocumentPath } from "../../utils/concatDocumentPath";
import { Mark, searchContextByPaths } from "../../utils/proxiedGenerated";
import {
Mark,
searchContextByPaths,
useAllContextsWithNoSearchContext,
} from "../../utils/proxiedGenerated";

import styles from "./SearchPage.module.css";

Expand Down Expand Up @@ -162,10 +166,12 @@ function SearchPageContent(): React.ReactElement {
onChange={(e) => updateSearchContext(e.target.value)}
>
<option value="">
{translate({
id: "theme.SearchPage.searchContext.everywhere",
message: "everywhere",
})}
{useAllContextsWithNoSearchContext
? translate({
id: "theme.SearchPage.searchContext.everywhere",
message: "everywhere",
})
: ""}
</option>
{searchContextByPaths.map((context: string) => (
<option key={context} value={context}>
Expand Down

0 comments on commit c8b9175

Please sign in to comment.