diff --git a/src/components/ContactForm.js b/src/components/ContactForm.js index 6c85a2b5d85dff7d6c3989f0115459ca0e713a3b..f075059dfddc20f6c77ebf94d84235ae3f217bae 100644 --- a/src/components/ContactForm.js +++ b/src/components/ContactForm.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { Box, Heading, @@ -16,12 +16,26 @@ import { PrimaryButton } from './core'; const korolevFont = 'korolev, Helvetica Neue, Helvetica, Arial, sans-serif'; -const ContactForm = ({ onClose }) => { +const ContactForm = ({ onClose, defaultService, ...rest }) => { + const [name, setName] = useState(''); + const [email, setEmail] = useState(''); + const [services, setServices] = useState(''); + const [comments, setComments] = useState(''); + const [submitting, setSubmitting] = useState(); const [success, setSuccess] = useState(); + useEffect(() => { + setServices(defaultService); + }, [defaultService]); + const handleSubmit = (event) => { - const data = new FormData(event.target); + const data = new FormData(); + data.set('entry.1114584563', name); + data.set('emailAddress', email); + data.set('entry.533506743', services); + data.set('entry.297731592', comments); + setSubmitting(true); fetch( 'https://docs.google.com/forms/d/e/1FAIpQLScsfrAHD8yKJGKF-yI_T9676FR-LDmmuBG_m8uY2TmP_zmZUg/formResponse', @@ -37,7 +51,7 @@ const ContactForm = ({ onClose }) => { }; return ( - + { > REQUEST A CONSULTATION - {onClose && } + {onClose && ( + + )} {!success && ( @@ -71,13 +91,13 @@ const ContactForm = ({ onClose }) => { in, and someone from our team will reach out soon. - Submit{' '} + Do{' '} - unclassified + not {' '} - data only. + submit classified or CUI data. -
+ { } required > - + setName(e.target.value)} + /> { } required > - + setEmail(e.target.value)} + /> { } > - + setServices(e.target.value)} + /> { Comments or details{' '} - (optional) + (optional, no classified or CUI data) } @@ -137,6 +172,8 @@ const ContactForm = ({ onClose }) => {