From 4eb903017c8b46a62e4cbcb6ed5af3ccbda545ef Mon Sep 17 00:00:00 2001 From: ssu-it-support Date: Thu, 10 Oct 2024 00:23:44 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EB=A9=94=EC=9D=B8=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EB=B6=84=EC=8B=A4=EB=AC=BC=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=ED=8C=90=20=EC=8D=B8=EB=84=A4=EC=9D=BC=20=EC=A7=80?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/containers/LostArticleSection.tsx | 69 ++++++++++++------- 1 file changed, 45 insertions(+), 24 deletions(-) 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; From dd674154d248c559cab48d4d5552a2ee4a6f86fa Mon Sep 17 00:00:00 2001 From: ssu-it-support Date: Thu, 10 Oct 2024 00:25:44 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20footer=20=EC=A0=84=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/main/layout/headerLayout.tsx | 36 -------------------------- src/pages/main/page.tsx | 1 - src/pages/router.tsx | 4 +-- 3 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 src/pages/main/layout/headerLayout.tsx diff --git a/src/pages/main/layout/headerLayout.tsx b/src/pages/main/layout/headerLayout.tsx deleted file mode 100644 index aed11713..00000000 --- a/src/pages/main/layout/headerLayout.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { useEffect } from 'react'; -import { Outlet, useNavigate } from 'react-router-dom'; -import { Header } from '@/containers/common/Header/Header'; -import { State } from '@/containers/common/Header/const/state'; -import { useRecoilValue, useSetRecoilState } from 'recoil'; -import { LoginState } from '@/recoil/atoms/atom'; - -export function HeaderLayout() { - const loginState = useRecoilValue(LoginState); - const setLoginState = useSetRecoilState(LoginState); - const navigate = useNavigate(); - - useEffect(() => { - const token = localStorage.getItem('accessToken'); - if (token) { - setLoginState(true); - } else { - setLoginState(false); - } - }, [setLoginState]); - - const handleLogout = () => { - localStorage.clear(); - setLoginState(false); - navigate('/'); - }; - - return ( - <> -
-
- -
- - ); -} diff --git a/src/pages/main/page.tsx b/src/pages/main/page.tsx index e22a9507..8222cc39 100644 --- a/src/pages/main/page.tsx +++ b/src/pages/main/page.tsx @@ -27,7 +27,6 @@ export function MainPage() { -