Skip to content

Commit

Permalink
fix: #183 404페이지 이전으로 버튼에 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Oh5Yeonju committed Oct 12, 2023
1 parent c429e29 commit fa93528
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/pages/NotFound/NotFound.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import React from 'react';
import SVG from '../../assets/images/404 page.svg';
import NotFoundImage from '../../assets/images/404 page.svg';
import { Image, NotFoundText, NotFoundBtn } from './NotFoundStyle';
import Layout from "../../styles/Layout";
import {useNavigate} from "react-router-dom";
import styled from "styled-components";

export default function NotFound() {
return (
<Layout align="center">
<Image src={SVG} alt="404" />
<NotFoundText>페이지를 찾을 수 없음</NotFoundText>
<NotFoundBtn>이전페이지</NotFoundBtn>
</Layout>
);
const navigate = useNavigate();
const handleBack = () => {
navigate(-1);
}

return (
<Layout align="center">
<Image src={NotFoundImage} alt="404페이지 로고" />
<NotFoundText>페이지를 찾을 수 없음</NotFoundText>
<NotFoundBtn onClick={handleBack}>이전페이지</NotFoundBtn>
</Layout>
);
}

0 comments on commit fa93528

Please sign in to comment.