Skip to content

Commit

Permalink
NOT FOUND 페이지 구현 (#639)
Browse files Browse the repository at this point in the history
* assets: not found 이미지 추가

* feat: not found 페이지 구현
  • Loading branch information
guridaek authored Oct 10, 2023
1 parent af8d9a9 commit 026c687
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
Binary file added frontend/src/assets/not-found.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions frontend/src/pages/NotFoundPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import Button from '@/components/common/Button/Button';
import { usePageRouter } from '@/hooks/usePageRouter';
import React from 'react';
import styled from 'styled-components';
import notFound from '@/assets/not-found.jpg';

const NotFoundPage = () => {
const { goToMainPage } = usePageRouter();

return (
<S.NotFoundPageContainer>
<S.NotFoundImage src={notFound} />
<S.Message>
<S.Bold>페이지를 찾을 수 없습니다 😢</S.Bold>
</S.Message>
<Button colorTheme="WHITE" onClick={goToMainPage}>
홈으로 가기
</Button>
</S.NotFoundPageContainer>
);
};

export default NotFoundPage;

const S = {
NotFoundPageContainer: styled.div`
display: flex;
flex-direction: column;
align-items: center;
gap: 50px;
margin-top: 10vh;
`,

NotFoundImage: styled.img`
height: 40vh;
`,

Message: styled.h1`
font-size: 30px;
line-height: 1.5;
white-space: pre-wrap;
text-align: center;
@media (max-width: 768px) {
font-size: 24px;
}
`,

Bold: styled.span`
font-weight: 700;
`,
};
2 changes: 2 additions & 0 deletions frontend/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import App from './App';
import { createBrowserRouter } from 'react-router-dom';
import MainPage from './pages/MainPage';
import NotFoundPage from './pages/NotFoundPage';
const RunnerPostPage = React.lazy(() => import('./pages/RunnerPostDetailPage'));
const RunnerPostCreatePage = React.lazy(() => import('./pages/RunnerPostCreatePage'));
const LoginPage = React.lazy(() => import('./pages/LoginPage'));
Expand Down Expand Up @@ -89,6 +90,7 @@ export const router = createBrowserRouter(
element: <NoticePage />,
},
{ path: ROUTER_PATH.RESULT, element: <ResultPage /> },
{ path: ROUTER_PATH.NOT_FOUND, element: <NotFoundPage /> },
],
},
],
Expand Down
1 change: 1 addition & 0 deletions frontend/src/types/image.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
declare module '*.svg';
declare module '*.png';
declare module '*.webp';
declare module '*.jpg';

0 comments on commit 026c687

Please sign in to comment.