Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Commit

Permalink
feat(website): add link to search page in DocSearch modal
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Jun 8, 2020
1 parent efafeab commit d610ce9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/website/src/theme/SearchBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ function Hit({ hit, children }) {
return <Link to={hit.url}>{children}</Link>;
}

function ResultsFooter({ state }) {
return (
<Link to={`/search?q=${state.query}`}>
See {state.context.nbHits} results
</Link>
);
}

function DocSearch({ indexName, appId, apiKey, searchParameters }) {
const history = useHistory();
const [isOpen, setIsOpen] = useState(false);
Expand Down Expand Up @@ -91,6 +99,7 @@ function DocSearch({ indexName, appId, apiKey, searchParameters }) {
});
}}
hitComponent={Hit}
resultsFooterComponent={ResultsFooter}
/>,
document.body
)}
Expand Down

0 comments on commit d610ce9

Please sign in to comment.