diff --git a/src/components/LoadingError/index.jsx b/src/components/LoadingError/index.jsx new file mode 100644 index 0000000..59fa755 --- /dev/null +++ b/src/components/LoadingError/index.jsx @@ -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 ( +
+ +

문제가 발생했습니다

+

{errorMessage}

+ +
+ ); +}; + +LoadingError.propTypes = { + errorMessage: PropTypes.string.isRequired, +}; + +export default LoadingError; diff --git a/src/components/LoadingError/styles.module.scss b/src/components/LoadingError/styles.module.scss new file mode 100644 index 0000000..ff5955e --- /dev/null +++ b/src/components/LoadingError/styles.module.scss @@ -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; + } +} diff --git a/src/pages/ListPage/MonthlyChart/index.jsx b/src/pages/ListPage/MonthlyChart/index.jsx index 20e4ffb..0320ed4 100644 --- a/src/pages/ListPage/MonthlyChart/index.jsx +++ b/src/pages/ListPage/MonthlyChart/index.jsx @@ -44,7 +44,7 @@ const MonthlyChart = () => { name: '추가 버튼 눌렀구나', totalVotes: 1000, profilePicture: - 'https://sprint-fe-project.s3.ap-northeast-2.amazonaws.com/Fandom-K/idol/1714613892649/ive1.jpeg', + 'https://sprint-fe-project.s3.ap-northeast-2.amazonaws.com/Fandom-K/idol/1714613892649/ive1.jpeg', }, ]; setIdolList(newArr); diff --git a/src/pages/TestPage/index.jsx b/src/pages/TestPage/index.jsx index 6dd79a8..7cc06bc 100644 --- a/src/pages/TestPage/index.jsx +++ b/src/pages/TestPage/index.jsx @@ -9,6 +9,7 @@ import Modal from '@/components/Modal'; import ModalHeader from '@/components/Modal/components/ModalHeader'; // import ModalMobileHeader from '@/components/Modal/components/ModalMobileHeader'; import Profile from '@/components/Profile'; +import LoadingError from '@/components/LoadingError'; const TestPage = () => { const [isOpen, openModal, closeModal] = useModal(); @@ -18,8 +19,7 @@ const TestPage = () => {
-
+ >
{ )}
+
+ + +
); };