1
0
Fork 0

refactor: fix "snippet" typoe

This commit is contained in:
François Chalifour 2020-07-20 15:37:29 +02:00
parent 81092060d5
commit 00742f6711

View file

@ -54,7 +54,7 @@ export function DocSearchModal({
const searchBoxRef = React.useRef<HTMLDivElement | null>(null);
const dropdownRef = React.useRef<HTMLDivElement | null>(null);
const inputRef = React.useRef<HTMLInputElement | null>(null);
const snipetLength = React.useRef<number>(10);
const snippetLength = React.useRef<number>(10);
const initialQuery = React.useRef(
initialQueryFromProp || typeof window !== 'undefined'
? window.getSelection()!.toString().slice(0, MAX_QUERY_SIZE)
@ -176,13 +176,13 @@ export function DocSearchModal({
'url',
],
attributesToSnippet: [
`hierarchy.lvl1:${snipetLength.current}`,
`hierarchy.lvl2:${snipetLength.current}`,
`hierarchy.lvl3:${snipetLength.current}`,
`hierarchy.lvl4:${snipetLength.current}`,
`hierarchy.lvl5:${snipetLength.current}`,
`hierarchy.lvl6:${snipetLength.current}`,
`content:${snipetLength.current}`,
`hierarchy.lvl1:${snippetLength.current}`,
`hierarchy.lvl2:${snippetLength.current}`,
`hierarchy.lvl3:${snippetLength.current}`,
`hierarchy.lvl4:${snippetLength.current}`,
`hierarchy.lvl5:${snippetLength.current}`,
`hierarchy.lvl6:${snippetLength.current}`,
`content:${snippetLength.current}`,
],
snippetEllipsisText: '…',
highlightPreTag: '<mark>',
@ -303,7 +303,7 @@ export function DocSearchModal({
const isMobileMediaQuery = window.matchMedia('(max-width: 750px)');
if (isMobileMediaQuery.matches) {
snipetLength.current = 5;
snippetLength.current = 5;
}
}, []);