We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9f0414 commit 9789549Copy full SHA for 9789549
src/components/PostPreview/PostPreview.tsx
@@ -7,6 +7,8 @@ import {
7
PreviewContainer
8
} from './PostPreview.style';
9
import { Link } from '@components/Link';
10
+import { openSearch } from '@pages/layout/states/openSearch';
11
+import { useSetRecoilState } from 'recoil';
12
13
interface PostPreviewProps {
14
post: EditedPost;
@@ -25,9 +27,13 @@ const PostPreview = ({
25
27
const previewContent = `${content.substring(0, 100)}${
26
28
content.length > 100 ? '...' : ''
29
}`;
30
+ const setResultShown = useSetRecoilState(openSearch);
31
+ const handlePreviewClick = () => {
32
+ setResultShown(false);
33
+ };
34
35
return (
- <PreviewContainer>
36
+ <PreviewContainer onClick={handlePreviewClick}>
37
<PostHeaderContainer>
38
<PostHeader
39
post={post}
0 commit comments