import React, { useRef, useState } from "react"; import { Button, ContactButton, Grid, Header, Icon, IconWithText, InputField, Interrupt, Label, Layout, Link, Map, Section, Select, Text, } from "@components/index"; import { getGoogleAPIKey } from "../lib/env"; import { CheckCircleSvg, EnvelopeSvg, MobileSvg, TeamSvg } from "../icons"; import bannerImg from "../images/banner_bathroom.jpg"; export default function About({ apikey }) { const formRef = useRef(); const [formState, setFormState] = useState(); const handleSubmit = (e) => { e.preventDefault(); setFormState("submitting"); const body = new FormData(formRef.current); fetch("/contact", { method: "POST", body }) .then((res) => { if (res.status !== 200) { setFormState("error"); } else { setFormState("success"); } }) .catch(() => setFormState("error")); }; return (
Get in touch
Are you planning some work on your house? Are you looking for inspiration? Our team are ready to help you through every step of the journey.
{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" ref={formRef} > )}
} > The Team
Daniel Costea – Project Director 07378839358 quotations@abcprojectdesign.com
); } export async function getStaticProps() { return { props: { apikey: getGoogleAPIKey(), }, }; }