Skip to content

Commit

Permalink
Merge pull request #109 from Gosrock/dev
Browse files Browse the repository at this point in the history
전화번호 인증 단계 보강
  • Loading branch information
ImNM authored Feb 9, 2022
2 parents f830078 + d912822 commit d283caa
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@testing-library/user-event": "^13.5.0",
"antd": "^4.18.2",
"axios": "^0.24.0",
"gosrock-storybook": "^1.4.7",
"gosrock-storybook": "^1.4.10",
"moment": "^2.29.1",
"qrcode.react": "^1.0.1",
"react": "^17.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ function SendMessagePage({ ...props }) {

const frontButtonHandler = () => {
console.log(phoneNumber);
if (phoneNumber === null || phoneNumber.length !== 11) {
alert('휴대폰 번호 11자리를 제대로 입력 해주세요');
return;
}
dispatch(messageSend({ phoneNumber }));
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ function SendValidationNumberPage({ ...props }) {

const dispatch = useDispatch();

const {
messageToken,
errorMessage,
pending,
validationNumber: reducerValidationNumber
} = useSelector(state => state.messageSend);
const { messageToken, validationNumber: reducerValidationNumber } =
useSelector(state => state.messageSend);

const { errorMessage, pending } = useSelector(state => state.auth);
//processForValidationNextPage 는 메시지 인증하는 프로세스가 두가지의 단계 ,
//즉 티켓 예매하는 단계와 내 티켓 확인하는 단계 두가지가 있어서 다음 페이지를 어디로 이동시킬지 결정하기 위함입니다.
//단계도중 새로고침이 발생하면 홈페이지로 보냅니다.

const { processForValidationNextPage } = useSelector(
state => state.routePagination
Expand All @@ -40,6 +41,10 @@ function SendValidationNumberPage({ ...props }) {

const frontButtonHandler = () => {
console.log(validationNumber);
if (validationNumber === null || validationNumber.length !== 6) {
alert('인증번호 6자리를 제대로 입력 해주세요');
return;
}
dispatch(
messageValidation(
{
Expand All @@ -52,8 +57,12 @@ function SendValidationNumberPage({ ...props }) {
);
};

useEffect(() => {}, [errorMessage, pending]);
console.log('인증번호 페이지');
useEffect(() => {
if (errorMessage !== null && pending === false) {
alert('인증번호가 잘못되었습니다.');
}
}, [errorMessage, pending]);

return (
<TicketWrapContainer {...props}>
<TicketContainer
Expand Down Expand Up @@ -92,7 +101,11 @@ function SendValidationNumberPage({ ...props }) {
<TicketBottom>
<GoFrontButton
onClick={frontButtonHandler}
label="티켓 발급하기"
label={
processForValidationNextPage === '/ticketing/amount'
? '예매하기'
: '내 티켓 확인하기'
}
></GoFrontButton>
</TicketBottom>
</ProgressLayout>
Expand Down

0 comments on commit d283caa

Please sign in to comment.