From 401836381bd6a1dea2871f2e3b8d3edc4604fe30 Mon Sep 17 00:00:00 2001 From: BRAVO68WEB Date: Sun, 19 Jun 2022 17:08:42 +0530 Subject: [PATCH] Fixes Contact Page API route and minor bug fixes --- components/contact.js | 7 +++++-- pages/_app.js | 9 +++++++-- pages/index.js | 2 -- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/components/contact.js b/components/contact.js index 9452589..1fbdbf1 100644 --- a/components/contact.js +++ b/components/contact.js @@ -1,5 +1,6 @@ import React from "react"; import { ContactStyle } from "./contact.style"; +import axios from "handlers/axios"; function Contact() { const [input, setInput] = React.useState({ @@ -8,6 +9,7 @@ function Contact() { message: "", topic: "", }); + const [isSubmitted, setIsSubmitted] = React.useState("Sent"); function changeInput(evt) { const { name, value } = evt.target; setInput({ @@ -17,7 +19,8 @@ function Contact() { } function submitForm(evt) { evt.preventDefault(); - console.log(input); + axios.post("/contactme/postQuery", input); + setIsSubmitted("Done"); } return ( @@ -116,7 +119,7 @@ function Contact() { /> diff --git a/pages/_app.js b/pages/_app.js index 83c1adc..4badbca 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -1,8 +1,13 @@ import "../styles/globals.css"; -// import { loadCursor } from "../components/providers/cursor"; +import CustomCursor from "components/providers/cursor"; function MyPortfolio({ Component, pageProps }) { - return ; + return ( + <> + + + + ) } export default MyPortfolio; diff --git a/pages/index.js b/pages/index.js index 8afe47c..e76672a 100644 --- a/pages/index.js +++ b/pages/index.js @@ -2,7 +2,6 @@ import Head from "next/head"; import Nav from "components/nav"; import Main from "components/main"; import BMC from "components/buymeacoffee"; -import CustomCursor from "components/providers/cursor"; export default function Home() { return ( @@ -34,7 +33,6 @@ export default function Home() { rel="stylesheet" /> -