From 8f54222da5b9079f81bcbaa32ee16e3e8601aacd Mon Sep 17 00:00:00 2001 From: Hyoeunkh Date: Fri, 5 Jul 2024 00:25:55 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20MyAccount=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20=EB=B0=8F=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=ED=96=88=EC=9D=84=20=EA=B2=BD=EC=9A=B0=EC=97=90=EB=A7=8C=20?= =?UTF-8?q?=EC=A0=91=EA=B7=BC=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MyAccountPage.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/pages/MyAccountPage.tsx b/src/pages/MyAccountPage.tsx index 6257577a8..5bf184bd6 100644 --- a/src/pages/MyAccountPage.tsx +++ b/src/pages/MyAccountPage.tsx @@ -1,18 +1,31 @@ /* @jsxImportSource @emotion/react */ import { css } from '@emotion/react'; import styled from '@emotion/styled'; +import { Navigate, useNavigate } from 'react-router-dom'; import { Button } from '@/components/common/Button'; import { Container } from '@/components/common/Layout/Container'; +import { useAuth } from '@/hooks/useAuth'; export default function MyAccountPage() { + const { authToken, setAuthToken } = useAuth(); + const navigate = useNavigate(); + if (!authToken) { + return ; + } + const HandleLogout = () => { + sessionStorage.clear(); + setAuthToken(null); + navigate('/', { replace: true }); + }; return ( - userID님 안녕하세요! + {authToken.id}님 안녕하세요!