-
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 #49 from JNU-Parking-Ticket-Project/feat/39-apply-all
[FE] feat(apply): API 스펙 변경에 대응하며 자동신청 방지 모달창을 구현한다
- Loading branch information
Showing
28 changed files
with
664 additions
and
248 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
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,12 @@ | ||
import './spinner.css'; | ||
|
||
export const Spinner = () => { | ||
return ( | ||
<div className="lds-ring"> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</div> | ||
); | ||
}; |
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,40 @@ | ||
.lds-ring { | ||
width: 100%; | ||
height: 120px; | ||
position: relative; | ||
background-color: white; | ||
pointer-events: none; | ||
} | ||
.lds-ring div { | ||
box-sizing: border-box; | ||
display: block; | ||
position: absolute; | ||
left: calc(50% - 40px); | ||
top: calc(50% - 40px); | ||
transform: translate(-50%, -50%); | ||
width: 80px; | ||
height: 80px; | ||
margin: 8px; | ||
border: 8px solid black; | ||
border-radius: 50%; | ||
animation: lds-ring 1.2s 1s cubic-bezier(0.5, 0, 0.5, 1) infinite; | ||
border-color: black transparent transparent transparent; | ||
pointer-events: none; | ||
} | ||
.lds-ring div:nth-child(1) { | ||
animation-delay: -0.45s; | ||
} | ||
.lds-ring div:nth-child(2) { | ||
animation-delay: -0.3s; | ||
} | ||
.lds-ring div:nth-child(3) { | ||
animation-delay: -0.15s; | ||
} | ||
@keyframes lds-ring { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} |
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,63 @@ | ||
import { Modal, Txt } from '@quokka/design-system'; | ||
import { Suspense, useState } from 'react'; | ||
import { CaptchaForm } from './CaptchaForm'; | ||
import { Spinner } from '../../assets/Spinner'; | ||
import ErrorBoundary from '../common/ErrorBoundray'; | ||
import { useCaptchaForm } from '../../hooks/apply/useCaptchaForm'; | ||
|
||
interface ApplyCaptchaModalProps { | ||
isOpen: boolean; | ||
onRequestClose: () => void; | ||
} | ||
|
||
export const ApplyCaptchaModal = ({ | ||
isOpen, | ||
onRequestClose, | ||
}: ApplyCaptchaModalProps) => { | ||
const { isLoading, input, handleInput, captchaImageUrl, handleSubmit } = | ||
useCaptchaForm({ | ||
closeModal: onRequestClose, | ||
}); | ||
|
||
return ( | ||
<Modal | ||
className="captcha-modal" | ||
isOpen={isOpen} | ||
onRequestClose={onRequestClose} | ||
overLayCss={{ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}} | ||
contentCss={{ | ||
padding: '2rem', | ||
width: '80%', | ||
maxWidth: '44rem', | ||
backgroundColor: 'white', | ||
boxShadow: '0px 0px 4px 4px rgba(17, 12, 34, 0.10)', | ||
borderRadius: '1rem', | ||
}} | ||
> | ||
{isLoading ? ( | ||
<div className="flex flex-col justify-center align-center"> | ||
<Txt size="h6" className="text-center"> | ||
신청 접수 중입니다. 잠시만 기다려주세요. | ||
</Txt> | ||
<Txt size="h6" className="text-center"> | ||
새로고침 시 신청이 취소됩니다. | ||
</Txt> | ||
<div className="w-full"> | ||
<Spinner /> | ||
</div> | ||
</div> | ||
) : ( | ||
<CaptchaForm | ||
codeInput={input} | ||
handleCodeInput={handleInput} | ||
captchaImageUrl={captchaImageUrl} | ||
handleSubmit={handleSubmit} | ||
/> | ||
)} | ||
</Modal> | ||
); | ||
}; |
Oops, something went wrong.