edit company-user registration
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
'use client'
|
||||
|
||||
import { useState, ChangeEvent } from 'react';
|
||||
import { useState, ChangeEvent, useEffect } from 'react';
|
||||
import { InputMask } from '@react-input/mask';
|
||||
import styles from '@/app/styles/module/login.module.scss';
|
||||
|
||||
interface PhoneInputProps {
|
||||
phoneState: string | undefined;
|
||||
validateHandler: (e: ChangeEvent<HTMLInputElement>) => void;
|
||||
clearCondition?: string | undefined | null
|
||||
}
|
||||
|
||||
export default function PhoneInput({ phoneState, validateHandler }: PhoneInputProps) {
|
||||
const [phone, setPhone] = useState(phoneState ? phoneState : '');
|
||||
export default function PhoneInput({ phoneState, validateHandler, clearCondition }: PhoneInputProps) {
|
||||
const [phone, setPhone] = useState<string | undefined>(phoneState ? phoneState : '');
|
||||
|
||||
useEffect(() => {
|
||||
if (clearCondition) {
|
||||
setPhone('');
|
||||
}
|
||||
}, [clearCondition])
|
||||
|
||||
return (
|
||||
<InputMask
|
||||
|
||||
Reference in New Issue
Block a user