Skip to content

Commit 61df74f

Browse files
committed
refactor: PostCard > Post 로 컴포넌트명 수정
1 parent d2f68de commit 61df74f

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

panda-market/src/app/(main)/boards/_components/BestPostCard.tsx renamed to panda-market/src/app/(main)/boards/_components/BestPost.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import Image from 'next/image';
44

5-
type BestPostCardProps = {
5+
type BestPostProps = {
66
title: string;
77
imageUrl: string;
88
likeCount: number;
@@ -11,14 +11,14 @@ type BestPostCardProps = {
1111
onClick: () => void;
1212
};
1313

14-
export default function BestPostCard({
14+
export default function BestPost({
1515
title,
1616
imageUrl,
1717
likeCount,
1818
nickName,
1919
createdAt,
2020
onClick,
21-
}: BestPostCardProps) {
21+
}: BestPostProps) {
2222
return (
2323
<article
2424
onClick={onClick}

panda-market/src/app/(main)/boards/_components/BestPostList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import BestPostCard from '@/app/(main)/boards/_components/BestPostCard';
3+
import BestPost from '@/app/(main)/boards/_components/BestPost';
44
import { ArticleResponse } from '@/lib/types/article';
55
import { useRouter } from 'next/navigation';
66

@@ -24,7 +24,7 @@ export default function BestPostList({ posts }: BestPostListProps) {
2424
);
2525

2626
return (
27-
<BestPostCard
27+
<BestPost
2828
key={post.id}
2929
title={post.title}
3030
imageUrl={isValidImage ? post.image : '/images/default_card.png'}

panda-market/src/app/(main)/boards/_components/PostCard.tsx renamed to panda-market/src/app/(main)/boards/_components/Post.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import Image from 'next/image';
44

5-
type PostCardProps = {
5+
type PostProps = {
66
title: string;
77
imageUrl: string;
88
likeCount: number;
@@ -11,14 +11,14 @@ type PostCardProps = {
1111
onClick: () => void;
1212
};
1313

14-
export default function PostCard({
14+
export default function Post({
1515
title,
1616
imageUrl,
1717
likeCount,
1818
nickName,
1919
createdAt,
2020
onClick,
21-
}: PostCardProps) {
21+
}: PostProps) {
2222
return (
2323
<article
2424
onClick={onClick}

panda-market/src/app/(main)/boards/_components/PostList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import { ArticleResponse } from '@/lib/types/article';
4-
import PostCard from './PostCard';
4+
import Post from '@/app/(main)/boards/_components/Post';
55
import { useRouter } from 'next/navigation';
66

77
type AllPostListProps = {
@@ -10,7 +10,7 @@ type AllPostListProps = {
1010

1111
export default function PostList({ posts }: AllPostListProps) {
1212
const router = useRouter();
13-
// tanstack query
13+
1414
const handlePostClick = (postId: number) => {
1515
console.log('route to post page');
1616
router.push(`/boards/${postId}`);
@@ -23,7 +23,7 @@ export default function PostList({ posts }: AllPostListProps) {
2323
'https://sprint-fe-project.s3.ap-northeast-2.amazonaws.com',
2424
);
2525
return (
26-
<PostCard
26+
<Post
2727
key={post.id}
2828
title={post.title}
2929
imageUrl={isValidImage ? post.image : '/images/default_card.png'}

0 commit comments

Comments
 (0)