diff --git a/src/app/auth/page.tsx b/src/app/auth/page.tsx index 5d346d6..16ae303 100644 --- a/src/app/auth/page.tsx +++ b/src/app/auth/page.tsx @@ -35,20 +35,20 @@ function AuthIndex({ }: Props) { }, [isAuthenticated]) const onChange = (e: ChangeEvent) => { - if (e.target.id == AUTH_PAGE_ELEMENT.INPUT_PHONE) { + if (e.target.name == AUTH_PAGE_ELEMENT.INPUT_PHONE) { setNumber(() => e.target.value) } - else if (e.target.id == AUTH_PAGE_ELEMENT.INPUT_PASSWORD) { + else if (e.target.name == AUTH_PAGE_ELEMENT.INPUT_PASSWORD) { setPassword(() => e.target.value) } - else if (e.target.id == AUTH_PAGE_ELEMENT.INPUT_PASSWORD_REPEAT) { + else if (e.target.name == AUTH_PAGE_ELEMENT.INPUT_PASSWORD_REPEAT) { setPasswordRepeat(() => e.target.value) } - else if (e.target.id == AUTH_PAGE_ELEMENT.INPUT_REMEMBER_ME) { + else if (e.target.name == AUTH_PAGE_ELEMENT.INPUT_REMEMBER_ME) { setRememberMe((state) => !state) } - else if (e.target.id.startsWith(AUTH_PAGE_ELEMENT.INPUT_OTP)) { - const index = +e.target.id.split('-')[2]; + else if (e.target.name.startsWith(AUTH_PAGE_ELEMENT.INPUT_OTP)) { + const index = +e.target.name.split('-')[2]; const prev = otp.padEnd(6).split(''); prev[index] = e.target.value; const next = prev.join(''); diff --git a/src/components/input/InputField.tsx b/src/components/input/InputField.tsx index e86a464..8174f9b 100644 --- a/src/components/input/InputField.tsx +++ b/src/components/input/InputField.tsx @@ -20,7 +20,7 @@ function InputField({ onChange, htmlFor, labelText, children, valid = true, clas {children} diff --git a/src/components/input/MultiInputField.tsx b/src/components/input/MultiInputField.tsx index 83cc446..1102e0b 100644 --- a/src/components/input/MultiInputField.tsx +++ b/src/components/input/MultiInputField.tsx @@ -12,7 +12,7 @@ type Props = { } & Omit, "id">; -function OTPInputField({ onChange, maxLength = 6, htmlFor, labelText, className, value = '' }: Props) { +function OTPInputField({ onChange, maxLength = 6, htmlFor, labelText, className, value = '', ...restProps }: Props) { const values = value?.toString().split('').slice(0, maxLength); const inputRefs = useRef(Array.from({ length: maxLength }, () => createRef())); const [prevLength, setPrevLength] = useState(0); @@ -54,15 +54,16 @@ function OTPInputField({ onChange, maxLength = 6, htmlFor, labelText, className, htmlFor={htmlFor}> {labelText} -
+
{inputRefs?.current?.map((ref, i) => { return ( برای ورود شماره همراه خود را وارد نمایید.

+ type='tel' />
diff --git a/src/features/auth/components/StepEnterOtp.tsx b/src/features/auth/components/StepEnterOtp.tsx index 60d1351..e714150 100644 --- a/src/features/auth/components/StepEnterOtp.tsx +++ b/src/features/auth/components/StepEnterOtp.tsx @@ -14,9 +14,9 @@ type Props = { } function StepEnterOtp({ onSubmit, onChange, onClick, value, phoneNumber, timerRunning, secondsLeft }: Props) { - + return ( -
+
@@ -25,16 +25,17 @@ function StepEnterOtp({ onSubmit, onChange, onClick, value, phoneNumber, timerRu

کد ۶ رقمی ارسال شده به شماره {phoneNumber} را وارد نمایید.

+ onChange={onChange} /> -
{timerRunning ? diff --git a/src/features/auth/components/StepEnterPassword.tsx b/src/features/auth/components/StepEnterPassword.tsx index 7d4fe32..dfa3a4c 100644 --- a/src/features/auth/components/StepEnterPassword.tsx +++ b/src/features/auth/components/StepEnterPassword.tsx @@ -23,6 +23,7 @@ function StepEnterPassword({ onSubmit, onChange, onClick, value, passwordVisible

کلمه عبور خود را وارد نمایید.

{/* TODO: customize checkbox */} -
+
diff --git a/src/features/auth/components/StepNewPassword.tsx b/src/features/auth/components/StepNewPassword.tsx index dfaf52f..a604762 100644 --- a/src/features/auth/components/StepNewPassword.tsx +++ b/src/features/auth/components/StepNewPassword.tsx @@ -17,7 +17,7 @@ type Props = { function StepNewPassword({ reset = false, onSubmit, onChange, onClick, value, repeatValue, passwordVisible, repeatPasswordVisible }: Props) { return ( - +
@@ -27,6 +27,7 @@ function StepNewPassword({ reset = false, onSubmit, onChange, onClick, value, re

کلمه عبور جدید باید ترکیبی از حروف بزرگ و کوچک و نشانه ها باشد مثل A126bdz@