-
Notifications
You must be signed in to change notification settings - Fork 2
Feat[THKV-157] : 400, 500 에러 페이지 구현 #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d72022
feat: lottie react 설치
grapefruit13 3fb5af2
feat: 당근 흔드는 애니메이션 json 파일 추가
grapefruit13 d1015f5
feat: svg 추가
grapefruit13 a2916df
feat: 404 에러 페이지 구현
grapefruit13 b336a2e
feat: 500 메시지 svg 추사
grapefruit13 8b1e639
feat: 500 에러페이지 구현
grapefruit13 25f8145
feat: animation file src/assets 하위로 이동
grapefruit13 79194b2
fix: 애니메이션 파일 경로 이동에 따른 import문 수정
grapefruit13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'; | ||
| 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; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'; | ||
grapefruit13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
경로가 public이라 /animations 로 바로 들어가도 될 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
처음에 절대경로로 해봤는데 import 가 안 되더라고요... 그래서 불가피하게 상대경로로 넣어두었습니다.
절대 경로 유지하려면, src 안에 assets 폴더 따로 만들어서 넣으면 될거같은데 새로 커밋 올려둘게여!