Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

feat: disable search feature

xiaodong zuo08ec766353a1
diff --git a/libs/components/editor-plugins/src/search/Search.tsx b/libs/components/editor-plugins/src/search/Search.tsx
index 23a3f46c2c..6092862416 100644
--- a/libs/components/editor-plugins/src/search/Search.tsx
+++ b/libs/components/editor-plugins/src/search/Search.tsx
@@ -5,12 +5,7 @@ import {
styled,
TransitionsModal,
} from '@toeverything/components/ui';
-import {
- BlockEditor,
- HookType,
- PluginHooks,
- Virgo,
-} from '@toeverything/framework/virgo';
+import { BlockEditor, PluginHooks, Virgo } from '@toeverything/framework/virgo';
import { throttle } from '@toeverything/utils';
import { useCallback, useEffect, useState } from 'react';
import { useNavigate, useParams } from 'react-router';
@@ -76,13 +71,13 @@ export const Search = (props: SearchProps) => {
setSearch('');
}, []);
- useEffect(() => {
- const sub = props.hooks.get(HookType.ON_SEARCH).subscribe(handleSearch);
+ // useEffect(() => {
+ // const sub = props.hooks.get(HookType.ON_SEARCH).subscribe(handleSearch);
- return () => {
- sub.unsubscribe();
- };
- }, [props, handleSearch]);
+ // return () => {
+ // sub.unsubscribe();
+ // };
+ // }, [props, handleSearch]);
return (
<TransitionsModal
diff --git a/libs/components/layout/src/header/LayoutHeader.tsx b/libs/components/layout/src/header/LayoutHeader.tsx
index a1e183ee03..9b104b4442 100644
--- a/libs/components/layout/src/header/LayoutHeader.tsx
+++ b/libs/components/layout/src/header/LayoutHeader.tsx
@@ -57,6 +57,7 @@ export const LayoutHeader = () => {
size="large"
hoverColor={'transparent'}
onClick={handleSearch}
+ disabled={true}
>
<SearchIcon />
</IconButton>