From efed6c0a820c5c47e097fa29455157bbd318ffca Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 17 Dec 2021 23:28:17 +0100
Subject: chore: create mutation to send mail from contact form

---
 src/components/Form/Form.tsx | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

(limited to 'src/components/Form/Form.tsx')

diff --git a/src/components/Form/Form.tsx b/src/components/Form/Form.tsx
index cc97526..5e26e81 100644
--- a/src/components/Form/Form.tsx
+++ b/src/components/Form/Form.tsx
@@ -1,13 +1,15 @@
-import { FormEvent } from 'react';
+import { ReactNode } from 'react';
 import styles from './Form.module.scss';
 
-const Form: React.FunctionComponent = ({ children }) => {
-  const submitForm = (e: FormEvent) => {
-    e.preventDefault();
-  };
-
+const Form = ({
+  children,
+  submitHandler,
+}: {
+  children: ReactNode;
+  submitHandler: any;
+}) => {
   return (
-    <form onSubmit={submitForm} className={styles.wrapper}>
+    <form onSubmit={submitHandler} className={styles.wrapper}>
       {children}
     </form>
   );
-- 
cgit v1.2.3

