From 6af17b42dd1e45685526bc884accd4c82543d14b Mon Sep 17 00:00:00 2001 From: danielmoliaribarbosa Date: Fri, 20 Jan 2023 04:16:18 -0300 Subject: [PATCH] =?UTF-8?q?feature(contato):=20Implementa=20React=20e=20Ty?= =?UTF-8?q?pescript=20da=20p=C3=A1gina=20do=20contato.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ContactForm.tsx | 133 +++++++++++++++++++++++++++++++++ src/components/s.txt | 0 2 files changed, 133 insertions(+) create mode 100644 src/components/ContactForm.tsx create mode 100644 src/components/s.txt 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