docs: fix search in reference (#1971)

This commit is contained in:
Shahed Nasser
2022-08-02 17:30:33 +03:00
committed by GitHub
parent 36e2e7a4df
commit bb136530c1
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -64,6 +64,7 @@ module.exports = {
resolve: `gatsby-plugin-env-variables`,
options: {
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"
const algoliaApiKey = process.env.ALGOLIA_API_KEY || "temp"
const algoliaAppId = process.env.ALGOLIA_APP_ID || "temp"
const Search = ({data}) => {
const { goTo, api } = useContext(NavigationContext)
@@ -72,6 +73,7 @@ const Search = ({data}) => {
return (
<DocSearch
apiKey={algoliaApiKey}
appId={algoliaAppId}
indexName="medusa-commerce"
hitComponent={({hit, children}) => <HitComponent data={data} hit={hit} children={children} />}
navigator={{