From 711c634ccf57355be6fe1551139361a9d633b2ad Mon Sep 17 00:00:00 2001 From: Michal Masrna Date: Sat, 23 Nov 2024 13:15:50 +0100 Subject: [PATCH] Add close button to PostPreview --- src/components/Admin/custom/PostPreview.tsx | 8 +++++++- src/components/Posts/PostDetail.tsx | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Admin/custom/PostPreview.tsx b/src/components/Admin/custom/PostPreview.tsx index 77efd5a0..c21e4ebc 100644 --- a/src/components/Admin/custom/PostPreview.tsx +++ b/src/components/Admin/custom/PostPreview.tsx @@ -32,7 +32,13 @@ export const PostPreview: FC = () => { - {isDetailOpen && } + {isDetailOpen && ( + openDetail(false)} + caption={formData?.caption ?? ''} + details={formData?.details ?? ''} + /> + )} )} diff --git a/src/components/Posts/PostDetail.tsx b/src/components/Posts/PostDetail.tsx index f2bbc891..f745ad51 100644 --- a/src/components/Posts/PostDetail.tsx +++ b/src/components/Posts/PostDetail.tsx @@ -10,7 +10,7 @@ type PostDetailProps = { closeDetail: () => void } -export const PostDetail: FC = ({caption, details, closeDetail: closeDetail}) => { +export const PostDetail: FC = ({caption, details, closeDetail}) => { return (