diff --git a/src/components/Login.tsx b/src/components/Login.tsx index 24b7219..6322ec4 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -33,6 +33,11 @@ export default function Login() { pwd: '', }) + const isValidEmail = (email: string) => { + const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/ + return emailRegex.test(email) + } + interface LoginData { code: number message: string | null @@ -82,6 +87,14 @@ export default function Login() { } }, [loginData]) + useEffect(() => { + if (isValidEmail(account.loginId)) { + setIsPartners(true) + } else { + setIsPartners(false) + } + }, [account.loginId]) + return ( <>