diff --git a/app/frontend/src/hooks/useRouter.tsx b/app/frontend/src/hooks/useRouter.tsx index 669379a45..75f2a8cba 100644 --- a/app/frontend/src/hooks/useRouter.tsx +++ b/app/frontend/src/hooks/useRouter.tsx @@ -10,6 +10,7 @@ import { MapLayout, Groups, ProfilePage, + NotFound, } from '@/pages'; export const useRouter = () => @@ -17,6 +18,7 @@ export const useRouter = () => { path: '/', element: , + errorElement: , children: [{ index: true, element: }], }, { diff --git a/app/frontend/src/pages/NotFound/index.css.ts b/app/frontend/src/pages/NotFound/index.css.ts new file mode 100644 index 000000000..5fab7f4a8 --- /dev/null +++ b/app/frontend/src/pages/NotFound/index.css.ts @@ -0,0 +1,31 @@ +import { style } from '@vanilla-extract/css'; + +import { vars } from '@/styles'; +import { sansBold16, sansRegular16 } from '@/styles/font.css'; + +const { morakGreen } = vars.color; + +export const button = style([ + sansBold16, + { + textDecorationLine: 'underline', + color: morakGreen, + cursor: 'pointer', + }, +]); + +export const container = style({ + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + height: '100vh', +}); + +export const text = style([ + sansRegular16, + { + textAlign: 'center', + whiteSpace: 'break-spaces', + lineHeight: '2rem', + }, +]); diff --git a/app/frontend/src/pages/NotFound/index.tsx b/app/frontend/src/pages/NotFound/index.tsx new file mode 100644 index 000000000..b78d77c07 --- /dev/null +++ b/app/frontend/src/pages/NotFound/index.tsx @@ -0,0 +1,25 @@ +import { useNavigate } from 'react-router-dom'; + +import { MessageWrapper } from '@/components'; + +import * as styles from './index.css'; + +export function NotFound() { + const navigate = useNavigate(); + + const onClickMain = () => { + navigate('/'); + }; + return ( +
+ +

+ {`페이지를 찾을 수 없습니다.\n`} + +

+
+
+ ); +} diff --git a/app/frontend/src/pages/index.ts b/app/frontend/src/pages/index.ts index d816d16a7..be3bc46ce 100644 --- a/app/frontend/src/pages/index.ts +++ b/app/frontend/src/pages/index.ts @@ -5,4 +5,5 @@ export * from './Map'; export * from './Mogaco'; export * from './MogacoDetail'; export * from './MogacoPost'; +export * from './NotFound'; export * from './Profile';