Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b6c5b72ad | |||
| afc5e25cfc | |||
| 58fe5eb82c | |||
| 2f3fdc0695 | |||
| 0a465fceb0 | |||
| 5e968db2f5 |
@@ -90,4 +90,5 @@ REACT_APP_SHOW_OFFER_GROUP_JOB=0
|
|||||||
REACT_APP_SHOW_UPLOAD_PROFILE_PICTURE=0
|
REACT_APP_SHOW_UPLOAD_PROFILE_PICTURE=0
|
||||||
|
|
||||||
#GOOGLE RECAPTCHA SITEKEY
|
#GOOGLE RECAPTCHA SITEKEY
|
||||||
REACT_APP_GOOGLE_RECAPTCHA_SITEKEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
|
REACT_APP_GOOGLE_RECAPTCHA_SITEKEY=6Ld_qKooAAAAADNL1TPzRLmcBA8vlpvx__39Rj39
|
||||||
|
#6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
|
||||||
+2
-1
@@ -58,4 +58,5 @@ REACT_APP_SHOW_OFFER_GROUP_JOB=0
|
|||||||
REACT_APP_SHOW_UPLOAD_PROFILE_PICTURE=0
|
REACT_APP_SHOW_UPLOAD_PROFILE_PICTURE=0
|
||||||
|
|
||||||
#GOOGLE RECAPTCHA SITEKEY
|
#GOOGLE RECAPTCHA SITEKEY
|
||||||
REACT_APP_GOOGLE_RECAPTCHA_SITEKEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
|
REACT_APP_GOOGLE_RECAPTCHA_SITEKEY=6Ld_qKooAAAAADNL1TPzRLmcBA8vlpvx__39Rj39
|
||||||
|
#6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
|
||||||
+2
-1
@@ -64,4 +64,5 @@ REACT_APP_SHOW_OFFER_GROUP_JOB=0
|
|||||||
REACT_APP_SHOW_UPLOAD_PROFILE_PICTURE=0
|
REACT_APP_SHOW_UPLOAD_PROFILE_PICTURE=0
|
||||||
|
|
||||||
#GOOGLE RECAPTCHA SITEKEY
|
#GOOGLE RECAPTCHA SITEKEY
|
||||||
REACT_APP_GOOGLE_RECAPTCHA_SITEKEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
|
REACT_APP_GOOGLE_RECAPTCHA_SITEKEY=6Ld_qKooAAAAADNL1TPzRLmcBA8vlpvx__39Rj39
|
||||||
|
#6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const ForgetPwdResponse = ({title, message, type}) => {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => navigate("/login")}
|
onClick={() => navigate("/login")}
|
||||||
className={`rounded-[0.475rem] mb-6 text-[15px] font-semibold text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center py-[0.8875rem] px-[1.81rem]`}
|
className={`h-[48px] rounded-full mb-6 text-[15px] font-semibold text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center py-[0.8875rem] px-[1.81rem]`}
|
||||||
>
|
>
|
||||||
<span>Home</span>
|
<span>Home</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -176,14 +176,14 @@ export default function ForgotPassword() {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => navigate("/login")}
|
onClick={() => navigate("/login")}
|
||||||
className={`rounded-full mb-6 text-[15px] font-semibold text-white hover:text-white flex justify-center bg-red-500 hover:bg-red-600 transition-all duration-300 items-center py-[0.8875rem] px-[1.8125rem] `}
|
className={`h-[48px] rounded-full mb-6 text-[15px] font-semibold text-white hover:text-white flex justify-center bg-red-500 hover:bg-red-600 transition-all duration-300 items-center py-[0.8875rem] px-[1.8125rem] `}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={resetHandler}
|
onClick={resetHandler}
|
||||||
className={`rounded-full mb-6 text-[15px] font-semibold text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center py-[0.8875rem] px-[1.81rem]`}
|
className={`h-[48px] rounded-full mb-6 text-[15px] font-semibold text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center py-[0.8875rem] px-[1.81rem]`}
|
||||||
>
|
>
|
||||||
{resetLoading ? (
|
{resetLoading ? (
|
||||||
<div className="signup btn-loader"></div>
|
<div className="signup btn-loader"></div>
|
||||||
|
|||||||
@@ -14,10 +14,14 @@ import { useGoogleLogin } from "@react-oauth/google";
|
|||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { updateUserDetails } from "../../../store/UserDetails";
|
import { updateUserDetails } from "../../../store/UserDetails";
|
||||||
|
|
||||||
|
import ReCAPTCHA from "react-google-recaptcha";
|
||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { state } = useLocation();
|
const { state } = useLocation();
|
||||||
|
|
||||||
|
const [validCaptcha, setValidCaptcha] = useState({show: false, valid:''}); // FOR CAPTCHA
|
||||||
|
|
||||||
let [loginType, setLoginType] = useState("");
|
let [loginType, setLoginType] = useState("");
|
||||||
|
|
||||||
const [loginLoading, setLoginLoading] = useState(false);
|
const [loginLoading, setLoginLoading] = useState(false);
|
||||||
@@ -107,6 +111,14 @@ export default function Login() {
|
|||||||
}, Number(process.env.REACT_APP_LOGIN_ERROR_TIMEOUT));
|
}, Number(process.env.REACT_APP_LOGIN_ERROR_TIMEOUT));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(name == "full" && !validCaptcha.valid && validCaptcha.show){ // RUNS AND DISPLAYS CAPTCHA, IF ERROR OCCURED DURING LOGIN FOR FULL LOGIN ALONE
|
||||||
|
setMsgError("Please Verify Captcha");
|
||||||
|
setLoginLoading(false);
|
||||||
|
setTimeout(() => {
|
||||||
|
setMsgError("");
|
||||||
|
}, Number(process.env.REACT_APP_LOGIN_ERROR_TIMEOUT));
|
||||||
|
return;
|
||||||
|
}
|
||||||
userApi
|
userApi
|
||||||
.logInUser(postData)
|
.logInUser(postData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -120,6 +132,7 @@ export default function Login() {
|
|||||||
// setMsgError("Wrong, email/password");
|
// setMsgError("Wrong, email/password");
|
||||||
setLoginError(true);
|
setLoginError(true);
|
||||||
setLoginLoading(false);
|
setLoginLoading(false);
|
||||||
|
setValidCaptcha(prev => ({...prev, show:true})) // DISPLAYS CAPTCHA IF ERROR
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
localStorage.setItem("member_id", `${res.data.member_id}`);
|
localStorage.setItem("member_id", `${res.data.member_id}`);
|
||||||
@@ -135,6 +148,7 @@ export default function Login() {
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setMsgError("Unable to login, try again");
|
setMsgError("Unable to login, try again");
|
||||||
setLoginLoading(false);
|
setLoginLoading(false);
|
||||||
|
setValidCaptcha(prev => ({...prev, show:true})) // DISPLAYS CAPTCHA IF ERROR
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -145,6 +159,14 @@ export default function Login() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function captchaChecker(value) { // FUNCTION TO VALIDATE CAPTCHA
|
||||||
|
if(value){
|
||||||
|
setValidCaptcha({show: true, valid:value})
|
||||||
|
}else{
|
||||||
|
setValidCaptcha({show: true, valid:''})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const googleLogin = useGoogleLogin({
|
const googleLogin = useGoogleLogin({
|
||||||
flow: "auth-code",
|
flow: "auth-code",
|
||||||
ux_mode: "redirect",
|
ux_mode: "redirect",
|
||||||
@@ -296,6 +318,17 @@ export default function Login() {
|
|||||||
forgotPassword
|
forgotPassword
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* hCaptha clone for the time being */}
|
||||||
|
{validCaptcha.show &&
|
||||||
|
<div className="mb-5 flex justify-center w-full">
|
||||||
|
<ReCAPTCHA
|
||||||
|
sitekey={process.env.REACT_APP_GOOGLE_RECAPTCHA_SITEKEY}
|
||||||
|
onChange={captchaChecker}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
{loginError && (
|
{loginError && (
|
||||||
<div className="relative p-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-thin leading-[19.5px] text-[13px]">
|
<div className="relative p-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-thin leading-[19.5px] text-[13px]">
|
||||||
Invalid username or password- Please{" "}
|
Invalid username or password- Please{" "}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full md:w-[23%] h-full ">
|
<div className="w-full md:w-[23%] h-full flex flex-col">
|
||||||
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] p-4 rounded-md md:min-h-[498px] flex flex-col justify-between">
|
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] p-4 rounded-md md:min-h-[498px] flex flex-col justify-between">
|
||||||
<div className="w-full flex flex-col justify-center py-4 gap-2">
|
<div className="w-full flex flex-col justify-center py-4 gap-2">
|
||||||
<p className="w-full text-slate-900 tracking-wide my-1">
|
<p className="w-full text-slate-900 tracking-wide my-1">
|
||||||
@@ -270,7 +270,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
className="self-end w-[150px] mt-2 h-[52px] rounded-md text-base bg-transparent border border-red-500 text-red-500 mx-auto"
|
className="self-center w-[150px] mt-2 h-[48px] rounded-full text-base bg-transparent border border-red-500 text-red-500 mx-auto"
|
||||||
name="cancel"
|
name="cancel"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -118,7 +118,11 @@ function PastDueJobAction({jobDetails}) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex justify-center items-center">
|
<div className="flex justify-center items-center">
|
||||||
<button type="button" onClick={popUpHandler} className="w-[180px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={popUpHandler}
|
||||||
|
className="px-4 h-[48px] flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
>
|
||||||
Cancel or Extend Timeline
|
Cancel or Extend Timeline
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -230,8 +234,12 @@ function PastDueJobAction({jobDetails}) {
|
|||||||
|
|
||||||
{/* cancel btn */}
|
{/* cancel btn */}
|
||||||
<div className='flex justify-end items-center'>
|
<div className='flex justify-end items-center'>
|
||||||
<button onClick={popUpHandler} type="button" className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white">
|
<button onClick={popUpHandler} type="button"
|
||||||
<span className='text-gradient'>Cancel</span>
|
// className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white"
|
||||||
|
className='w-[150px] mt-2 h-[48px] rounded-full text-base bg-transparent border border-red-500 text-red-500'
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
{/* <span className='text-gradient'>Cancel</span> */}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user