-
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.
Merge pull request #119 from teamViNO/feature-027
feature-027: 에러 모달 구현
- Loading branch information
Showing
6 changed files
with
142 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
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
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,39 @@ | ||
import { useSetRecoilState } from 'recoil'; | ||
import { errorModalState } from '@/stores/modal'; | ||
import useOutsideClick from '@/hooks/useOutsideClick'; | ||
|
||
import CloseIcon from '@/assets/icons/close.svg?react'; | ||
import errorImg from '@/assets/Error.png'; | ||
import { ErrorModalContainer } from '@/styles/modals/ErrorModal.style'; | ||
|
||
const ErrorModal = () => { | ||
const setIsOpenModal = useSetRecoilState(errorModalState); | ||
const [modalRef] = useOutsideClick<HTMLDivElement>(() => | ||
setIsOpenModal(false), | ||
); | ||
|
||
return ( | ||
<ErrorModalContainer> | ||
<div className="container" ref={modalRef}> | ||
<div className='wrapper'> | ||
<div className="close-btn" onClick={() => setIsOpenModal(false)}> | ||
<CloseIcon width={28} height={28} /> | ||
</div> | ||
|
||
<div className='main'> | ||
<div className='modal-main'> | ||
<img src={errorImg} alt='errorImg' width={56} height={56}></img> | ||
<h2>영상 업로드 중 오류</h2> | ||
</div> | ||
<h4>업로드 중 알 수 없는 오류가 발생했어요<br />다시 시도해주세요</h4> | ||
</div> | ||
</div> | ||
<button className='restart-btn' onClick={() => setIsOpenModal(false)}> | ||
다시 입력하기 | ||
</button> | ||
</div> | ||
</ErrorModalContainer> | ||
); | ||
}; | ||
|
||
export default ErrorModal; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import styled from 'styled-components'; | ||
import theme from '../theme'; | ||
|
||
export const ErrorModalContainer = styled.div` | ||
position: fixed; | ||
z-index: 100; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: rgba(0, 0, 0, 0.5); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
.container { | ||
width: 700px; | ||
height: 384px; | ||
background-color: ${theme.color.white}; | ||
padding: 40px 50px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
} | ||
.wrapper { | ||
width: 600px; | ||
height: 198px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: center; | ||
} | ||
.close-btn { | ||
align-self: flex-end; | ||
cursor: pointer; | ||
} | ||
.main { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
text-align: center; | ||
} | ||
.modal-main { | ||
width: 245px; | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
text-align: center; | ||
} | ||
.modal-main h2 { | ||
color: ${theme.color.gray500}; | ||
font-style: ${theme.typography.Header6}; | ||
font-size: 24px; | ||
line-height: 1.6em; | ||
margin-top: 12px; | ||
margin-bottom: 12px; | ||
} | ||
.main h4 { | ||
color: ${theme.color.gray300}; | ||
font-style: ${theme.typography.Body1}; | ||
font-size: 16px; | ||
line-height: 1.6em; | ||
} | ||
.restart-btn { | ||
width: 600px; | ||
height: 58px; | ||
font-style: ${theme.typography.Body1}; | ||
font-size: 16px; | ||
padding: 16px 24px; | ||
color: ${theme.color.white}; | ||
background-color: ${theme.color.gray500}; | ||
border: none; | ||
border-radius: 12px; | ||
cursor: pointer; | ||
} | ||
`; |