import { useEffect, useState } from 'react'; import { Link as RouterLink } from 'react-router-dom'; // material-ui import { Box, Button, Divider, FormControl, FormHelperText, Grid, Link, IconButton, InputAdornment, InputLabel, OutlinedInput, Stack, Typography } from '@mui/material'; // third party import * as Yup from 'yup'; import { Formik } from 'formik'; // project import import FirebaseSocial from './FirebaseSocial'; import AnimateButton from 'components/@extended/AnimateButton'; import { strengthColorChi, strengthIndicator } from 'utils/password-strength'; // assets import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'; // ============================|| FIREBASE - REGISTER ||============================ // const AuthRegister = () => { const [level, setLevel] = useState(); const [showPassword, setShowPassword] = useState(false); const handleClickShowPassword = () => { setShowPassword(!showPassword); }; const handleMouseDownPassword = (event) => { event.preventDefault(); }; const changePassword = (value) => { const temp = strengthIndicator(value); setLevel(strengthColorChi(temp)); }; useEffect(() => { changePassword(''); }, []); function getMaxErrStr(num, fieldname){ return intl.formatMessage({ id: 'noMoreThenNWords' },{num:num, fieldname:fieldname?intl.formatMessage({ id: fieldname})+": ":""}); } return ( <> { try { setStatus({ success: false }); setSubmitting(false); } catch (err) { console.error(err); setStatus({ success: false }); setErrors({ submit: err.message }); setSubmitting(false); } }} > {({ errors, handleBlur, handleChange, handleSubmit, isSubmitting, touched, values }) => (
First Name* {touched.firstname && errors.firstname && ( {errors.firstname} )} Last Name* {touched.lastname && errors.lastname && ( {errors.lastname} )} Company {touched.company && errors.company && ( {errors.company} )} Email Address* {touched.email && errors.email && ( {errors.email} )} Password { handleChange(e); changePassword(e.target.value); }} endAdornment={ {showPassword ? : } } placeholder="******" inputProps={{}} /> {touched.password && errors.password && ( {errors.password} )} {level?.label} By Signing up, you agree to our   Terms of Service   and   Privacy Policy {errors.submit && ( {errors.submit} )} Sign up with
)}
); }; export default AuthRegister;