We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a9f0414 + 9789549 commit a3f366cCopy full SHA for a3f366c
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