Compare commits

..

No commits in common. "main" and "feature/adiciona-botoes-fixos-whatsapp-para-o-topo" have entirely different histories.

6 changed files with 33 additions and 40 deletions

View File

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

View File

@ -77,7 +77,6 @@ const Contact = () => {
const handleFormikSubmit = (values: FormikValues, { resetForm }: any) => {
resetForm({ values: "" });
setSuccessMessage(true);
setTimeout(() => setSuccessMessage(false), 3000);
};
return (
@ -111,8 +110,10 @@ const Contact = () => {
</div>
<div className={styles["form__input"]}>
<label htmlFor="cpf">CPF</label>
<Field id="cpf" name="cpf">
{({ field }: any) => (
<Field
id="cpf"
name="cpf"
render={({ field }: any) => (
<MaskedInput
{...field}
mask={cpfNumberMask}
@ -121,7 +122,7 @@ const Contact = () => {
type="text"
/>
)}
</Field>
/>
<ErrorMessage
component="span"
name="cpf"
@ -130,8 +131,10 @@ const Contact = () => {
</div>
<div className={styles["form__input"]}>
<label htmlFor="birthDate">Data de Nascimento:</label>
<Field id="birthDate" name="birthDate">
{({ field }: any) => (
<Field
id="birthDate"
name="birthDate"
render={({ field }: any) => (
<MaskedInput
{...field}
mask={bhirtDateMask}
@ -140,7 +143,7 @@ const Contact = () => {
type="text"
/>
)}
</Field>
/>
<ErrorMessage
component="span"
name="birthDate"
@ -149,8 +152,10 @@ const Contact = () => {
</div>
<div className={styles["form__input"]}>
<label htmlFor="phone">Telefone:</label>
<Field id="phone" name="phone">
{({ field }: any) => (
<Field
id="phone"
name="phone"
render={({ field }: any) => (
<MaskedInput
{...field}
mask={phoneNumberMask}
@ -159,7 +164,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 } from "formik";
import NewsletterSchema from "../../schema/NewsLetterSchema";
import { Formik, Form, Field, ErrorMessage, FormikHelpers } from "formik";
import FormSchema from "../../schema/FormSchema";
interface FormikValues {
newsLetter: string;
@ -12,9 +12,8 @@ const initialValues = {
};
const NewsLetter = () => {
const handleNewsletterSubmit = (values: FormikValues, { resetForm }: any) => {
const handleFormikSubmit = (values: FormikValues) => {
console.log(values);
resetForm({ values: "" });
};
return (
@ -23,9 +22,9 @@ const NewsLetter = () => {
<h1>Assine nossa Newsletter</h1>
</div>
<Formik
onSubmit={handleNewsletterSubmit}
onSubmit={handleFormikSubmit}
initialValues={initialValues}
validationSchema={NewsletterSchema}
validationSchema={FormSchema}
>
<Form className={styles["newsLetter__container"]}>
<Field
@ -35,7 +34,7 @@ const NewsLetter = () => {
placeholder="E-mail"
/>
<ErrorMessage component="span" name="newsLetter" />
<button type="submit" className={styles["newsLetter__button"]}>
<button className={styles["newsLetter__button"]} type="submit">
Enviar
</button>
</Form>

View File

@ -7,6 +7,7 @@
border-color: var(--black-500);
width: 100%;
padding: 16px 0;
position: relative;
&__title {
width: 37.09%;
@ -31,7 +32,6 @@
height: 42px;
width: 37.09%;
max-width: 474.75px;
position: relative;
span {
font-style: normal;
@ -40,8 +40,8 @@
line-height: 14px;
color: var(--red-500);
position: absolute;
top: -30%;
left: 55%;
top: 31%;
right: 43%;
}
}
@ -101,11 +101,6 @@
width: 100%;
max-width: 100%;
flex-direction: column;
span {
top: 43%;
left: 0%;
}
}
&__input {
@ -135,13 +130,6 @@
width: 36.88%;
max-width: 922px;
height: 59px;
span {
font-size: 24px;
line-height: 28px;
top: -42%;
left: 56%;
}
}
&__input {

View File

@ -1,9 +1,7 @@
import * as Yup from "yup";
export default Yup.object().shape({
name: Yup.string()
.min(3, "Mínimo de 03 caracteres")
.required("*Campo Obrigatório"),
name: Yup.string().required("*Campo Obrigatório"),
email: Yup.string().required("*Campo Obrigatório").email("e-Mail inválido"),
cpf: Yup.string()
.matches(/^\d{3}.\d{3}.\d{3}-\d{2}$/, "CPF inválido")

View File

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