From 939dc222d4bd51437515b48dddc00b5962d201e3 Mon Sep 17 00:00:00 2001 From: 03hoho03 Date: Mon, 8 Apr 2024 20:26:34 +0900 Subject: [PATCH 1/7] =?UTF-8?q?[#52]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/_common/nav/index.tsx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/_common/nav/index.tsx b/app/_common/nav/index.tsx index db33b46..3c32ec1 100644 --- a/app/_common/nav/index.tsx +++ b/app/_common/nav/index.tsx @@ -1,15 +1,38 @@ +'use client' + import Image from 'next/image' import Link from 'next/link' import logo from '../../_assets/_images/logo.png' import S from './nav.module.css' +import { useRouter } from 'next/navigation' //TODO: 사용자 프로필 이미지 가져오기 function Nav() { + const router = useRouter() + const accessToken = localStorage.getItem('accessToken') + + const handleLogout = () => { + localStorage.removeItem('accessToken') + location.reload() + } + const handleLogin = () => { + router.push('/signin') + } + return (
로고 + {accessToken ? ( + + ) : ( + + )}
From eb9b54cb5020f350c9db992cef46b53e7b556036 Mon Sep 17 00:00:00 2001 From: 03hoho03 Date: Mon, 8 Apr 2024 20:29:15 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[#52]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/_common/nav/index.tsx | 15 ++------------- app/_common/nav/nav.module.css | 8 +++++++- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/app/_common/nav/index.tsx b/app/_common/nav/index.tsx index 3c32ec1..02ab272 100644 --- a/app/_common/nav/index.tsx +++ b/app/_common/nav/index.tsx @@ -25,25 +25,14 @@ function Nav() { 로고 {accessToken ? ( - ) : ( - )} - - -
- {/* 사용자 프로필 */} -
-
) } diff --git a/app/_common/nav/nav.module.css b/app/_common/nav/nav.module.css index b529fe4..1661d11 100644 --- a/app/_common/nav/nav.module.css +++ b/app/_common/nav/nav.module.css @@ -6,7 +6,13 @@ width: 100%; padding: 18px 0px; } - +.btn { + background-color: rgb(106, 106, 255); + color: #ffffff; + font-size: 12px; + border-radius: 8px; + padding:4px 8px; +} .userProfileWrapper { display: flex; justify-content: center; From 5e715fd6b1cbe6b28e559a927538c5272c7bfad9 Mon Sep 17 00:00:00 2001 From: 03hoho03 Date: Mon, 8 Apr 2024 20:44:30 +0900 Subject: [PATCH 3/7] !!fix --- app/_common/nav/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/_common/nav/index.tsx b/app/_common/nav/index.tsx index 02ab272..8aa8b5c 100644 --- a/app/_common/nav/index.tsx +++ b/app/_common/nav/index.tsx @@ -9,7 +9,7 @@ import { useRouter } from 'next/navigation' //TODO: 사용자 프로필 이미지 가져오기 function Nav() { const router = useRouter() - const accessToken = localStorage.getItem('accessToken') + const accessToken = localStorage?.getItem('accessToken') const handleLogout = () => { localStorage.removeItem('accessToken') From ea3ad8bdc03048205351245a791b2f43fc2d49ad Mon Sep 17 00:00:00 2001 From: 03hoho03 Date: Mon, 8 Apr 2024 20:50:36 +0900 Subject: [PATCH 4/7] =?UTF-8?q?!!fix=20suspense=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(route)/main/page.tsx | 99 +++++++------- app/(route)/mypage/page.tsx | 5 +- app/(route)/toolDetail/[toolId]/page.tsx | 157 ++++++++++++----------- 3 files changed, 133 insertions(+), 128 deletions(-) diff --git a/app/(route)/main/page.tsx b/app/(route)/main/page.tsx index 6c4b5ae..bb82b77 100644 --- a/app/(route)/main/page.tsx +++ b/app/(route)/main/page.tsx @@ -12,6 +12,7 @@ import Title from '../../_common/text/title' import Search from '../../_components/search' import { Root, Tool } from '../../_constants/toolcard' import S from './page.module.css' +import { Suspense } from 'react' //TODO: 주석처리 사항들에 데이터 가져오기 function Main() { @@ -27,58 +28,60 @@ function Main() { const resData = data?.data.data.tool return ( -
-