Skip to content

Commit

Permalink
Merge pull request #109 from timlrx/v2
Browse files Browse the repository at this point in the history
Update alogolia component
  • Loading branch information
timlrx authored Jul 16, 2023
2 parents 557082d + e509d0d commit cd08852
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"metal-coats-grab",
"mighty-garlics-appear",
"neat-tables-occur",
"pretty-worms-help",
"unlucky-keys-join"
]
}
5 changes: 5 additions & 0 deletions .changeset/pretty-worms-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'pliny': patch
---

update algolia component
6 changes: 6 additions & 0 deletions packages/pliny/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# pliny

## 0.1.0-beta.2

### Patch Changes

- 7d2f6b3: update algolia component

## 0.1.0-beta.1

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/pliny/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pliny",
"description": "Main entry point for pliny components",
"homepage": "https://github.com/timlrx/pliny",
"version": "0.1.0-beta.1",
"version": "0.1.0-beta.2",
"type": "module",
"exports": {
"./*": "./*",
Expand Down
1 change: 0 additions & 1 deletion packages/pliny/src/search.ts

This file was deleted.

16 changes: 1 addition & 15 deletions packages/pliny/src/search/Algolia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { AnchorHTMLAttributes } from 'react'
import { createPortal } from 'react-dom'
import { useRouter } from 'next/navigation.js'
import Link from 'next/link.js'
import Head from 'next/head.js'
import { useDocSearchKeyboardEvents } from '@docsearch/react'
import type { LinkProps } from 'next/link'
import type {
Expand Down Expand Up @@ -76,10 +75,7 @@ export const AlgoliaSearchProvider: React.FC<React.PropsWithChildren<AlgoliaSear
return Promise.resolve()
}

return Promise.all([
import('./AlgoliaModal'),
// import('@docsearch/react'),
]).then(([{ DocSearchModal: Modal }]) => {
return Promise.all([import('@docsearch/react')]).then(([{ DocSearchModal: Modal }]) => {
DocSearchModal = Modal
})
}, [])
Expand Down Expand Up @@ -149,16 +145,6 @@ export const AlgoliaSearchProvider: React.FC<React.PropsWithChildren<AlgoliaSear
<AlgoliaSearchContext.Provider
value={{ query: { setSearch: setInitialQuery, toggle: onOpen } }}
>
<Head>
{/* This hints the browser that the website will load data from Algolia,
and allows it to preconnect to the DocSearch cluster. It makes the first
query faster, especially on mobile. */}
<link
rel="preconnect"
href={`https://${algoliaConfig.appId}-dsn.algolia.net`}
crossOrigin="anonymous"
/>
</Head>
{props.children}
{isOpen &&
DocSearchModal &&
Expand Down

0 comments on commit cd08852

Please sign in to comment.