Skip to content

Commit

Permalink
Refactor : 변경된 시간 표기 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
jobkaeHenry committed Dec 13, 2023
1 parent 127a45e commit f8e3ab5
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions client/src/components/post/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -52,7 +51,6 @@ const PostCard = ({
alcoholNo,
}: PostInterface) => {
const openPostDetailPage = useOpenPostDetailPage();
const router = useRouter();

const hasImage = useMemo(() => postAttachUrls.length !== 0, [postAttachUrls]);

Expand All @@ -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(
Expand Down Expand Up @@ -106,7 +101,7 @@ const PostCard = ({
>{`@${id}`}</Typography>
</Link>
<Typography variant="label" color={"text.secondary"}>
{dayjs(lastModifiedDate).format("MM.DD")}
{formatTime(lastModifiedDate)}
</Typography>
</Stack>

Expand Down Expand Up @@ -149,7 +144,7 @@ const PostCard = ({
borderRadius: 2,
bgcolor: "background.default",
cursor: "pointer",
aspectRatio: 2.36
aspectRatio: 2.36,
}}
/>
)}
Expand Down

0 comments on commit f8e3ab5

Please sign in to comment.