Skip to content

Commit

Permalink
Merge pull request #223 from YAPP-Github/feature/#217
Browse files Browse the repository at this point in the history
fix: 인증번호 전송 성공 시 알럿 모달 추가
  • Loading branch information
choisohyun authored Jul 30, 2022
2 parents 39e7fde + 2ef4ed1 commit df73704
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/AuthMail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const AuthMail = () => {
const [cantMoveNext, setCantMoveNext] = useState(true);
const [email, setEmail] = useState('');
const [isErrorModal, onToggleErrorModal] = useToggle();
const [modalMessage, setModalMessage] = useState('');
const navigate = useNavigate();

useEffect(() => {
Expand All @@ -25,8 +26,11 @@ const AuthMail = () => {
try {
await postEmail(email);
setEmail(email);
onToggleErrorModal();
setModalMessage('이메일로 인증번호를 전송하였습니다. 인증번호를 입력해 주세요.');
} catch (e) {
onToggleErrorModal();
setModalMessage('에러가 발생했습니다😭 다시한번 시도해 주세요!');
}
};

Expand All @@ -37,6 +41,7 @@ const AuthMail = () => {
navigate('/type-of-meeting');
} catch (e) {
onToggleErrorModal();
setModalMessage('에러가 발생했습니다😭 다시한번 시도해 주세요!');
}
};

Expand Down Expand Up @@ -64,7 +69,7 @@ const AuthMail = () => {
height={140}
bottonName="확인"
title="알림"
text="에러가 발생했습니다😭 다시한번 시도해 주세요!"
text={modalMessage}
onToggleModal={onToggleErrorModal}
onClick={() => {
void 0;
Expand Down Expand Up @@ -117,4 +122,5 @@ const StyledLink = styled(Link)`
font-weight: 700;
text-decoration: underline;
`;

export default AuthMail;

0 comments on commit df73704

Please sign in to comment.