Compare commits

..

7 Commits

Author SHA1 Message Date
victorAnumudu eae8dc43ec clears expire session value after 5secs 2023-12-18 13:40:36 +01:00
ameye 34e6322126 Merge branch 'signup-country' of WrenchBoard/Users-Wrench into master 2023-12-18 08:59:28 +00:00
victorAnumudu b3db82000b result_list array as list of countries 2023-12-18 09:53:42 +01:00
CHIEFSOFT\ameye fa565437f0 download links 2023-12-12 15:49:22 -05:00
ameye 59f407ba26 Merge branch 'edit_job' of WrenchBoard/Users-Wrench into master 2023-12-12 12:41:02 +00:00
ameye e7afc12334 Merge branch 'Server-path-added' of WrenchBoard/Users-Wrench into master 2023-12-12 12:40:54 +00:00
victorAnumudu 5f81c0b847 edit job categpry text color for dark mode added 2023-12-12 06:03:03 +01:00
14 changed files with 50 additions and 36 deletions
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

+17 -1
View File
@@ -19,11 +19,13 @@ import ReCAPTCHA from "react-google-recaptcha";
export default function Login() {
// eslint-disable-next-line no-restricted-globals
const queryParams = new URLSearchParams(location?.search);
const sessionExpired = queryParams.get("sessionExpired");
// const sessionExpired = queryParams.get("sessionExpired");
const dispatch = useDispatch();
const { state } = useLocation();
const [sessionExpired, setSessionExpired] = useState(queryParams.get("sessionExpired"))
const [validCaptcha, setValidCaptcha] = useState({ show: false, valid: "" }); // FOR CAPTCHA
let [loginType, setLoginType] = useState("");
@@ -235,6 +237,20 @@ export default function Login() {
setPassword("");
}, [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 (
<>
<AuthLayout slogan="Welcome to WrenchBoard">
+13 -14
View File
@@ -47,21 +47,20 @@ export default function SignUp() {
// Get Country Api
const getCountryList = useCallback(async () => {
const res = await userApi.getSignupCountryData();
try {
if (res.status === 200) {
const { signup_country } = await res.data;
// setCountries(signup_country);
const res = await userApi.getSignupCountryData();
if (res.status === 200 && res.data.internal_return >= 0) {
const { result_list } = await res.data;
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
setFormData(prev => ({...prev, country: ''}))
return setCountries({loading: false, data: signup_country});
return setCountries({loading: false, data: result_list});
}
return setCountries({loading: false, data: cnt});
}
setCountries({loading: false, data:signup_country});
setCountries({loading: false, data:result_list});
} else if (res.data.result !== 100) {
setCountries({loading: false, data:[]});
}
@@ -375,17 +374,17 @@ const SelectOption = ({
{data?.data?.length > 1 ?
<>
<option value={""}>Select your Country</option>
{data?.data?.map((item, idx) => (
<option value={item[0]} key={idx}>
{item[1]}
{data?.data?.map((item) => (
<option value={item.code} key={item.uid}>
{item.country}
</option>
))}
</>
:
data?.data?.length == 1 ?
data?.data?.map((item, idx) => (
<option value={item[0]} key={idx}>
{item[1]}
data?.data?.map((item) => (
<option value={item.code} key={item.uid}>
{item.country}
</option>
))
:
+8 -8
View File
@@ -42,16 +42,16 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
// Get Country Api
const getCountryList = useCallback(async () => {
const res = await userApi.getSignupCountryData();
try {
if (res.status === 200) {
const res = await userApi.getSignupCountryData();
if (res.status === 200 && res.data.internal_return >= 0) {
const {
data: { signup_country },
data: { result_list },
} = await res;
let checkCountry = signup_country
?.filter((item) => item[0] == country)
?.map((item, idx) => item[1])
let checkCountry = result_list
?.filter((item) => item.code == country)
?.map((item) => item.country)
.join("");
setCountries(checkCountry);
}
@@ -59,7 +59,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
throw new Error(error);
}
}, [userApi, country]);
console.log('MY COUNTRY', myCountry)
useEffect(() => {
getCountryList();
}, [getCountryList]);
@@ -25,7 +25,7 @@ function NairaWithdraw({
},
newAccount: {
country: wallet.walletCountry
? wallet.walletCountry[0][0]
? wallet.walletCountry[0]?.code
: wallet.country,
bank: state?.newAccount?.amount || "",
accountNumber: state?.newAccount?.amount || "",
@@ -34,7 +34,6 @@ function NairaWithdraw({
city: state?.newAccount?.amount || "",
},
};
const [errorMsgs, setErrorMsgs] = useState(initialValues);
let [sendMoneyFee, setSendMoneyFee] = useState({
@@ -69,7 +68,7 @@ function NairaWithdraw({
// Handling card change
const handleBankOptions = (event) => {
let bankCountry = wallet.walletCountry
? wallet.walletCountry[0][0]
? wallet.walletCountry[0]?.code
: wallet.country
setBankName((prev) => ({ loading: true, data: [] }));
apiCall
@@ -120,7 +119,7 @@ function NairaWithdraw({
}
setAllCountries((prev) => ({
loading: false,
data: res.data.signup_country,
data: res.data.result_list,
}));
})
.catch((error) => {
@@ -287,7 +286,7 @@ function NairaWithdraw({
getRecipients();
}, []);
console.log("Testing Wallet Country", wallet?.walletCountry[0][0]);
console.log("Testing Wallet Country", wallet?.walletCountry[0]?.code);
return (
<ModalCom action={action} situation={situation} className="edit-popup">
@@ -560,7 +559,7 @@ function NairaWithdraw({
</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">
<span className="text-slate-500 text-lg italic">
{wallet.walletCountry[0][1]}
{wallet.walletCountry[0]?.country}
</span>
</div>
{/* <select
+2 -2
View File
@@ -41,13 +41,13 @@ const WalletRoutes = () => {
apiCall
.getSignupCountryData()
.then((res) => {
if (res.data.internal_return < 0) {
if (res?.data?.internal_return < 0) {
setAllCountries((prev) => ({ loading: false, data: [] }));
return;
}
setAllCountries((prev) => ({
loading: false,
data: res.data.signup_country,
data: res.data.result_list,
}));
})
.catch((error) => {
+2 -2
View File
@@ -35,8 +35,8 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
};
const currentWalletCurrency = countries
.map((country) => country)
.filter((country) => country[0] === walletItem.country);
// .map((country) => country)
.filter((country) => country.code === walletItem.country);
const image = walletItem.code
? `${walletItem.code.toLowerCase()}.svg`
@@ -35,8 +35,8 @@ export default function WalletItemCardFamily({ walletItem, payment, countries })
};
const currentWalletCurrency = countries
.map((country) => country)
.filter((country) => country[0] === walletItem.country);
// .map((country) => country)
.filter((country) => country.code === walletItem.country);
const image = walletItem.code
? `${walletItem.code.toLowerCase()}.svg`
+1 -1
View File
@@ -371,7 +371,7 @@ const EditJobPopOut = ({
Object.entries(categories)?.map(([key, value]) => (
<label
key={key}
className="flex gap-1 w-full items-center"
className="flex gap-1 w-full items-center dark:text-white"
>
<Field
type="checkbox"