Skip to content

Commit f3f44f7

Browse files
committed
use algolia search package
1 parent fb1f1fa commit f3f44f7

File tree

4 files changed

+86
-9
lines changed

4 files changed

+86
-9
lines changed

.env.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
ALGOLIA_APP_ID=I9A62UQS9Z
22
ALGOLIA_WRITE_API_KEY=
3-
ALGOLIA_INDEX_NAME=docs-test
3+
ALGOLIA_INDEX_NAME=docs-test
4+
PUBLIC_ALGOLIA_SEARCH_APP_ID=
5+
PUBlIC_ALGOLIA_SEARCH_PUBLIC_API_KEY=

package-lock.json

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"@openzeppelin/contracts": "^4.9.6",
5151
"astro": "^4.9.1",
5252
"bignumber.js": "^9.1.2",
53+
"chainlink-algolia-search": "^0.1.0",
5354
"clipboard": "^2.0.11",
5455
"dotenv": "^16.4.5",
5556
"ethers": "^5.7.2",
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import { SearchButton } from "./SearchButton"
2-
import { SearchModal } from "./SearchModal"
1+
import { SearchButton } from "chainlink-algolia-search"
2+
import "chainlink-algolia-search/dist/index.css"
3+
4+
const algoliaAppId = import.meta.env.PUBLIC_ALGOLIA_SEARCH_APP_ID || ""
5+
const algoliaPublicApiKey = import.meta.env.PUBLIC_ALGOLIA_SEARCH_PUBLIC_API_KEY || ""
36

47
export const Search = ({ variant = "default" }: { variant?: "default" | "mobile" }) => {
5-
return (
6-
<>
7-
<SearchButton variant={variant} />
8-
<SearchModal />
9-
</>
10-
)
8+
return <SearchButton algoliaAppId={algoliaAppId} algoliaPublicApiKey={algoliaPublicApiKey} />
119
}

0 commit comments

Comments
 (0)