Skip to content

Commit

Permalink
Add close button to PostPreview
Browse files Browse the repository at this point in the history
  • Loading branch information
michalmasrna1 committed Nov 23, 2024
1 parent 5a13cd0 commit 711c634
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/components/Admin/custom/PostPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ export const PostPreview: FC = () => {
</Stack>
</Grid>
<Grid xs={5}>
{isDetailOpen && <PostDetail caption={formData?.caption ?? ''} details={formData?.details ?? ''} />}
{isDetailOpen && (
<PostDetail
closeDetail={() => openDetail(false)}
caption={formData?.caption ?? ''}
details={formData?.details ?? ''}
/>
)}
</Grid>
</Grid>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Posts/PostDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type PostDetailProps = {
closeDetail: () => void
}

export const PostDetail: FC<PostDetailProps> = ({caption, details, closeDetail: closeDetail}) => {
export const PostDetail: FC<PostDetailProps> = ({caption, details, closeDetail}) => {
return (
<Stack
p={2}
Expand Down

0 comments on commit 711c634

Please sign in to comment.