Advertisement
shadiff

contacts

Sep 16th, 2022
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. const Contact = () => {
  2. const form = useRef();
  3.  
  4. const sendEmail = (e) => {
  5. e.preventDefault();
  6.  
  7. emailjs.sendForm('service_8g86nib', 'template_j6x98cq', form.current, 'g0ZTHnULevuGgRARa')
  8. .then((result) => {
  9. console.log(result.text);
  10. }, (error) => {
  11. console.log(error.text);
  12. });
  13. e.target.reset()
  14.  
  15. };
  16. return ( <>
  17. <section class="contact-hero">
  18. <div className='contact-title'>
  19. <h2>CONTACT US</h2>
  20. </div>
  21. </section>
  22. <section className="contact-body">
  23. <form ref={form} onSubmit={sendEmail}>
  24. <div className='input-group'>
  25. <input type="text" id="name" required />
  26. <label for="name">
  27. <ion-icon class="contact-icon" name="person-circle-outline"></ion-icon>
  28. Your Name
  29. </label>
  30. </div>
  31. <div className='input-group'>
  32. <input type="text" id="name" required />
  33.  
  34. <label for="email">
  35. <ion-icon class="contact-icon" name="at-outline"></ion-icon>
  36. Your Gmail
  37. </label>
  38. </div>
  39.  
  40. <div className='input-group'>
  41. <textarea name="message" id="" cols="30" rows="10"></textarea>
  42. <label for="message">
  43. <ion-icon class="contact-icon" name="mail"></ion-icon>
  44. Your Message</label>
  45. </div>
  46. <button type="submit">
  47. <ion-icon class="contact-icon" name="paper-plane-outline"></ion-icon>
  48. Submit
  49. </button>
  50. </form>
  51. </section>
  52. </> );
  53. }
  54.  
  55. export default Contact;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement