diff --git a/src/Routers.jsx b/src/Routers.jsx index 061a28d..ca6ebcc 100644 --- a/src/Routers.jsx +++ b/src/Routers.jsx @@ -50,7 +50,7 @@ export default function Routers() { element={} /> } /> - } /> + } /> {/* private route */} }> diff --git a/src/components/AuthPages/ForgotPassword/index.jsx b/src/components/AuthPages/ForgotPassword/index.jsx index 589d446..65bdbe7 100644 --- a/src/components/AuthPages/ForgotPassword/index.jsx +++ b/src/components/AuthPages/ForgotPassword/index.jsx @@ -11,6 +11,7 @@ export default function ForgotPassword() { // email const [email, setMail] = useState(""); const [msgError, setMsgError] = useState(''); + const [msgSuccess, setMsgSuccess] = useState(false) const navigate = useNavigate(); const userApi = new usersService(); @@ -20,8 +21,8 @@ export default function ForgotPassword() { }; const humanChecker = () => { - setValue(!checked); - }; + setValue(!checked) + } const resetHandler = async () => { if (email == '') { @@ -30,24 +31,16 @@ export default function ForgotPassword() { setMsgError('Check if you are human') } - if (email != '' && checked) { + if (email !== '' && checked) { const reqData = { email } setResetLoading(true) try { const res = await userApi.StartResetPassword(reqData) if (res.status === 200) { - const { data } = res - if (data.status == -1) { - setMsgError('This is an incorrect or duplicate email') - setResetLoading(false) - } else if (data.status > 0) { - setResetLoading(false) - navigate("/verify-you", { replace: true }) - } else{ - setMsgError("reset was not successful") - setResetLoading(false) - } + setMsgSuccess(true) setMail("") + setValue(false) + setResetLoading(false) } } catch (error) { setResetLoading(false) @@ -79,12 +72,10 @@ export default function ForgotPassword() {
-

+

Forget Password

- Enter your email to reset your password. + Enter your email to reset your password.
@@ -98,7 +89,6 @@ export default function ForgotPassword() { iconName="message" />
- {msgError &&
{msgError}
} {/* hCaptha clone for the time being */}
@@ -108,7 +98,7 @@ export default function ForgotPassword() {
- +
@@ -126,12 +116,15 @@ export default function ForgotPassword() {
+ {msgError &&
{msgError}
} + {msgSuccess &&
If we find your email, you will receive a link to reset your password. Please use or contact form if you did not get our message after few minutes.
} +
diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index 9e2cafc..7d18634 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -99,12 +99,10 @@ export default function Login() {
-

+

Sign In to WrenchBoard

- New Here? Create an Account + New Here? Create an Account
@@ -164,15 +162,14 @@ export default function Login() { Forgot Password
*/} - {loginError &&
Invalid username or password- Please reset your password or create a new account
} - {msgError &&
{msgError}
} + {loginError &&
Invalid username or password- Please reset your password or create a new account
} + {msgError &&
{msgError}
}
*/} -
This site is protected by hCaptcha and the our Privacy Policy and Terms of Service apply.
+
This site is protected by hCaptcha and the our Privacy Policy and Terms of Service apply.
@@ -215,8 +212,8 @@ const BrandBtn = ({ className="w-full border border-light-purple dark:border-[#5356fb29] rounded-[0.475rem] h-[48px] flex justify-center bg-[#FAFAFA] hover:bg-[#eff2f5] hover:text-[#7e8299] transition duration-300 dark:bg-[#11131F] items-center font-medium cursor-pointer" > logo-icon(s) - - Sign In with {brand} + + Continue with {brand}
diff --git a/src/components/AuthPages/SignUp/index.jsx b/src/components/AuthPages/SignUp/index.jsx index 549a501..2b2069e 100644 --- a/src/components/AuthPages/SignUp/index.jsx +++ b/src/components/AuthPages/SignUp/index.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import React, { useCallback, useEffect, useState } from "react"; import { useNavigate, Link } from "react-router-dom"; import facebookLogo from "../../../assets/images/facebook-4.svg"; import WrenchBoard from "../../../assets/images/wrenchboard.png"; @@ -39,20 +39,22 @@ export default function SignUp() { const userApi = new usersService(); // Get Country Api - const getCountryList = async () => { - const res = await userApi.getSignupCountryData() - - try { - if (res.status === 200) { - const { signup_country } = await res.data - setCountries(signup_country) - } else if (res.data.result !== 100) { - setCountries('Nothing see here!') + const getCountryList = useCallback( + async () => { + const res = await userApi.getSignupCountryData() + + try { + if (res.status === 200) { + const { signup_country } = await res.data + setCountries(signup_country) + } else if (res.data.result !== 100) { + setCountries('Nothing see here!') + } + } catch (error) { + throw new Error(error) } - } catch (error) { - throw new Error(error) - } - } + }, [] + ) const handleSignUp = async () => { let { country, first_name, last_name, email, password } = formData @@ -85,13 +87,14 @@ export default function SignUp() { } if (data && data.status === '1') { setTimeout(() => { - navigate("/verify-you", { replace: true }); setSignUpLoading(false) + navigate("/outmessage", { replace: true }); }, 2000) - } else { - setSignUpLoading(false) - setMsgError('This account does not exist') - } + } + // else { + // setSignUpLoading(false) + // setMsgError('This account does not exist') + // } } else { setSignUpLoading(false) setMsgError('An error occurred') @@ -132,16 +135,14 @@ export default function SignUp() {
-

+

Create Account

- Already have an account? Sign in here + Already have an account? Sign in here
I agree with all - terms and condition - +
@@ -245,8 +246,7 @@ export default function SignUp() { diff --git a/src/components/AuthPages/VerifyYou/index.jsx b/src/components/AuthPages/VerifyYou/index.jsx index 5cf2fee..c8d8831 100644 --- a/src/components/AuthPages/VerifyYou/index.jsx +++ b/src/components/AuthPages/VerifyYou/index.jsx @@ -1,31 +1,49 @@ +import { useNavigate, Link } from "react-router-dom"; import AuthLayout from "../AuthLayout"; +import WrenchBoard from "../../../assets/images/wrenchboard.png" export default function VerifyYou() { + const navigate = useNavigate() return ( <> -
-
-
-

- Verification Sent -

+
+
+ + wrenchboard + +
+
+
+
+

+ Let's verify your email now +

+ Check your email. +
+
+
+

+ Verify Email. Help us secure your WrenchBoard account by verifying your email registration address. Verification will let you access all of WrenchBoard's features. +

+
+
+

+ If you do not receive the confirmation message within a few minutes of signing up, please check your Junk E-mail folder just in case the confirmation email got delivered there instead of your inbox. If so, select the confirmation message and click Not Junk, which will allow future messages to get through. +

+
+
+
+
-
-
-

- To complete the verification process, you should check your email inbox and look for the verification email. It may take a few minutes for the email to arrive, so be patient. Once you receive the email, open it and click on the verification link provided. -

-
-
-

- If you haven't received the verification email after a reasonable amount of time, make sure to check your spam or junk mail folder. It's also possible that the email was sent to the wrong email address, so double-check that you entered your email address correctly. -

-
diff --git a/src/components/Helpers/Inputs/InputCom/index.jsx b/src/components/Helpers/Inputs/InputCom/index.jsx index 707d0cc..5382c53 100644 --- a/src/components/Helpers/Inputs/InputCom/index.jsx +++ b/src/components/Helpers/Inputs/InputCom/index.jsx @@ -68,20 +68,20 @@ export default function InputCom({
{label && ( )} - {forgotPassword && Forgot Password?} + {forgotPassword && Forgot Password?}