-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 에러 바운더리 구현 * fix: 에러 페이지로 변경 * fix: 테스트 api 수정 * feat: 페이지 로딩 컴포넌트 구현 * feat: 로딩 컴포넌트 구현 * chore: 패키지 의존성 삭제 * feat: 파비콘 추가
- Loading branch information
Showing
14 changed files
with
197 additions
and
32 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
This file was deleted.
Oops, something went wrong.
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
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
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
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,54 @@ | ||
import { css } from '@emotion/react'; | ||
import { useLocation, useNavigate } from 'react-router-dom'; | ||
|
||
import { ErrorIcon } from '@/assets/icon'; | ||
import { COLORS, FONTS } from '@/styles/constants'; | ||
|
||
const Error = () => { | ||
const navigate = useNavigate(); | ||
const location = useLocation(); | ||
|
||
const message = location.state?.message || '알 수 없는 오류가 발생했습니다.'; | ||
|
||
return ( | ||
<div css={errorContainer}> | ||
<ErrorIcon /> | ||
<span css={errorDetail}>{message}</span> | ||
<button | ||
css={moveBtn} | ||
onClick={() => { | ||
navigate(-1); | ||
}}> | ||
이전 페이지로 | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Error; | ||
|
||
const errorContainer = css` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
height: 100dvh; | ||
`; | ||
|
||
const errorDetail = css` | ||
margin: 1.6rem 0 2.4rem; | ||
color: ${COLORS.gray9}; | ||
${FONTS.Body2}; | ||
`; | ||
|
||
const moveBtn = css` | ||
padding: 1rem 1.6rem; | ||
border-radius: 10px; | ||
background-color: ${COLORS.brand1}; | ||
color: ${COLORS.white}; | ||
${FONTS.Body3}; | ||
`; |
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,27 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
import { BlackSpinnerGIF } from '@/assets/image'; | ||
|
||
const Loading = () => { | ||
return ( | ||
<div css={dataContainer}> | ||
<img css={img} src={BlackSpinnerGIF} alt="spinner" /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Loading; | ||
|
||
const dataContainer = css` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
padding: 2rem; | ||
`; | ||
|
||
const img = css` | ||
width: 8rem; | ||
height: 8rem; | ||
`; |
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,55 @@ | ||
import { css } from '@emotion/react'; | ||
import { useEffect } from 'react'; | ||
|
||
import { WhiteSpinnerGIF } from '@/assets/image'; | ||
import { COLORS, FONTS } from '@/styles/constants'; | ||
|
||
const PageLoading = () => { | ||
useEffect(() => { | ||
// 스크롤 방지 | ||
document.body.style.overflow = 'hidden'; | ||
|
||
return () => { | ||
document.body.style.overflow = 'auto'; | ||
}; | ||
}, []); | ||
return ( | ||
<div css={dataContainer}> | ||
<img css={img} src={WhiteSpinnerGIF} alt="spinner" /> | ||
<p css={text}>여행지를 찾고 있어요!</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PageLoading; | ||
|
||
const dataContainer = css` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
position: absolute; | ||
top: 0; | ||
z-index: 999; | ||
width: 100dvw; | ||
width: 100%; | ||
height: 100dvh; | ||
height: 100%; | ||
background-color: rgb(82 82 82 / 72%); | ||
`; | ||
|
||
const img = css` | ||
width: 16rem; | ||
height: 16rem; | ||
`; | ||
|
||
const text = css` | ||
padding-top: 2rem; | ||
margin-left: 2rem; | ||
color: ${COLORS.white}; | ||
${FONTS.H5}; | ||
`; |
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