Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eae8dc43ec | |||
| 34e6322126 | |||
| b3db82000b | |||
| fa565437f0 | |||
| 59f407ba26 | |||
| e7afc12334 | |||
| 5f81c0b847 |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -19,11 +19,13 @@ import ReCAPTCHA from "react-google-recaptcha";
|
|||||||
export default function Login() {
|
export default function Login() {
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const sessionExpired = queryParams.get("sessionExpired");
|
// const sessionExpired = queryParams.get("sessionExpired");
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { state } = useLocation();
|
const { state } = useLocation();
|
||||||
|
|
||||||
|
const [sessionExpired, setSessionExpired] = useState(queryParams.get("sessionExpired"))
|
||||||
|
|
||||||
const [validCaptcha, setValidCaptcha] = useState({ show: false, valid: "" }); // FOR CAPTCHA
|
const [validCaptcha, setValidCaptcha] = useState({ show: false, valid: "" }); // FOR CAPTCHA
|
||||||
|
|
||||||
let [loginType, setLoginType] = useState("");
|
let [loginType, setLoginType] = useState("");
|
||||||
@@ -235,6 +237,20 @@ export default function Login() {
|
|||||||
setPassword("");
|
setPassword("");
|
||||||
}, [loginType]);
|
}, [loginType]);
|
||||||
|
|
||||||
|
|
||||||
|
// EFFECT TO CLEAR SESSION EXPIRY IF IT EXISTS AFTER SOME SECONDS
|
||||||
|
useEffect(()=>{
|
||||||
|
let timer;
|
||||||
|
if(sessionExpired == "true"){
|
||||||
|
timer = setTimeout(()=>{
|
||||||
|
setSessionExpired(false)
|
||||||
|
},5000)
|
||||||
|
}
|
||||||
|
return () => {
|
||||||
|
clearTimeout(timer)
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AuthLayout slogan="Welcome to WrenchBoard">
|
<AuthLayout slogan="Welcome to WrenchBoard">
|
||||||
|
|||||||
@@ -47,21 +47,20 @@ export default function SignUp() {
|
|||||||
|
|
||||||
// Get Country Api
|
// Get Country Api
|
||||||
const getCountryList = useCallback(async () => {
|
const getCountryList = useCallback(async () => {
|
||||||
const res = await userApi.getSignupCountryData();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (res.status === 200) {
|
const res = await userApi.getSignupCountryData();
|
||||||
const { signup_country } = await res.data;
|
if (res.status === 200 && res.data.internal_return >= 0) {
|
||||||
// setCountries(signup_country);
|
const { result_list } = await res.data;
|
||||||
if(country){ // IF LINK/PATHNAME HAS CNT QUERY VALUE
|
if(country){ // IF LINK/PATHNAME HAS CNT QUERY VALUE
|
||||||
let cnt = signup_country.filter(item => item[0]==country) // test to see country passed in query param exist from list of countries supplied by API
|
let cnt = result_list.filter(item => item.code == country) // test to see country passed in query param exist from list of countries supplied by API
|
||||||
if(!cnt.length){ // IF CNT EMPTY, SET FORMDATA COUNTRY BACK TO EMPTY STRING: RE: THIS IS BCOS WE INITAIL SET COUNTRY VALUE IN FORMDATA, IF COUNTRY PARAM IS PRESENT IN LINK
|
if(!cnt.length){ // IF CNT EMPTY, SET FORMDATA COUNTRY BACK TO EMPTY STRING: RE: THIS IS BCOS WE INITAIL SET COUNTRY VALUE IN FORMDATA, IF COUNTRY PARAM IS PRESENT IN LINK
|
||||||
setFormData(prev => ({...prev, country: ''}))
|
setFormData(prev => ({...prev, country: ''}))
|
||||||
return setCountries({loading: false, data: signup_country});
|
return setCountries({loading: false, data: result_list});
|
||||||
}
|
}
|
||||||
return setCountries({loading: false, data: cnt});
|
return setCountries({loading: false, data: cnt});
|
||||||
}
|
}
|
||||||
setCountries({loading: false, data:signup_country});
|
setCountries({loading: false, data:result_list});
|
||||||
} else if (res.data.result !== 100) {
|
} else if (res.data.result !== 100) {
|
||||||
setCountries({loading: false, data:[]});
|
setCountries({loading: false, data:[]});
|
||||||
}
|
}
|
||||||
@@ -375,17 +374,17 @@ const SelectOption = ({
|
|||||||
{data?.data?.length > 1 ?
|
{data?.data?.length > 1 ?
|
||||||
<>
|
<>
|
||||||
<option value={""}>Select your Country</option>
|
<option value={""}>Select your Country</option>
|
||||||
{data?.data?.map((item, idx) => (
|
{data?.data?.map((item) => (
|
||||||
<option value={item[0]} key={idx}>
|
<option value={item.code} key={item.uid}>
|
||||||
{item[1]}
|
{item.country}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
:
|
:
|
||||||
data?.data?.length == 1 ?
|
data?.data?.length == 1 ?
|
||||||
data?.data?.map((item, idx) => (
|
data?.data?.map((item) => (
|
||||||
<option value={item[0]} key={idx}>
|
<option value={item.code} key={item.uid}>
|
||||||
{item[1]}
|
{item.country}
|
||||||
</option>
|
</option>
|
||||||
))
|
))
|
||||||
:
|
:
|
||||||
|
|||||||
@@ -42,16 +42,16 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
|
|
||||||
// Get Country Api
|
// Get Country Api
|
||||||
const getCountryList = useCallback(async () => {
|
const getCountryList = useCallback(async () => {
|
||||||
const res = await userApi.getSignupCountryData();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (res.status === 200) {
|
const res = await userApi.getSignupCountryData();
|
||||||
|
if (res.status === 200 && res.data.internal_return >= 0) {
|
||||||
const {
|
const {
|
||||||
data: { signup_country },
|
data: { result_list },
|
||||||
} = await res;
|
} = await res;
|
||||||
let checkCountry = signup_country
|
let checkCountry = result_list
|
||||||
?.filter((item) => item[0] == country)
|
?.filter((item) => item.code == country)
|
||||||
?.map((item, idx) => item[1])
|
?.map((item) => item.country)
|
||||||
.join("");
|
.join("");
|
||||||
setCountries(checkCountry);
|
setCountries(checkCountry);
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
}, [userApi, country]);
|
}, [userApi, country]);
|
||||||
|
console.log('MY COUNTRY', myCountry)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getCountryList();
|
getCountryList();
|
||||||
}, [getCountryList]);
|
}, [getCountryList]);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function NairaWithdraw({
|
|||||||
},
|
},
|
||||||
newAccount: {
|
newAccount: {
|
||||||
country: wallet.walletCountry
|
country: wallet.walletCountry
|
||||||
? wallet.walletCountry[0][0]
|
? wallet.walletCountry[0]?.code
|
||||||
: wallet.country,
|
: wallet.country,
|
||||||
bank: state?.newAccount?.amount || "",
|
bank: state?.newAccount?.amount || "",
|
||||||
accountNumber: state?.newAccount?.amount || "",
|
accountNumber: state?.newAccount?.amount || "",
|
||||||
@@ -34,7 +34,6 @@ function NairaWithdraw({
|
|||||||
city: state?.newAccount?.amount || "",
|
city: state?.newAccount?.amount || "",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const [errorMsgs, setErrorMsgs] = useState(initialValues);
|
const [errorMsgs, setErrorMsgs] = useState(initialValues);
|
||||||
|
|
||||||
let [sendMoneyFee, setSendMoneyFee] = useState({
|
let [sendMoneyFee, setSendMoneyFee] = useState({
|
||||||
@@ -69,7 +68,7 @@ function NairaWithdraw({
|
|||||||
// Handling card change
|
// Handling card change
|
||||||
const handleBankOptions = (event) => {
|
const handleBankOptions = (event) => {
|
||||||
let bankCountry = wallet.walletCountry
|
let bankCountry = wallet.walletCountry
|
||||||
? wallet.walletCountry[0][0]
|
? wallet.walletCountry[0]?.code
|
||||||
: wallet.country
|
: wallet.country
|
||||||
setBankName((prev) => ({ loading: true, data: [] }));
|
setBankName((prev) => ({ loading: true, data: [] }));
|
||||||
apiCall
|
apiCall
|
||||||
@@ -120,7 +119,7 @@ function NairaWithdraw({
|
|||||||
}
|
}
|
||||||
setAllCountries((prev) => ({
|
setAllCountries((prev) => ({
|
||||||
loading: false,
|
loading: false,
|
||||||
data: res.data.signup_country,
|
data: res.data.result_list,
|
||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -287,7 +286,7 @@ function NairaWithdraw({
|
|||||||
getRecipients();
|
getRecipients();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
console.log("Testing Wallet Country", wallet?.walletCountry[0][0]);
|
console.log("Testing Wallet Country", wallet?.walletCountry[0]?.code);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalCom action={action} situation={situation} className="edit-popup">
|
<ModalCom action={action} situation={situation} className="edit-popup">
|
||||||
@@ -560,7 +559,7 @@ function NairaWithdraw({
|
|||||||
</label>
|
</label>
|
||||||
<div className="w-full text-base p-2 text-dark-gray dark:text-white border border-slate-300 outline-0 flex-[0.6] rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding tracking-[1.5px] flex items-center pointer-events-none">
|
<div className="w-full text-base p-2 text-dark-gray dark:text-white border border-slate-300 outline-0 flex-[0.6] rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding tracking-[1.5px] flex items-center pointer-events-none">
|
||||||
<span className="text-slate-500 text-lg italic">
|
<span className="text-slate-500 text-lg italic">
|
||||||
{wallet.walletCountry[0][1]}
|
{wallet.walletCountry[0]?.country}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{/* <select
|
{/* <select
|
||||||
|
|||||||
@@ -41,13 +41,13 @@ const WalletRoutes = () => {
|
|||||||
apiCall
|
apiCall
|
||||||
.getSignupCountryData()
|
.getSignupCountryData()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.internal_return < 0) {
|
if (res?.data?.internal_return < 0) {
|
||||||
setAllCountries((prev) => ({ loading: false, data: [] }));
|
setAllCountries((prev) => ({ loading: false, data: [] }));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setAllCountries((prev) => ({
|
setAllCountries((prev) => ({
|
||||||
loading: false,
|
loading: false,
|
||||||
data: res.data.signup_country,
|
data: res.data.result_list,
|
||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const currentWalletCurrency = countries
|
const currentWalletCurrency = countries
|
||||||
.map((country) => country)
|
// .map((country) => country)
|
||||||
.filter((country) => country[0] === walletItem.country);
|
.filter((country) => country.code === walletItem.country);
|
||||||
|
|
||||||
const image = walletItem.code
|
const image = walletItem.code
|
||||||
? `${walletItem.code.toLowerCase()}.svg`
|
? `${walletItem.code.toLowerCase()}.svg`
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ export default function WalletItemCardFamily({ walletItem, payment, countries })
|
|||||||
};
|
};
|
||||||
|
|
||||||
const currentWalletCurrency = countries
|
const currentWalletCurrency = countries
|
||||||
.map((country) => country)
|
// .map((country) => country)
|
||||||
.filter((country) => country[0] === walletItem.country);
|
.filter((country) => country.code === walletItem.country);
|
||||||
|
|
||||||
const image = walletItem.code
|
const image = walletItem.code
|
||||||
? `${walletItem.code.toLowerCase()}.svg`
|
? `${walletItem.code.toLowerCase()}.svg`
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ const EditJobPopOut = ({
|
|||||||
Object.entries(categories)?.map(([key, value]) => (
|
Object.entries(categories)?.map(([key, value]) => (
|
||||||
<label
|
<label
|
||||||
key={key}
|
key={key}
|
||||||
className="flex gap-1 w-full items-center"
|
className="flex gap-1 w-full items-center dark:text-white"
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
|
|||||||
Reference in New Issue
Block a user