import React, { useState } from "react"; import { graphql } from "gatsby"; import { Marker } from "google-maps-react"; import Layout from "../layout"; import { Button, CustomDropzone, Grid, Header, Heading, Icon, IconWithContent, InputText, Interrupt, Label, Link, Map, Section, Select, Text } from "../components"; import CheckCircle from "../icons/check-circle.svg"; import Envelope from "../icons/envelope.svg"; import Phone from "../icons/phone.svg"; import Team from "../icons/team.svg"; const encode = data => { const formData = new FormData(); Object.keys(data).forEach(k => { formData.append(k, data[k]); }); return formData; }; export default function Index({ data }) { const [formState, setFormState] = useState(); const [uploadFiles, setUploadFiles] = useState(); const [files, setFiles] = useState({}); const handleUploadClick = e => { e.preventDefault(); setUploadFiles(true); }; const handleSubmit = e => { e.preventDefault(); setFormState("submitting"); const body = encode({ "form-name": "contact", name: e.target.name.value, email: e.target.email.value, telephone: e.target.telephone.value, start: e.target.start.value, stage: e.target.stage.value, status: e.target.status.value, budget: e.target.budget.value, message: e.target.message.value, files }); fetch("/contact", { method: "POST", body }) .then(res => { if (res.status !== 200) { setFormState("error"); } else { setFormState("success"); } }) .catch(() => setFormState("error")); }; return (
Get in touch
{formState === "success" && ( <> Thank you for contacting us! We will get back to you in the next two working days. )} {formState !== "success" && ( <> {formState === "submitting" && } Contact us {formState === "error" && ( <> There was an error submitting the form, please try again later. Alternatively, please feel free to email us at{" "} quotations@abcprojectdesign.com . )}
handleSubmit(e, scroll)} data-netlify="true" data-netlify-honeypot="bot-field" > )}
The team
  • Nicholas Day {" "} – Sales and Marketing Manager
  • Daniel Costea {" "} – Project Director
  • Maria Antonia {" "} – Design and Consultation Manager
  • Harry Jackson {" "} – After Sales Manager
07539 051512 01708 938455 quotations@abcprojectdesign.com
); } export const query = graphql` query { headerImage: file(relativePath: { eq: "banner_bathroom.jpg" }) { childImageSharp { fluid(maxWidth: 1920, quality: 90) { ...GatsbyImageSharpFluid_withWebp } } } } `;