fix: lint error

This commit is contained in:
QiShaoXuan
2022-12-13 17:47:41 +08:00
parent e1928e0872
commit 447c6b869e
3 changed files with 6 additions and 9 deletions
@@ -23,8 +23,3 @@ export const StyledButtonWrapper = styled.div(() => {
},
};
});
export const StyledLoadingWrapper = styled.div(() => {
return {
}
})
@@ -2,7 +2,9 @@ import React from 'react';
import { Command, useCommandState } from 'cmdk';
const noResult = () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const search = useCommandState(state => state.search);
// eslint-disable-next-line react/no-unescaped-entities
return <Command.Empty>No results found for "{search}".</Command.Empty>;
};
@@ -26,9 +26,9 @@ export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
const [result, setResult] = useState({});
const { pageList } = useEditor();
const { triggerQuickSearchModal } = useModal();
useEffect(() => {
setResult(search(query, { enrich: true }));
}, [query]);
// useEffect(() => {
// setResult(search(query, { enrich: true }));
// }, [query]);
useEffect(() => {
const down = (e: KeyboardEvent) => {
if (e.key === 'k' && e.metaKey) {
@@ -44,7 +44,7 @@ export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
};
document.addEventListener('keydown', down);
return () => document.removeEventListener('keydown', down);
}, [open]);
}, [open, triggerQuickSearchModal]);
return (
<Modal open={open} onClose={onClose} wrapperPosition={['top', 'center']}>
<ModalWrapper