diff --git a/src/components/Newsletter/Newsletter.module.scss b/src/components/Newsletter/Newsletter.module.scss index 0cc93b6..6d9e789 100644 --- a/src/components/Newsletter/Newsletter.module.scss +++ b/src/components/Newsletter/Newsletter.module.scss @@ -55,7 +55,7 @@ &__items { display: flex; flex-direction: row; - align-items: flex-start; + align-items: center; justify-content: center; gap: 8px; diff --git a/src/components/Newsletter/Newsletter.tsx b/src/components/Newsletter/Newsletter.tsx index 6cd8e5c..2466510 100644 --- a/src/components/Newsletter/Newsletter.tsx +++ b/src/components/Newsletter/Newsletter.tsx @@ -1,10 +1,11 @@ -import React from 'react'; +import React from "react"; -import { Formik, Form, Field, ErrorMessage} from "formik"; +import { Formik, Form, Field, ErrorMessage, FormikHelpers} from "formik"; import styles from "./Newsletter.module.scss"; -import NewsletterSchema from './Schema/NewsletterSchema'; +import NewsletterSchema from "./Schema/NewsletterSchema"; +import { Button } from "../Button/Buttom"; interface NewsletterValue { email: string; @@ -14,18 +15,20 @@ const initialValue = { email: "", } +let listEmail: Array = []; + const Newsletter = () => { - const handleFormikSubmit = (values: NewsletterValue) => { - //console.log(values); + const handleSubmit = (values: NewsletterValue, actions: FormikHelpers) => { + listEmail.push(values); + console.log(listEmail); + actions.resetForm(); }; return (
{ - handleFormikSubmit(values); - resetForm(); }} + onSubmit={handleSubmit} initialValues={initialValue} validationSchema={NewsletterSchema} > @@ -35,14 +38,12 @@ const Newsletter = () => {
- - +
- +
)}