Skip to content

Commit

Permalink
Fix ts issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Sep 5, 2024
1 parent 255f851 commit 08348bb
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
6 changes: 2 additions & 4 deletions components/Search/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ import { usePagination, useSearchBox } from 'react-instantsearch'
import { autocomplete } from '@algolia/autocomplete-js'
import { createLocalStorageRecentSearchesPlugin } from '@algolia/autocomplete-plugin-recent-searches'
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions'
// @ts-ignore
import { debounce } from '@algolia/autocomplete-shared'

import {
INSTANT_SEARCH_INDEX_NAME,
INSTANT_SEARCH_QUERY_SUGGESTIONS,
} from 'src/constants'
import { INSTANT_SEARCH_QUERY_SUGGESTIONS } from 'src/constants'

import '@algolia/autocomplete-theme-classic'

Expand Down
18 changes: 11 additions & 7 deletions components/Search/SearchHit.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import React from 'react'
import { Snippet } from 'react-instantsearch'

import { useRouter } from 'next/router'

interface NodeHit {
id: string
name: string
publisher_id: string
total_install: number
version: string
}

type HitProps = {
hit: {
id: string
name: string
publisher_id: string
total_install: number
version: string
}
hit: NodeHit
}

const Hit: React.FC<HitProps> = ({ hit }) => {
Expand All @@ -26,6 +29,7 @@ const Hit: React.FC<HitProps> = ({ hit }) => {
>
<div className="flex flex-col px-4">
<h6 className="mb-2 text-base font-bold tracking-tight text-white break-words">
{/* @ts-ignore */}
<Snippet hit={hit} attribute="name" />
</h6>

Expand Down
2 changes: 1 addition & 1 deletion components/common/CustomSearchPagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function CustomSearchPagination(props: UsePaginationProps) {
return (
<div className="flex mt-2 sm:justify-center">
<FlowbitePagination
theme={CustomThemePagination}
theme={CustomThemePagination as any} // Add 'as any' to bypass type checking
currentPage={currentRefinement + 1}
totalPages={nbPages}
onPageChange={handlePageChange}
Expand Down
12 changes: 7 additions & 5 deletions components/registry/Registry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ const Registry: React.FC<RegistryProps> = ({}) => {
<InstantSearch
searchClient={searchClient}
indexName={INSTANT_SEARCH_INDEX_NAME}
routing={{
history: {
cleanUrlOnDispose: false,
},
}}
routing={
{
history: {
cleanUrlOnDispose: false,
},
} as any
}
future={{
preserveSharedStateOnUnmount: true,
}}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@algolia/autocomplete-js": "^1.17.4",
"@algolia/autocomplete-plugin-query-suggestions": "1.17.4",
"@algolia/autocomplete-plugin-recent-searches": "^1.17.4",
"@algolia/autocomplete-shared": "^1.17.4",
"@algolia/autocomplete-theme-classic": "1.17.4",
"@mdx-js/loader": "^3.0.1",
"@next/mdx": "12.3.1",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 08348bb

Please sign in to comment.