diff --git a/src/components/Identify Childrens/LoginForm.jsx b/src/components/Identify Childrens/LoginForm.jsx index 6710d65..0b5e61c 100644 --- a/src/components/Identify Childrens/LoginForm.jsx +++ b/src/components/Identify Childrens/LoginForm.jsx @@ -1,10 +1,23 @@ import React from 'react' -const LoginForm = () => { +const LoginForm = (props) => { return ( -
) diff --git a/src/components/Identify Childrens/RegisterForm.jsx b/src/components/Identify Childrens/RegisterForm.jsx index d523c1b..d89723c 100644 --- a/src/components/Identify Childrens/RegisterForm.jsx +++ b/src/components/Identify Childrens/RegisterForm.jsx @@ -1,12 +1,37 @@ import React from 'react' -const RegisterForm = () => { +const RegisterForm = (props) => { return ( - ) } diff --git a/src/components/Identify.jsx b/src/components/Identify.jsx index a7c2009..a8e4fc9 100644 --- a/src/components/Identify.jsx +++ b/src/components/Identify.jsx @@ -4,7 +4,11 @@ import RegisterForm from './Identify Childrens/RegisterForm' const Identify = () => { - const [act, setAct] = useState('register') + const [act, setAct] = useState('') + + const [email, setEmail] = useState('') + const [password, setPassword] = useState('') + const [confirmPassword, setConfirmPassword] = useState('') const defineLogin = () => { if (act !== 'login') { @@ -17,6 +21,48 @@ const Identify = () => { setAct('register') } } + + const sendForm = (e) => { + e.preventDefault() + + if (!email.trim()) { + alert('EMAIL EMPTY') + return + } + + if (!password.trim()) { + alert('PASSWORD EMPTY') + return + } + + if (act === 'register') { + + if (!confirmPassword.trim()) { + alert('CONFIRM PASSWORD PLEASE') + return + } + + e.target.reset() + setEmail('') + setPassword('') + setConfirmPassword('') + + //SEND TO FIREBASE + return + } + + if (act === 'login') { + + e.target.reset() + setEmail('') + setPassword('') + + //SEND TO FIREBASE + return + } + + alert('ACTION NOT VALID') + } React.useEffect( () => { const urlInfo = new URLSearchParams(window.location.search) @@ -56,7 +102,7 @@ const Identify = () => { className={ act === 'register' ? 'option active-option': 'option' } - + onClick={() => { defineRegister() }} @@ -69,10 +115,10 @@ const Identify = () => {