From 116917bdb3ae322831414051510f97c1494e1707 Mon Sep 17 00:00:00 2001 From: Chukwumdiebube Date: Sun, 15 Jan 2023 17:16:52 +0100 Subject: [PATCH] Contact page almost complete --- src/assets/css/style.css | 27 +++++++++++++++++++++++++-- src/component/Contact/Main.js | 21 ++++++++++----------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/assets/css/style.css b/src/assets/css/style.css index 9d3062e..5000a57 100644 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -3550,12 +3550,35 @@ header.fix_style.white_header { } .contact_body{ + display: flex; + flex-direction: column; + align-content: center; + justify-content: center; + gap: 10px; font-size: 20px; font-weight: 800; - justify-content: center; text-align: center; } +/* Animations */ +.animate.pop { + animation-name: animate-pop; + animation-timing-function: cubic-bezier(0.26, 0.53, 0.74, 1.48); + animation-duration: 0.5s; +} + +@keyframes animate-pop { + 0% { + opacity: 0; + transform: scale(0.5, 0.5); + } + + 100% { + opacity: 1; + transform: scale(1, 1); + } +} + /* For the err msg */ #errText{ text-align: center; @@ -4667,7 +4690,7 @@ header.fix_style.white_header { height: 100%; border-radius: 100%; border: 3.5px solid transparent; - border-top-color: #3498db; + border-top-color: var(--body-text-purple); } #loader-1:before{ diff --git a/src/component/Contact/Main.js b/src/component/Contact/Main.js index fd1d3ef..d4d1a7e 100644 --- a/src/component/Contact/Main.js +++ b/src/component/Contact/Main.js @@ -54,25 +54,23 @@ const Main = ({ brdcum }) => { let contact_body = document.getElementById("contact_body"); let errText = document.getElementById("errText"); let navigate = useNavigate(); + // Form Validation const [values, setValues] = useState({ name: "", email: "", phone: "", - msg: "", + message: "", country: "", - checkBox: false, }); //initial state values const [countries, setCountries] = useState([]); // initial state for country dropdown const [myData, setMyData] = useState(null); - // Gave a generic name for multiple calls const API_CALL = new SiteService(); // instantiating the class - + // API CALL const allCountry = () => { return API_CALL.countryData(); }; - const contactForm = async (value) => { return await API_CALL.contactData(value); }; @@ -100,14 +98,16 @@ const Main = ({ brdcum }) => { "unable to send your message, please try able"); else { response.innerHTML = `

SEND MESSAGE

`; - - contact_body.innerHTML = `
+ + contact_body.innerHTML = `

We have received your message and will follow up promptly.

`; setTimeout(() => { navigate("/"); }, 10000); + + setValues((prev) => ({ ...prev, [e.target.name]: "" })); } }) .catch((error) => { @@ -121,7 +121,7 @@ const Main = ({ brdcum }) => { }, []); useEffect(() => { - myData; + console.log(myData); }, [myData]); return ( @@ -262,7 +262,6 @@ const Main = ({ brdcum }) => { @@ -281,7 +280,7 @@ const Main = ({ brdcum }) => {
{/* Error Tag */} -

+

{/* Contact Info */} @@ -353,7 +352,7 @@ const Main = ({ brdcum }) => {

-
+
); -- 2.34.1