diff --git a/src/components/ContactForm.tsx b/src/components/ContactForm.tsx new file mode 100644 index 0000000..4378ee6 --- /dev/null +++ b/src/components/ContactForm.tsx @@ -0,0 +1,133 @@ +import { Formik, Form, Field, ErrorMessage } from "formik"; +import FormSchema from "./schema/FormSchema"; +import { useState } from "react"; + +interface IFormikValues { + name: string; + email: string; + cpf: string; + data: string; + telefone: string; + instagram?: string; + checkbox: boolean; +} + +const initialValues = { + name: "", + email: "", + cpf: "", + data: "", + telefone: "", + instagram: "", + checkbox: false, +}; + +export const ContactForm = () => { + const [isSubmited, setIsSubmited] = useState(false); + const formSubmit = (values: IFormikValues) => { + setIsSubmited(true); + }; + return ( + + {({ errors, touched, isValid, validateForm }) => ( +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ + {isSubmited && *Formulário enviado com sucesso!} +
+ )} +
+ ); +}; diff --git a/src/components/s.txt b/src/components/s.txt new file mode 100644 index 0000000..e69de29