-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from falconlee236/dev/fail-view
[DEV] fail view 구현
- Loading branch information
Showing
6 changed files
with
105 additions
and
11 deletions.
There are no files selected for viewing
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 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,5 @@ | ||
export const LOGIN_ERROR_MSG: string = '로그인에 실패했습니다.'; | ||
export const LOGIN_ERROR_CHECK_MSG: string = | ||
'아이디와 비밀번호를 다시 확인해주세요'; | ||
export const GENERATION_ERROR_MSG: string = '프로필을 생성하는 실패했습니다.'; | ||
export const GENERATION_ERROR_CHECK_MSG: string = '이미지를 다시 확인해주세요'; |
This file contains 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,49 @@ | ||
'use client'; | ||
|
||
import { useAtom } from 'jotai'; | ||
import Image from 'next/image'; | ||
import { useEffect } from 'react'; | ||
import { GENERATION_ERROR_MSG } from '@/app/constants/errorMessages'; | ||
import PreviousPage from '@/components/PreviousPage'; | ||
import { | ||
errorCheckMessageAtom, | ||
errorMessageAtom, | ||
} from '@/store/atoms/errorMessageAtom'; | ||
|
||
export default function ErrorPage() { | ||
const [errorMessage, setErrorMessage] = useAtom(errorMessageAtom); | ||
const [errorCheckMessage, setErrorCheckMessage] = useAtom( | ||
errorCheckMessageAtom, | ||
); | ||
|
||
useEffect(() => { | ||
return () => { | ||
setErrorMessage(''); | ||
setErrorCheckMessage(''); | ||
}; | ||
}, [setErrorMessage, setErrorCheckMessage]); | ||
|
||
return ( | ||
<div className="flex h-640 w-360 flex-col justify-start"> | ||
<div className="ml-4 mt-7"> | ||
<PreviousPage | ||
target={errorMessage === GENERATION_ERROR_MSG ? '/guide' : '/login'} | ||
/> | ||
</div> | ||
<div className="mt-12 flex flex-col items-center justify-center"> | ||
<span className="text-4xl">Error</span> | ||
<span className="mt-6 font-sfpro">{errorMessage}</span> | ||
<span className="bg-primary-darkblue px-3 font-sfpro font-bold text-white"> | ||
{errorCheckMessage} | ||
</span> | ||
<Image | ||
src="/error-puang.png" | ||
alt="error puang image" | ||
width="250" | ||
height="250" | ||
className="mt-16" | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains 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
This file contains 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
This file contains 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,4 @@ | ||
import { atom } from 'jotai'; | ||
|
||
export const errorMessageAtom = atom<string>(''); | ||
export const errorCheckMessageAtom = atom<string>(''); |