diff --git a/src/components/ContactForm.js b/src/components/ContactForm.js index f075059dfddc20f6c77ebf94d84235ae3f217bae..70c32dd1e50822c867a478d606b99ab696c3f7e7 100644 --- a/src/components/ContactForm.js +++ b/src/components/ContactForm.js @@ -29,25 +29,27 @@ const ContactForm = ({ onClose, defaultService, ...rest }) => { setServices(defaultService); }, [defaultService]); - const handleSubmit = (event) => { - const data = new FormData(); - data.set('entry.1114584563', name); - data.set('emailAddress', email); - data.set('entry.533506743', services); - data.set('entry.297731592', comments); + const handleSubmit = () => { + window.open( + `mailto:AFLCMC.HN.DT3@us.af.mil?subject=Contact Form&body=Name:%0d%0a${name}%0d%0a%0d%0aEmail address:%0d%0a${email}%0d%0a%0d%0aServices or solutions you are interested in:%0d%0a${services}%0d%0a%0d%0aComments or details:%0d%0a${comments}%0d%0a%0d%0a`, + '_blank', + 'width=800,height=500' + ); - setSubmitting(true); - fetch( - 'https://docs.google.com/forms/d/e/1FAIpQLScsfrAHD8yKJGKF-yI_T9676FR-LDmmuBG_m8uY2TmP_zmZUg/formResponse', - { - mode: 'no-cors', // we don't care about the result of this request, so just do it. - method: 'POST', - body: data, - } - ).then((res) => { - setSubmitting(false); - setSuccess(true); - }); + /* Removing google docs submit */ + + // setSubmitting(true); + // fetch( + // 'https://docs.google.com/forms/d/e/1FAIpQLScsfrAHD8yKJGKF-yI_T9676FR-LDmmuBG_m8uY2TmP_zmZUg/formResponse', + // { + // mode: 'no-cors', // we don't care about the result of this request, so just do it. + // method: 'POST', + // body: data, + // } + // ).then((res) => { + // setSubmitting(false); + // setSuccess(true); + // }); }; return ( diff --git a/src/components/FeedbackForm.js b/src/components/FeedbackForm.js index f57deed0e9f73d194f7507c66933823b987c07ff..c8a60c71eff78fdf1daae5fed179c0c80b14cf87 100644 --- a/src/components/FeedbackForm.js +++ b/src/components/FeedbackForm.js @@ -18,23 +18,53 @@ import { PrimaryButton, SecondaryButton } from './core'; const korolevFont = 'korolev, Helvetica Neue, Helvetica, Arial, sans-serif'; const FeedbackForm = ({ onClose }) => { + + /* + TODO: Jovany, will need to add initial state for form inputs here + ...will also need to add onChange methods in the render section, similar to ContactForm.js + */ + + const [name, setName] = useState(''); + const [email, setEmail] = useState(''); + const [thoughts, setThoughts] = useState(''); + const [volunteer, setVolunteer] = useState(false); const [submitting, setSubmitting] = useState(); const [success, setSuccess] = useState(); - const handleSubmit = (event) => { - const data = new FormData(event.target); - setSubmitting(true); - fetch( - 'https://docs.google.com/forms/d/e/1FAIpQLSf79Q_Cl2MC9wxUHUEZWvUAAehxUaGn_wKmJ014E49-ENaS3Q/formResponse', - { - mode: 'no-cors', // we don't care about the result of this request, so just do it. - method: 'POST', - body: data, - } - ).then((res) => { - setSubmitting(false); - setSuccess(true); - }); + const handleSubmit = () => { + /* + TODO: Jovany, will need to modify the body of the email to send input values + */ + + window.open( + `mailto:AFLCMC.HN.DT3@us.af.mil?subject=Feedback Form&body=Name:%0d%0a${name}%0d%0a%0d%0aEmail:%0d%0a${email}%0d%0a%0d%0aThoughts:%0d%0a${thoughts}%0d%0a%0d%0aVolunteer:%0d%0a${volunteer === true ? 'Yes' : 'No'}%0d%0a%0d%0a`, + '_blank', + 'width=800,height=500' + ); + + + /* + + window.open( + `mailto:AFLCMC.HN.DT3@us.af.mil?subject=Contact Form&body=Name:%0d%0a${name}%0d%0a%0d%0aEmail address:%0d%0a${email}%0d%0a%0d%0aServices or solutions you are interested in:%0d%0a${services}%0d%0a%0d%0aComments or details:%0d%0a${comments}%0d%0a%0d%0a`, + '_blank', + 'width=800,height=500' + ); + + */ + + // setSubmitting(true); + // fetch( + // 'https://docs.google.com/forms/d/e/1FAIpQLSf79Q_Cl2MC9wxUHUEZWvUAAehxUaGn_wKmJ014E49-ENaS3Q/formResponse', + // { + // mode: 'no-cors', // we don't care about the result of this request, so just do it. + // method: 'POST', + // body: data, + // } + // ).then((res) => { + // setSubmitting(false); + // setSuccess(true); + // }); }; return ( @@ -82,6 +112,9 @@ const FeedbackForm = ({ onClose }) => { id="text-input-comments" name="entry.675672969" style={{ height: '100px' }} + value={thoughts} + onChange={(e) => setThoughts(e.target.value)} + /> { setVolunteer(e.target.checked)} label={ @@ -119,7 +153,8 @@ const FeedbackForm = ({ onClose }) => { } > - + setName(e.target.value)} /> { } > - + setEmail(e.target.value)} /> +