From f93329f0f2d01024bb955148c09174f2f820095d Mon Sep 17 00:00:00 2001 From: sryung Date: Tue, 9 Apr 2024 03:49:19 +0900 Subject: [PATCH] =?UTF-8?q?[=E2=9C=85=20test]=20=EB=B0=B0=ED=8F=AC=20?= =?UTF-8?q?=ED=99=98=EA=B2=BD=EC=97=90=EC=84=9C=20=EB=B0=9C=EC=83=9D?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=ED=8C=A8?= =?UTF-8?q?=EC=B9=98=20=EC=8B=A4=ED=8C=A8=20=EC=97=90=EB=9F=AC=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0=EC=9D=84=20=EC=9C=84=ED=95=9C=20=ED=98=84=EC=9E=AC=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4=EB=8F=99=20=EB=B0=A9?= =?UTF-8?q?=EC=96=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Footer.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/common/Footer.tsx b/src/components/common/Footer.tsx index c9a5cc45..d5e3504e 100644 --- a/src/components/common/Footer.tsx +++ b/src/components/common/Footer.tsx @@ -1,6 +1,5 @@ import styled from '@emotion/styled'; import Image from 'next/image'; -import Link from 'next/link'; import { useRouter } from 'next/router'; import { homeNormal, @@ -15,9 +14,19 @@ import screenSize from '@/constants/screenSize'; export default function Footer() { const router = useRouter(); + const navigate = ( + e: React.MouseEvent, + path: string, + ) => { + e.preventDefault(); + if (router.pathname !== path) { + router.push(path).catch((error) => console.error('이동 실패', error)); + } + }; + return ( - + navigate(e, '/home')}>

- + navigate(e, '/mychallenge')}> 마이챌린지

- + navigate(e, '/profile')}>