From f8e3ab5aabbe16b957efa1c6d42ea29c8f44c1ce Mon Sep 17 00:00:00 2001 From: Jungu Lee <1zzangjun@gmail.com> Date: Thu, 14 Dec 2023 01:11:24 +0900 Subject: [PATCH] =?UTF-8?q?Refactor=20:=20=EB=B3=80=EA=B2=BD=EB=90=9C=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=20=ED=91=9C=EA=B8=B0=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/post/PostCard.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/client/src/components/post/PostCard.tsx b/client/src/components/post/PostCard.tsx index d419b21..5f6fb72 100644 --- a/client/src/components/post/PostCard.tsx +++ b/client/src/components/post/PostCard.tsx @@ -26,13 +26,12 @@ import "../newpost/quill.mention.css"; import { sanitize } from "isomorphic-dompurify"; import UserAvatar from "../user/info/UserAvatar"; import Link from "next/link"; -import HOME, { USER_PAGE } from "@/const/clientPath"; +import { USER_PAGE } from "@/const/clientPath"; import { useMyInfoQuery } from "@/queries/auth/useMyInfoQuery"; import PostCardOptionDropdown from "./PostCardOptionDropdown"; import { postcardContext } from "@/store/post/PostCardContext"; -import { useDeletePostMutation } from "@/queries/post/useDeletePostMutation"; -import useDeleteAttachMutation from "@/queries/attach/useDeleteAttachMutation"; import { useRouter } from "next/navigation"; +import formatTime from "@/utils/formatTime"; const PostCard = ({ postAttachUrls, @@ -52,7 +51,6 @@ const PostCard = ({ alcoholNo, }: PostInterface) => { const openPostDetailPage = useOpenPostDetailPage(); - const router = useRouter(); const hasImage = useMemo(() => postAttachUrls.length !== 0, [postAttachUrls]); @@ -61,9 +59,6 @@ const PostCard = ({ const { mutate: likeHandler } = useLikePostMutation(searchContext); const { mutate: unLikeHandler } = useUnLikePostMutation(searchContext); - const { mutateAsync: deletePost } = useDeletePostMutation(); - const { mutateAsync: deleteFile } = useDeleteAttachMutation(); - const { data: currentUser } = useMyInfoQuery(); const isMyPost = useMemo( @@ -106,7 +101,7 @@ const PostCard = ({ >{`@${id}`} - {dayjs(lastModifiedDate).format("MM.DD")} + {formatTime(lastModifiedDate)} @@ -149,7 +144,7 @@ const PostCard = ({ borderRadius: 2, bgcolor: "background.default", cursor: "pointer", - aspectRatio: 2.36 + aspectRatio: 2.36, }} /> )}