personal-site/pages/contact.jsx

30 lines
1.4 KiB
React
Raw Normal View History

2022-01-06 05:27:13 +00:00
import React from 'react'
import TextShuffler from '../components/actions/TextShuffler'
2022-01-06 08:05:14 +00:00
import submitContactForm from '../functions/frontend/submitContactForm'
2022-01-06 05:27:13 +00:00
import GeneralLayout from '../layouts/general_layout/GeneralLayout'
const contact = () => {
2022-01-06 08:05:14 +00:00
let [success, setSuccess] = React.useState(false);
2022-01-06 05:27:13 +00:00
return (
<GeneralLayout>
<h1><TextShuffler textInput="Great things await ..." /></h1>
<span className='hero-sub-text'>
<TextShuffler textInput="Let's talk" />
</span>
2022-01-06 08:05:14 +00:00
<form autoComplete='on' onSubmit={(e) => { submitContactForm(e, setSuccess) }}>
2022-01-06 08:22:49 +00:00
<input type="text" placeholder='Your Name' autoComplete='name' required />
<input type="email" placeholder='Your Email Address' autoComplete='email' required />
2022-01-06 05:27:13 +00:00
<textarea name="message" id="contact-form-message" cols="30" rows="10" placeholder='Message'></textarea>
<button type="submit">Submit</button>
2022-01-06 08:05:14 +00:00
{success === "Success" && <div className='message-response'>Success!!! <button onClick={() => { window.location.reload() }}>Reload</button></div>}
{success === "Failed" && <div className='message-response failed'>Failed <button onClick={() => { window.location.reload() }}>Reload</button></div>}
2022-01-06 05:27:13 +00:00
</form>
</GeneralLayout>
)
}
export default contact