diff --git a/src/pages/main/containers/LostArticleSection.tsx b/src/pages/main/containers/LostArticleSection.tsx index d38125fc..b4490af2 100644 --- a/src/pages/main/containers/LostArticleSection.tsx +++ b/src/pages/main/containers/LostArticleSection.tsx @@ -18,6 +18,30 @@ const LostArticleSection = () => { const navigate = useNavigate(); + // PostCard 컴포넌트화 + const PostCardWrapper = ({ + postId, + title, + subtitle, + imgUrl, + date, + }: { + postId: number; + title: string; + subtitle: string; + imgUrl: string; + date: string; + }) => ( + navigate(`/lost-article/${postId}`, { state: { postId } })} + /> + ); + return (
@@ -33,59 +57,56 @@ const LostArticleSection = () => { />
+ {/* xs */} - {width < 390 ? ( + {width < 390 && (
{data?.data.postListResDto.map((item) => ( - navigate(`/lost-article/${item.postId}`, { state: { postId: item.postId } })} - > + date={item.date} + /> ))}
- ) : null} + )} + {/* sm, md */} - {width < 1080 && width >= 390 ? ( + {width >= 390 && width < 1080 && (
{data?.data.postListResDto.map((item) => ( - navigate(`/lost-article/${item.postId}`, { state: { postId: item.postId } })} - > + date={item.date} + /> ))}
- ) : null} + )} + {/* xxl, xl, lg */} - {width >= 1080 ? ( + {width >= 1080 && (
{data?.data.postListResDto.map((item) => ( - navigate(`/lost-article/${item.postId}`, { state: { postId: item.postId } })} - > + date={item.date} + /> ))}
- ) : null} + )}
); - // function EmptyPost() { - // return ( - //

등록된 게시물이 없습니다.

- // ); - // } }; export default LostArticleSection;