Skip to content

Commit

Permalink
fix: 배포 사이트 404 error 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
gogumalatte committed Nov 20, 2024
1 parent e177d3d commit ffd18dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/pages/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const LoginPage: React.FC = () => {
navigate(-1); // 이전 페이지로 이동
};

const handleSignup = () => {
navigate("/signup"); // 페이지를 이동
};

return (
<Box alignContent={"center"} bg="#f3f2ec" height={"100vh"}>
{/* 상단 왼쪽에 이전 페이지 버튼 */}
Expand Down Expand Up @@ -73,7 +77,7 @@ const LoginPage: React.FC = () => {
{/* 회원가입 링크 */}
<Text fontSize="lg" color="gray.600">
아직 회원이 아니신가요?{" "}
<Link color="#8B8469" href="/signup">
<Link color="#8B8469" onClick={handleSignup}>
회원가입
</Link>
</Text>
Expand Down
6 changes: 4 additions & 2 deletions src/pages/MainPage/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -15,6 +16,7 @@ interface SidebarProps {

export const Sidebar: React.FC<SidebarProps> = ({ isOpen, toggleSidebar }) => {
const [showTooltip, setShowTooltip] = useState(false);
const navigate = useNavigate();

useEffect(() => {
const tooltipDismissed = localStorage.getItem("tooltipDismissed");
Expand All @@ -36,7 +38,7 @@ export const Sidebar: React.FC<SidebarProps> = ({ isOpen, toggleSidebar }) => {
}, [isOpen]);

const handleLogin = () => {
window.location.href = "/login";
navigate("/login"); // 페이지를 이동
};

const handleTooltipClose = () => {
Expand Down Expand Up @@ -124,7 +126,7 @@ export const Sidebar: React.FC<SidebarProps> = ({ isOpen, toggleSidebar }) => {
variant="unstyled"
background={"#B8433A"}
width="300px"
height="50px"
height="45px"
fontSize={30}
fontWeight={300}
onClick={handleLogin}
Expand Down

0 comments on commit ffd18dc

Please sign in to comment.