diff --git a/src/components/Nav/MobileNavMenu.tsx b/src/components/Nav/MobileNavMenu.tsx index ddcb3e0..c500933 100644 --- a/src/components/Nav/MobileNavMenu.tsx +++ b/src/components/Nav/MobileNavMenu.tsx @@ -69,7 +69,7 @@ export default function MobileNavMenu({ }, }} > - + ); diff --git a/src/components/Search/Search.tsx b/src/components/Search/Search.tsx index 105034d..4d100b9 100644 --- a/src/components/Search/Search.tsx +++ b/src/components/Search/Search.tsx @@ -1,10 +1,5 @@ -import React, { useState, useEffect, createRef, useMemo } from "react"; -import { - InstantSearch, - Index, - Hits, - connectStateResults, -} from "react-instantsearch-dom"; +import React, { useState, useMemo, useRef } from "react"; +import { InstantSearch, Index, Hits } from "react-instantsearch-dom"; import algoliasearch from "algoliasearch/lite"; import { HitsWrapper, @@ -18,9 +13,17 @@ import CustomStateResults from "./CustomStateResults"; /** @jsx jsx */ import { Styled, jsx } from "theme-ui"; -export default function Search() { +interface SearchProps { + setMobileNavOpen?: (val: boolean) => void; +} + +export default function Search({ + setMobileNavOpen = (val) => {}, +}: SearchProps) { + const ref = useRef(); const [query, setQuery] = useState(``); const [focus, setFocus] = useState(false); + const searchClient = useMemo( () => algoliasearch( @@ -30,7 +33,7 @@ export default function Search() { [] ); return ( - + setMobileNavOpen(false)}> )} - + ); }