- 링크결제 전화번호 입력 Number only

- 링크결제 신청 완료 페이지 결과 박스 제거
- 안면인증 테스트용 Mid 고정
This commit is contained in:
HyeonJongKim
2025-11-03 13:29:38 +09:00
parent e7a3409edc
commit b543719295
4 changed files with 19 additions and 10 deletions

View File

@@ -19,6 +19,11 @@ export const LinkPaymentStep2 = ({
setProcessStep(ProcessStep.One);
});
// 전화번호 형식 검증
const isValidPhoneNumber = (phone: string) => {
const phoneRegex = /^01[0|1|6|7|8|9][0-9]{7,8}$/;
return phoneRegex.test(phone);
};
const handleInputChange = (field: string, value: string) => {
setFormData({ ...formData, [field]: value });
@@ -74,10 +79,17 @@ export const LinkPaymentStep2 = ({
<div className="issue-label wid-105"><br /> </div>
<div className="issue-field">
<input
type="text"
type="tel"
placeholder="01012345678"
value={formData.phoneNumber}
onChange={(e) => handleInputChange('phoneNumber', e.target.value)}
onChange={(e) => {
const onlyNumbers = e.target.value.replace(/[^0-9]/g, '');
handleInputChange('phoneNumber', onlyNumbers);
}}
className={formData.phoneNumber && !isValidPhoneNumber(formData.phoneNumber) ? 'error' : ''}
inputMode="numeric"
pattern="[0-9]*"
maxLength={11}
/>
</div>
</div>