diff --git a/components/contact/Contact.js b/components/contact/Contact.js index 7907f03..0e208d5 100644 --- a/components/contact/Contact.js +++ b/components/contact/Contact.js @@ -15,6 +15,9 @@ const Contact = () => { const [loading, setLoading] = useState(false) const [done , setDone] = useState(false) const message = "Please Wait..." + const [head ,setHead]= useState("Thanks For Choosing Us") + const [body ,setBody]= useState("We'll reach out Soon") + const [Closing ,setClosing]= useState("Stay Tuned 👍") //email transporter @@ -45,7 +48,11 @@ const getMarketCap = async ()=> { // alert(JSON.stringify(response.data.emails, null, 2)); } catch (error) { setError(true) - alert("Something Went Wrong Please check if data follows rule"); + setLoading(false) + setHead("😢 Oops Something went Wrong") + setBody("Please Try Again") + setClosing("Apologies..") + setDone(true) } } @@ -84,9 +91,9 @@ const getMarketCap = async ()=> { )} {done && ( )}

Contact Us

diff --git a/containers/Footer.jsx b/containers/Footer.jsx index 3204e79..66f837a 100644 --- a/containers/Footer.jsx +++ b/containers/Footer.jsx @@ -8,7 +8,7 @@ import Progress from "@/components/shared/Progress"; export default function FooterContainer() { const [mail,setMail] = useState("") - const [message,setMessage] = useState("") + const [message,setMessage] = useState("an error occured") const [done, setDone] = useState(false) const [loading, setLoading] = useState(false) const handleChange = (e)=>{ @@ -24,6 +24,8 @@ export default function FooterContainer() { setLoading(false) }catch(error){ alert(error) + setDone(true) + setLoading(false) } diff --git a/pages/unsubscribe/[email].js b/pages/unsubscribe/[email].js index 81f456e..2b0f8e7 100644 --- a/pages/unsubscribe/[email].js +++ b/pages/unsubscribe/[email].js @@ -23,6 +23,9 @@ export default function Mail({ mail }) { setLoading(false) }catch(error){ alert(error) + setMessage("Something Went Wrong") + setDone(true) + setLoading(false) } }; const handleClick = async ()=>{ @@ -36,6 +39,9 @@ export default function Mail({ mail }) { setLoading(false) }catch(error){ alert(error) + setMessage("Something Went Wrong") + setDone(true) + setLoading(false) } } return (