forked from sprint6-part2/fandom-k
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Feat: 로딩에러 컴포넌트 구현 (sprint6-part2#48)
* ✨ Feat: 로딩 에러 컴포넌트 UI 구현 * ✨ Feat: 버튼 클릭 시 새로고침 * ✨ Feat: 로딩에러 컴포넌트에 로고 추가
- Loading branch information
1 parent
e814f93
commit 2093ece
Showing
4 changed files
with
62 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import CustomButton from '../CustomButton'; | ||
import Logo from '@/assets/icons/Logo'; | ||
import PropTypes from 'prop-types'; | ||
import style from './styles.module.scss'; | ||
|
||
/** | ||
* @param {string} errorMessage 에러메시지 문구 | ||
*/ | ||
const LoadingError = ({ errorMessage }) => { | ||
const handleRefresh = () => { | ||
window.location.reload(); | ||
}; | ||
|
||
return ( | ||
<div className={style.error}> | ||
<Logo /> | ||
<h3>문제가 발생했습니다</h3> | ||
<p>{errorMessage}</p> | ||
<CustomButton rounded btnText="페이지 새로고침" onClick={handleRefresh} /> | ||
</div> | ||
); | ||
}; | ||
|
||
LoadingError.propTypes = { | ||
errorMessage: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default LoadingError; |
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,24 @@ | ||
@import '../../styles/'; | ||
|
||
.error { | ||
text-align: center; | ||
|
||
margin: 0 auto; | ||
padding-block: 10px; | ||
|
||
white-space: pre-wrap; | ||
|
||
h3 { | ||
margin-top: 45px; | ||
@include font-base($color-brand-orange, 600, 18px, 26px); | ||
} | ||
|
||
p { | ||
margin-bottom: 15px; | ||
@include font-base($color-white, 600, 14px, 26px); | ||
} | ||
|
||
button { | ||
width: 120px; | ||
} | ||
} |
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