From daaa206e7b760d993bf68e06ce1c69cbca01d864 Mon Sep 17 00:00:00 2001 From: chaaerim Date: Sun, 25 Feb 2024 00:44:34 +0900 Subject: [PATCH] =?UTF-8?q?=20:sparkles:=20feat:=20window=20history=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20back=20button=20click?= =?UTF-8?q?=EC=8B=9C=20home=EC=9C=BC=EB=A1=9C=20routing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/components/BackHeader/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/components/BackHeader/index.tsx b/src/common/components/BackHeader/index.tsx index b7a7827b..efff5d9c 100644 --- a/src/common/components/BackHeader/index.tsx +++ b/src/common/components/BackHeader/index.tsx @@ -6,14 +6,20 @@ import { ICON_URL, SSRSuspense } from '@/common'; export const BackHeader = () => { const router = useRouter(); - + const onClick = () => { + if (typeof window !== 'undefined' && window.history.length > 1) { + router.back(); + } else { + router.push('/'); + } + }; return ( 로딩중입니다..} >