import React, { useState } from "react"; import { graphql } from "gatsby"; import { Marker } from "google-maps-react"; import Layout from "../layout"; import { Button, Grid, Header, Heading, Icon, IconWithContent, InputText, Interrupt, Label, Link, Map, Section, Select, Team, Text } from "../components"; import CheckCircleIcon from "../icons/check-circle.svg"; import EnvelopeIcon from "../icons/envelope.svg"; import TeamIcon 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 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 }); 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 a new bathroom? Are you looking for inspiration? Our team are ready to help you through every step of the journey. A typical bathroom refurbishment starts from £3,500, increasing up to £20,000. Our quotes include stripping out the old bathroom, disposal of rubbish, fitting the new bathroom, labour and building materials for tiling, plastering, painting and decorating. It does not include bathroom suites or tiles.
{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
); } export const query = graphql` query { headerImage: file(relativePath: { eq: "banner_bathroom.jpg" }) { childImageSharp { fluid(maxWidth: 1920, quality: 90) { ...GatsbyImageSharpFluid_withWebp } } } allPerson { nodes { name email phone altPhone title } } } `;