Fixes Contact Page API route and minor bug fixes
This commit is contained in:
parent
9901514623
commit
401836381b
|
@ -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 (
|
||||
<ContactStyle>
|
||||
|
@ -116,7 +119,7 @@ function Contact() {
|
|||
/>
|
||||
</div>
|
||||
<button type="submit" className="btn btn-primary">
|
||||
Submit
|
||||
{isSubmitted}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -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 <Component {...pageProps} />;
|
||||
return (
|
||||
<>
|
||||
<CustomCursor />
|
||||
<Component {...pageProps} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default MyPortfolio;
|
||||
|
|
|
@ -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"
|
||||
/>
|
||||
</Head>
|
||||
<CustomCursor />
|
||||
<Nav />
|
||||
<Main />
|
||||
<BMC />
|
||||
|
|
Loading…
Reference in New Issue