Skip to content

Commit

Permalink
feat: 잘못된 URL 접근시 NotFoundPage 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
osdoonhyun committed Nov 8, 2023
1 parent 635f0fe commit 52f7a9a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
Binary file added selq-client/src/assets/image/sel-q-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions selq-client/src/pages/NotFoundPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import Logo from '../assets/image/sel-q-logo.png';
import { Image } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import Header from '../components/common/Header';
import { MAIN } from '../styles/variables';

export default function NotFoundPage() {
return (
<>
<Header />
<div
style={{
width: '100%',
padding: '10px',
minHeight: 'calc(100vh - 150px)',
maxWidth: '1080px',
margin: '0 auto',
}}
>
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
marginTop: '150px',
}}
>
<Image
src={Logo}
alt={'selQ-Logo'}
style={{ width: '100px', height: '100px' }}
/>
<h2 className='mt-3'>해당 페이지를 찾지 못했습니다.</h2>
<div>
<Link
style={{
textDecoration: 'none',
fontSize: '1.5rem',
color: MAIN.MEDIUM,
}}
to='/'
>
홈으로 이동하기
</Link>
</div>
</div>
</div>
</>
);
}
2 changes: 2 additions & 0 deletions selq-client/src/routes/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ import EditQuestion from '../pages/EditQuestion';
import BookmarkedQuestions from '../pages/BookmarkedQuestions';
import QuestionManagement from '../pages/QuestionManagement';
import SocialSignUp from '../components/common/SocialSignUp';
import NotFoundPage from '../pages/NotFoundPage';

export const router = createBrowserRouter([
{
path: '/',
element: <Root />,
errorElement: <NotFoundPage />,
children: [
{ index: true, element: <Home /> },
{ path: '/questions', element: <CategoryQuestions /> },
Expand Down

0 comments on commit 52f7a9a

Please sign in to comment.