File tree Expand file tree Collapse file tree 3 files changed +22
-7
lines changed
Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ import NotificationBanner from "~/features/notifications/components/Notification
33import { NavBar } from " ./NavBar"
44
55const path = Astro .url .pathname
6+ const algoliaVars = {
7+ algoliaAppId: import .meta .env .PUBLIC_ALGOLIA_SEARCH_APP_ID || " " ,
8+ algoliaPublicApiKey: import .meta .env .PUBLIC_ALGOLIA_SEARCH_PUBLIC_API_KEY || " " ,
9+ }
610---
711
812<!-- Google Tag Manager (noscript) -->
@@ -12,6 +16,6 @@ const path = Astro.url.pathname
1216 width =" 0"
1317 style =" display:none;visibility:hidden" ></iframe >
1418<!-- End Google Tag Manager (noscript) -->
15- <NavBar path ={ path } client:idle />
19+ <NavBar path ={ path } client:idle algoliaVars = { algoliaVars } />
1620
1721<NotificationBanner />
Original file line number Diff line number Diff line change @@ -5,7 +5,15 @@ import { getNavigationProps } from "./getNavigationProps"
55import { useNavBar } from "./useNavBar/useNavBar"
66import styles from "./scroll.module.css"
77
8- export const NavBar = ( { path, showSearch = true } : { path : string ; showSearch ?: boolean } ) => {
8+ export const NavBar = ( {
9+ path,
10+ showSearch = true ,
11+ algoliaVars,
12+ } : {
13+ path : string
14+ showSearch ?: boolean
15+ algoliaVars : { algoliaAppId : string ; algoliaPublicApiKey : string }
16+ } ) => {
917 const navRef = React . useRef ( null )
1018
1119 const { setNavBarInfo } = useNavBar ( )
@@ -47,7 +55,7 @@ export const NavBar = ({ path, showSearch = true }: { path: string; showSearch?:
4755 < Nav
4856 { ...getNavigationProps ( ) }
4957 path = { path }
50- searchTrigger = { showSearch ? < Search /> : undefined }
58+ searchTrigger = { showSearch ? < Search algoliaVars = { algoliaVars } /> : undefined }
5159 onHideChange = { onHideChange }
5260 doubleNavbar = { doubleNavbar ( ) }
5361 />
Original file line number Diff line number Diff line change 11import { SearchButton } from "chainlink-algolia-search"
22import "chainlink-algolia-search/dist/index.css"
33
4- const algoliaAppId = import . meta. env . PUBLIC_ALGOLIA_SEARCH_APP_ID || ""
5- const algoliaPublicApiKey = import . meta. env . PUBLIC_ALGOLIA_SEARCH_PUBLIC_API_KEY || ""
6-
7- export const Search = ( { variant = "default" } : { variant ?: "default" | "mobile" } ) => {
4+ export const Search = ( {
5+ variant = "default" ,
6+ algoliaVars : { algoliaAppId, algoliaPublicApiKey } ,
7+ } : {
8+ variant ?: "default" | "mobile"
9+ algoliaVars : { algoliaAppId : string ; algoliaPublicApiKey : string }
10+ } ) => {
811 return < SearchButton algoliaAppId = { algoliaAppId } algoliaPublicApiKey = { algoliaPublicApiKey } />
912}
You can’t perform that action at this time.
0 commit comments