Register and OTP (#31)

* feat: responsive

* fix: success register

* feat: auth login responsive && auth login implementation

* fix: login page button disabled & register page

* fix: conflict

* fix: button disabled when loading

* feat: register and otp integration

* Update middleware.ts
This commit is contained in:
Naufal Azmi
2025-05-26 20:49:57 +07:00
committed by GitHub
parent 0f46244d2b
commit aaf5b4262d
14 changed files with 273 additions and 90 deletions
+7 -2
View File
@@ -1,21 +1,26 @@
// eslint-disable-next-line @nx/enforce-module-boundaries
import { Input } from "@imphnen-frontend-service/ui/atoms";
import { ChangeEvent, DetailedHTMLProps, FC, InputHTMLAttributes, ReactElement, useRef, useState } from "react"
import { ChangeEvent, DetailedHTMLProps, FC, InputHTMLAttributes, ReactElement, useEffect, useRef, useState } from "react"
type TForgotStepProps = Omit<
DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,
'size' | 'type'
> & {
setChange?: React.Dispatch<React.SetStateAction<any[]>>
};
export const OtpForm: FC<TForgotStepProps> = ({
step = 1,
setChange = (x: string[]) => {return},
...rest
}): ReactElement => {
const [cell, setCell] = useState(new Array(6).fill(""))
const inputRef = useRef([])
useEffect(() => {
setChange(cell)
}, [cell, setChange])
const handleChange = (index: number, e: ChangeEvent<HTMLInputElement>) => {
const value = e.target.value
if (!(/^[0-9]?$/.test(value))) return;