Skip to content

Commit

Permalink
Fix these too
Browse files Browse the repository at this point in the history
  • Loading branch information
brndnmtthws committed Nov 8, 2023
1 parent 966864e commit e9b14f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion web/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default function Layout({ children, searchIndex }: LayoutProps) {
<Header
searchIndex={searchIndex}
name="Conky"
darkMode={darkMode}
setDarkMode={setDarkMode}
/>
</div>
Expand Down
12 changes: 6 additions & 6 deletions web/components/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Fuse from 'fuse.js'
import Fuse, { FuseResult } from 'fuse.js'
import React, { Fragment, useCallback, useEffect, useState } from 'react'
import { Search as SearchIcon } from 'react-feather'
import { SearchItem } from '../utils/search'
Expand All @@ -10,7 +10,7 @@ export interface SearchProps {
}

interface SearchResultProps {
result: Fuse.FuseResult<SearchItem>
result: FuseResult<SearchItem>
selected: boolean
active: boolean
}
Expand Down Expand Up @@ -60,9 +60,9 @@ const SearchResult: React.FunctionComponent<SearchResultProps> = (props) => {
const Search: React.FunctionComponent<SearchProps> = ({ fuse }) => {
const router = useRouter()
const [searchText, setSearchText] = useState('')
const [searchResults, setSearchResults] = useState<
Fuse.FuseResult<SearchItem>[]
>([])
const [searchResults, setSearchResults] = useState<FuseResult<SearchItem>[]>(
[]
)

const [isOpen, setIsOpen] = useState(false)
const handleKeyPress = useCallback(
Expand Down Expand Up @@ -94,7 +94,7 @@ const Search: React.FunctionComponent<SearchProps> = ({ fuse }) => {
const searchResult = fuse.search(value)
setSearchResults(searchResult)
}
const onChange = (value?: Fuse.FuseResult<SearchItem>) => {
const onChange = (value?: FuseResult<SearchItem>) => {
if (value) {
if (value.item.kind === 'var') {
router.push(`/variables#${value.item.name}`, undefined, {
Expand Down
4 changes: 2 additions & 2 deletions web/utils/search.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Fuse from 'fuse.js'
import Fuse, { FuseIndexRecords } from 'fuse.js'
import { getConfigSettings, getLua, getVariables } from './doc-utils'
export interface SearchItem {
kind: string
Expand All @@ -8,7 +8,7 @@ export interface SearchItem {
export interface SearchIndex {
index: {
keys: readonly string[]
records: Fuse.FuseIndexRecords
records: FuseIndexRecords
}
list: SearchItem[]
}
Expand Down

0 comments on commit e9b14f1

Please sign in to comment.