import * as React from 'react'; import Box from '@mui/material/Box'; import Grid from '@mui/material/Grid'; import Link from '@mui/material/Link'; import { Field, Form, FormSpy } from 'react-final-form'; import Typography from './modules/components/Typography'; import AppFooter from './modules/views/AppFooter'; import AppAppBar from './modules/views/AppAppBar'; import AppForm from './modules/views/AppForm'; import { email, required } from './modules/form/validation'; import RFTextField from './modules/form/RFTextField'; import FormButton from './modules/form/FormButton'; import FormFeedback from './modules/form/FormFeedback'; import withRoot from './modules/withRoot'; function SignUp() { const [sent, setSent] = React.useState(false); const validate = (values: { [index: string]: string }) => { const errors = required(['firstName', 'lastName', 'email', 'password'], values); if (!errors.email) { const emailError = email(values.email); if (emailError) { errors.email = emailError; } } return errors; }; const handleSubmit = () => { setSent(true); }; return ( Sign Up Already have an account?
{({ handleSubmit: handleSubmit2, submitting }) => ( {({ submitError }) => submitError ? ( {submitError} ) : null } {submitting || sent ? 'In progress…' : 'Sign Up'} )}
); } export default withRoot(SignUp);