Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"date-fns": "^4.1.0",
"dayjs": "^1.11.13",
"framer-motion": "^12.5.0",
"lottie-react": "^2.4.1",
"next": "14.2.6",
"nookies": "^2.5.2",
"qrcode.react": "^4.2.0",
Expand Down
1 change: 1 addition & 0 deletions public/animations/carrot.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions public/svgs/error/404.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/svgs/error/500.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/svgs/error/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
'use client';

import Image from 'next/image';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import Lottie from 'lottie-react';
import CarrotAnimation from '../../public/animations/carrot.json';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

경로가 public이라 /animations 로 바로 들어가도 될 것 같습니다!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

처음에 절대경로로 해봤는데 import 가 안 되더라고요... 그래서 불가피하게 상대경로로 넣어두었습니다.

절대 경로 유지하려면, src 안에 assets 폴더 따로 만들어서 넣으면 될거같은데 새로 커밋 올려둘게여!

import {
Body1Black,
SubTitle1Black,
Subtitle1White,
} from '@/components/common/Typography';

/**
* @description 500 에러 페이지
*/
const Error = () => {
const router = useRouter();

return (
<div className='relative flex h-screen flex-col items-center justify-center'>
<header className='absolute top-0 h-20 w-full border-b border-b-grey-100 bg-white-100 px-6 py-4'>
<Link href={'/'}>
<Image
src={'/imgs/header-logo.png'}
width={66}
height={48}
alt='header logo'
/>
</Link>
</header>
<div className='flex h-screen w-full items-center justify-center gap-[180px] bg-grey-50'>
<div className='mb-20 flex h-[480px] w-[480px] items-center'>
<Lottie animationData={CarrotAnimation} loop autoplay />
</div>
<div className='flex flex-col justify-between gap-14'>
<Image
src={'/svgs/error/500.svg'}
width={640}
height={88}
alt='404 error typo'
/>

<p>
<Body1Black>서버에 문제가 발생했습니다.</Body1Black>
<br />
<Body1Black>잠시 후 다시 시도해 주세요.</Body1Black>
<br />
</p>

<div className='flex gap-8'>
<Link href={'/'}>
<button className='h-16 rounded-lg bg-green-500 px-6 hover:bg-green-600 active:bg-green-700'>
<Subtitle1White>홈으로</Subtitle1White>
</button>
</Link>
<button
className='flex h-16 items-center gap-2 rounded-lg px-4 hover:bg-grey-100'
onClick={() => router.back()}
>
<Image
src={'/svgs/error/arrow-left.svg'}
width={24}
height={24}
alt='arrow-left'
/>
<SubTitle1Black>뒤로 가기</SubTitle1Black>
</button>
</div>
</div>
</div>
</div>
);
};

export default Error;
80 changes: 80 additions & 0 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
'use client';

import Image from 'next/image';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import Lottie from 'lottie-react';
import CarrotAnimation from '../../public/animations/carrot.json';
import {
Body1Black,
SubTitle1Black,
Subtitle1White,
} from '@/components/common/Typography';

/**
* @description 404 에러 페이지
*/
const NotFound = () => {
const router = useRouter();

return (
<div className='relative flex h-screen flex-col items-center justify-center'>
<header className='absolute top-0 h-20 w-full border-b border-b-grey-100 bg-white-100 px-6 py-4'>
<Link href={'/'}>
<Image
src={'/imgs/header-logo.png'}
width={66}
height={48}
alt='header logo'
/>
</Link>
</header>
<div className='flex h-screen w-full items-center justify-center gap-[180px] bg-grey-50'>
<div className='mb-20 flex h-[480px] w-[480px] items-center'>
<Lottie animationData={CarrotAnimation} loop autoplay />
</div>
<div className='flex flex-col justify-between gap-14'>
<Image
src={'/svgs/error/404.svg'}
width={640}
height={88}
alt='404 error typo'
/>

<p>
<Body1Black>요청하신 페이지를 찾을 수 없습니다.</Body1Black>
<br />
<br />
<Body1Black>주소가 정확한지 다시 확인해 주세요.</Body1Black>
<br />
<Body1Black>
입력한 URL이 잘못되었거나, 페이지가 이동되었을 수 있습니다.
</Body1Black>
</p>

<div className='flex gap-8'>
<Link href={'/'}>
<button className='h-16 rounded-lg bg-green-500 px-6 hover:bg-green-600 active:bg-green-700'>
<Subtitle1White>홈으로</Subtitle1White>
</button>
</Link>
<button
className='flex h-16 items-center gap-2 rounded-lg px-4 hover:bg-grey-100'
onClick={() => router.back()}
>
<Image
src={'/svgs/error/arrow-left.svg'}
width={24}
height={24}
alt='arrow-left'
/>
<SubTitle1Black>뒤로 가기</SubTitle1Black>
</button>
</div>
</div>
</div>
</div>
);
};

export default NotFound;