docs: fix search in reference (#1971)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2022-08-02 17:30:33 +03:00
1 parent 36e2e7a4df
commit bb136530c1
2 files changed
+3

No files matched your search

+1
View File
@@ -64,6 +64,7 @@ module.exports = {
resolve: `gatsby-plugin-env-variables`, resolve: `gatsby-plugin-env-variables`,
options: { options: {
allowList: ["ALGOLIA_API_KEY"], allowList: ["ALGOLIA_API_KEY"],
allowList: ["ALGOLIA_APP_ID"],
}, },
}, },
{ {
@@ -9,6 +9,7 @@ import { convertToKebabCase } from "../../utils/convert-to-kebab-case"
import { navigate } from "gatsby-link" import { navigate } from "gatsby-link"
const algoliaApiKey = process.env.ALGOLIA_API_KEY || "temp" const algoliaApiKey = process.env.ALGOLIA_API_KEY || "temp"
const algoliaAppId = process.env.ALGOLIA_APP_ID || "temp"
const Search = ({data}) => { const Search = ({data}) => {
const { goTo, api } = useContext(NavigationContext) const { goTo, api } = useContext(NavigationContext)
@@ -72,6 +73,7 @@ const Search = ({data}) => {
return ( return (
<DocSearch <DocSearch
apiKey={algoliaApiKey} apiKey={algoliaApiKey}
appId={algoliaAppId}
indexName="medusa-commerce" indexName="medusa-commerce"
hitComponent={({hit, children}) => <HitComponent data={data} hit={hit} children={children} />} hitComponent={({hit, children}) => <HitComponent data={data} hit={hit} children={children} />}
navigator={{ navigator={{