From ffd18dcdf48b23803a9f75dc6f087cf21407f547 Mon Sep 17 00:00:00 2001 From: kiyeong Date: Wed, 20 Nov 2024 10:14:13 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=B0=B0=ED=8F=AC=20=EC=82=AC=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20404=20error=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/LoginPage/LoginPage.tsx | 6 +++++- src/pages/MainPage/Sidebar/Sidebar.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index d33e8a3..2f25e3e 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -22,6 +22,10 @@ const LoginPage: React.FC = () => { navigate(-1); // 이전 페이지로 이동 }; + const handleSignup = () => { + navigate("/signup"); // 페이지를 이동 + }; + return ( {/* 상단 왼쪽에 이전 페이지 버튼 */} @@ -73,7 +77,7 @@ const LoginPage: React.FC = () => { {/* 회원가입 링크 */} 아직 회원이 아니신가요?{" "} - + 회원가입 diff --git a/src/pages/MainPage/Sidebar/Sidebar.tsx b/src/pages/MainPage/Sidebar/Sidebar.tsx index e904ccd..3f5c393 100644 --- a/src/pages/MainPage/Sidebar/Sidebar.tsx +++ b/src/pages/MainPage/Sidebar/Sidebar.tsx @@ -6,6 +6,7 @@ import { CloseIcon, } from "@chakra-ui/icons"; import React, { useEffect, useState } from "react"; +import { useNavigate } from "react-router-dom"; import knuLogo from "@/assets/knuLogo.svg"; interface SidebarProps { @@ -15,6 +16,7 @@ interface SidebarProps { export const Sidebar: React.FC = ({ isOpen, toggleSidebar }) => { const [showTooltip, setShowTooltip] = useState(false); + const navigate = useNavigate(); useEffect(() => { const tooltipDismissed = localStorage.getItem("tooltipDismissed"); @@ -36,7 +38,7 @@ export const Sidebar: React.FC = ({ isOpen, toggleSidebar }) => { }, [isOpen]); const handleLogin = () => { - window.location.href = "/login"; + navigate("/login"); // 페이지를 이동 }; const handleTooltipClose = () => { @@ -124,7 +126,7 @@ export const Sidebar: React.FC = ({ isOpen, toggleSidebar }) => { variant="unstyled" background={"#B8433A"} width="300px" - height="50px" + height="45px" fontSize={30} fontWeight={300} onClick={handleLogin}