File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed
panda-market/src/app/(main)/boards/_components Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 22
33import 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 }
Original file line number Diff line number Diff line change 11'use client' ;
22
3- import BestPostCard from '@/app/(main)/boards/_components/BestPostCard ' ;
3+ import BestPost from '@/app/(main)/boards/_components/BestPost ' ;
44import { ArticleResponse } from '@/lib/types/article' ;
55import { 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' }
Original file line number Diff line number Diff line change 22
33import 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 }
Original file line number Diff line number Diff line change 11'use client' ;
22
33import { ArticleResponse } from '@/lib/types/article' ;
4- import PostCard from './PostCard ' ;
4+ import Post from '@/app/(main)/boards/_components/Post ' ;
55import { useRouter } from 'next/navigation' ;
66
77type AllPostListProps = {
@@ -10,7 +10,7 @@ type AllPostListProps = {
1010
1111export 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' }
You can’t perform that action at this time.
0 commit comments