-
Notifications
You must be signed in to change notification settings - Fork 3
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 #208 from Team-Lecue/HOTFIX/eunbean
feat: 에러바운더리 컴포넌트 갈아끼우기
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 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
28 changes: 28 additions & 0 deletions
28
src/components/common/BoundaryErrorPage/BoundaryErrorPage.style.ts
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,28 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const ErrorPageWrapper = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
width: 100vw; | ||
height: 100dvh; | ||
`; | ||
|
||
export const ErrorPageMessage = styled.p` | ||
margin-top: 2.4rem; | ||
color: ${({ theme }) => theme.colors.BG}; | ||
${({ theme }) => theme.fonts.Title2_M_16}; | ||
`; | ||
|
||
export const HomeButton = styled.button` | ||
padding: 1.4rem 3.2rem; | ||
margin-top: 3rem; | ||
border-radius: 0.4rem; | ||
background-color: ${({ theme }) => theme.colors.BG}; | ||
color: ${({ theme }) => theme.colors.white}; | ||
${({ theme }) => theme.fonts.Title1_SB_16}; | ||
`; |
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,28 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { ImgError } from '../../../assets'; | ||
import * as S from './BoundaryErrorPage.style'; | ||
|
||
interface BoundaryErrorPageProps { | ||
resetErrorBoundary: (...args: any[]) => void; | ||
} | ||
|
||
function BoundaryErrorPage({ resetErrorBoundary }: BoundaryErrorPageProps) { | ||
const navigate = useNavigate(); | ||
|
||
const handleClickHomeButton = () => { | ||
resetErrorBoundary(); | ||
navigate('/', { state: { step: 1 } }); | ||
}; | ||
|
||
return ( | ||
<S.ErrorPageWrapper> | ||
<ImgError /> | ||
<S.ErrorPageMessage>이런, 오류가 발생했어요</S.ErrorPageMessage> | ||
<S.HomeButton onClick={handleClickHomeButton}>홈 화면으로</S.HomeButton> | ||
</S.ErrorPageWrapper> | ||
); | ||
} | ||
|
||
export default BoundaryErrorPage; |