development #24

Merged
Rafael_Sampaio_de_Oliveira merged 2 commits from development into main 2023-01-10 16:02:30 +00:00
4 changed files with 21 additions and 29 deletions

View File

@ -114,14 +114,6 @@
text-transform: none;
}
}
&__socialMedia {
height: 35px;
.socialMeida-site {
display: none;
}
}
}
@media (min-width: 2500px) {

View File

@ -110,10 +110,8 @@ const Contact = () => {
</div>
<div className={styles["form__input"]}>
<label htmlFor="cpf">CPF</label>
<Field
id="cpf"
name="cpf"
render={({ field }: any) => (
<Field id="cpf" name="cpf">
{({ field }: any) => (
<MaskedInput
{...field}
mask={cpfNumberMask}
@ -122,7 +120,7 @@ const Contact = () => {
type="text"
/>
)}
/>
</Field>
<ErrorMessage
component="span"
name="cpf"
@ -131,10 +129,8 @@ const Contact = () => {
</div>
<div className={styles["form__input"]}>
<label htmlFor="birthDate">Data de Nascimento:</label>
<Field
id="birthDate"
name="birthDate"
render={({ field }: any) => (
<Field id="birthDate" name="birthDate">
{({ field }: any) => (
<MaskedInput
{...field}
mask={bhirtDateMask}
@ -143,7 +139,7 @@ const Contact = () => {
type="text"
/>
)}
/>
</Field>
<ErrorMessage
component="span"
name="birthDate"
@ -152,10 +148,8 @@ const Contact = () => {
</div>
<div className={styles["form__input"]}>
<label htmlFor="phone">Telefone:</label>
<Field
id="phone"
name="phone"
render={({ field }: any) => (
<Field id="phone" name="phone">
{({ field }: any) => (
<MaskedInput
{...field}
mask={phoneNumberMask}
@ -164,7 +158,7 @@ const Contact = () => {
type="text"
/>
)}
/>
</Field>
<ErrorMessage
component="span"
name="phone"

View File

@ -1,7 +1,7 @@
import React from "react";
import styles from "./styles.module.scss";
import { Formik, Form, Field, ErrorMessage, FormikHelpers } from "formik";
import FormSchema from "../../schema/FormSchema";
import { Formik, Form, Field, ErrorMessage } from "formik";
import NewsletterSchema from "../../schema/NewsLetterSchema";
interface FormikValues {
newsLetter: string;
@ -12,8 +12,9 @@ const initialValues = {
};
const NewsLetter = () => {
const handleFormikSubmit = (values: FormikValues) => {
const handleNewsletterSubmit = (values: FormikValues, { resetForm }: any) => {
console.log(values);
resetForm({ values: "" });
};
return (
@ -22,9 +23,9 @@ const NewsLetter = () => {
<h1>Assine nossa Newsletter</h1>
</div>
<Formik
onSubmit={handleFormikSubmit}
onSubmit={handleNewsletterSubmit}
initialValues={initialValues}
validationSchema={FormSchema}
validationSchema={NewsletterSchema}
>
<Form className={styles["newsLetter__container"]}>
<Field
@ -34,7 +35,7 @@ const NewsLetter = () => {
placeholder="E-mail"
/>
<ErrorMessage component="span" name="newsLetter" />
<button className={styles["newsLetter__button"]} type="submit">
<button type="submit" className={styles["newsLetter__button"]}>
Enviar
</button>
</Form>

View File

@ -0,0 +1,5 @@
import * as Yup from "yup";
export default Yup.object().shape({
newsLetter: Yup.string().required("").email("e-Mail inválido"),
});