-
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: 500에러 컴포넌트 * chore: 확장자 추가 * feat: 이미지 추가 및 route * chore: @types, tsconfig
- Loading branch information
1 parent
6b34340
commit f804000
Showing
6 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
File renamed without changes.
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,34 @@ | ||
'use client'; | ||
|
||
import { Button, Txt } from '@sds/components'; | ||
import { colors } from '@sds/theme'; | ||
import Image from 'next/image'; | ||
import { useRouter } from 'next/navigation'; | ||
|
||
import ErrorImage from './images/error.png'; | ||
import { buttonsContainer, codeCss, containerCss, descriptionCss, titleCss } from './styles'; | ||
|
||
export const Error500 = () => { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<div style={{ backgroundColor: colors.secondary50 }} css={containerCss}> | ||
<h1 style={{ color: colors.secondary500 }} css={codeCss}> | ||
500 | ||
</h1> | ||
<h2 css={titleCss}>잠시 후 다시 확인해주세요!</h2> | ||
<Txt typography="body2" as="h3" color={colors.grey600} css={descriptionCss}> | ||
앗, 에러가 발생했어요. | ||
<br /> | ||
잠시 후 다시 시도해 주세요. | ||
</Txt> | ||
<Image src={ErrorImage} width={288} height={304} alt="error" /> | ||
<div css={buttonsContainer}> | ||
<Button onClick={() => router.back()}>이전 페이지로 가기</Button> | ||
<Button variant="sub" onClick={() => router.push('/home')}> | ||
홈으로 가기 | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; |
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 @@ | ||
export { Error500 } from './500'; |
42 changes: 42 additions & 0 deletions
42
packages/web-domains/src/common/components/Error/styles.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,42 @@ | ||
import { css } from '@emotion/react'; | ||
import { fontWeightVariants } from '@sds/components'; | ||
import { colors, size } from '@sds/theme'; | ||
|
||
export const containerCss = css({ | ||
width: '100%', | ||
height: '100dvh', | ||
paddingTop: size.xl, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
position: 'relative', | ||
}); | ||
|
||
export const codeCss = css({ | ||
fontSize: '64px', | ||
fontWeight: fontWeightVariants.bold, | ||
marginBottom: size['2xs'], | ||
}); | ||
|
||
export const titleCss = css({ | ||
fontSize: '24px', | ||
fontWeight: fontWeightVariants.bold, | ||
color: colors.black, | ||
marginBottom: size['3xs'], | ||
}); | ||
|
||
export const descriptionCss = css({ | ||
textAlign: 'center', | ||
marginBottom: '50px', | ||
}); | ||
|
||
export const buttonsContainer = css({ | ||
position: 'absolute', | ||
bottom: 0, | ||
width: '100%', | ||
padding: size['2xs'], | ||
|
||
'& > button + button': { | ||
marginTop: size['5xs'], | ||
}, | ||
}); |
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