diff --git a/src/pages/post/[postId]/index.tsx b/src/pages/post/[postId]/index.tsx index 4a6e6a6d..6d69ad63 100644 --- a/src/pages/post/[postId]/index.tsx +++ b/src/pages/post/[postId]/index.tsx @@ -48,6 +48,7 @@ const PostDetailPage = ({ postId }: Props): ReactElement => { const router = useRouter() const [tradeStatus, setTradeStatus] = useState() + const [selectedImageIndex, setSelectedImageIndex] = useState(0) const tradeStatusDialog = useModal() const deleteModal = useModal() @@ -80,18 +81,22 @@ const PostDetailPage = ({ postId }: Props): ReactElement => { return <> } + const handleChangeIndicator = (idx: number) => { + setSelectedImageIndex(idx) + } + return ( <>
-
- -
+
@@ -179,6 +184,7 @@ const PostDetailPage = ({ postId }: Props): ReactElement => { images={postImages} isOpen={imageModal.isOpen} name="post-detail" + selectedIndex={selectedImageIndex} onClose={imageModal.closeModal} /> { onChange={e => handleUpdatePostForm('title', e.target.value)} /> - {postForm.title?.length}/40 + {postForm.title?.length || 0}/40