diff --git a/src/assets/pages/about/index.js b/src/assets/pages/about/index.js index 3bdd58c..cabca31 100644 --- a/src/assets/pages/about/index.js +++ b/src/assets/pages/about/index.js @@ -14,7 +14,7 @@ import AOS from "aos"; import "aos/dist/aos.css"; //Pages -import Error from "../error" +import Error from "../error500"; //Components import Layout from "../../components/layout"; diff --git a/src/assets/pages/contact/index.js b/src/assets/pages/contact/index.js index 6faba08..87568b5 100644 --- a/src/assets/pages/contact/index.js +++ b/src/assets/pages/contact/index.js @@ -6,7 +6,7 @@ import Loading from "../../components/loading"; import Ghost from "../../components/ghost"; //Pages -import Error from "../error"; +import Error from "../error500"; //EmailJs import emailjs from "@emailjs/browser"; @@ -24,6 +24,7 @@ export default function Index() { const [name, setName] = useState(""); const [email, setEmail] = useState(""); const [message, setMessage] = useState(""); + const [focus, setFocus] = useState(false); const send = document.querySelector(".button"); @@ -52,6 +53,7 @@ export default function Index() { (response) => { send.classList.add("success"); console.log("SUCCESS!", response.status, response.text); + alert("Email enviado com sucesso!"); setName(""); setEmail(""); setMessage(""); @@ -70,6 +72,20 @@ export default function Index() { const { contact } = data; + const handleFocus = () => { + if (!focus) { + setFocus(true); + } + }; + + document.addEventListener("click", (e) => { + if (e.target.classList.contains("row")) return; + else { + setFocus(false); + } + } + ); + return ( @@ -89,47 +105,65 @@ export default function Index() { >

- + - - -
-
-
+ + +
+
+
-
+
- + + +
+
+
- -
-
-
setName(e.target.value)} value={name} + onFocus={handleFocus} required - /> + /> setEmail(e.target.value)} value={email} + onFocus={handleFocus} required - /> + />