Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| addede388e | |||
| 6337c82374 | |||
| a970411719 | |||
| 10967acf9e | |||
| fb6831d44f | |||
| 7dcae39320 | |||
| a0ba60a2bc | |||
| f377326b48 | |||
| feb8bd718d | |||
| a2a2dbfc24 | |||
| 1c0cb6c97f | |||
| 41c9c60fd1 | |||
| ba5646fe2c | |||
| 1f9ab45206 | |||
| 0ffa1123d2 | |||
| 9420a201e4 | |||
| 1b7ea7321e | |||
| 7fa74d6fd3 |
@@ -24,7 +24,6 @@ REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||
REACT_APP_SIGNUP_ERROR_TIMEOUT=7000
|
||||
|
||||
REACT_APP_FLUTTERWAVE_APIKEY=FLWPUBK_TEST-54c90141b028789d671067bd72f781a9-X
|
||||
|
||||
# Had to change the error time to 3sec cause it took too long
|
||||
REACT_APP_RESET_START_ERROR_TIMEOUT=3000
|
||||
|
||||
@@ -24,7 +24,6 @@ REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||
REACT_APP_SIGNUP_ERROR_TIMEOUT=7000
|
||||
|
||||
REACT_APP_FLUTTERWAVE_APIKEY=FLWPUBK_TEST-54c90141b028789d671067bd72f781a9-X
|
||||
|
||||
# Had to change the error time to 3sec cause it took too long
|
||||
REACT_APP_RESET_START_ERROR_TIMEOUT=3000
|
||||
|
||||
@@ -24,7 +24,6 @@ REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||
REACT_APP_SIGNUP_ERROR_TIMEOUT=7000
|
||||
|
||||
REACT_APP_FLUTTERWAVE_APIKEY=FLWPUBK_TEST-54c90141b028789d671067bd72f781a9-X
|
||||
|
||||
# Had to change the error time to 3sec cause it took too long
|
||||
REACT_APP_RESET_START_ERROR_TIMEOUT=3000
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Field, Form, Formik } from "formik";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import * as Yup from "yup";
|
||||
import usersService from "../../services/UsersService";
|
||||
import { tableReload } from "../../store/TableReloads";
|
||||
@@ -43,7 +43,7 @@ const validationSchema = Yup.object().shape({
|
||||
|
||||
function AddJob({ popUpHandler, categories }) {
|
||||
const ApiCall = new usersService();
|
||||
|
||||
const { walletDetails } = useSelector((state) => state.walletDetails);
|
||||
let dispatch = useDispatch();
|
||||
|
||||
let [currency, setCurrency] = useState({
|
||||
@@ -90,9 +90,15 @@ function AddJob({ popUpHandler, categories }) {
|
||||
});
|
||||
};
|
||||
|
||||
// FUNCTION TO HANDLE ADD JOB FORM
|
||||
const handleAddJob = (values, helpers) => {
|
||||
let reqData = {
|
||||
const getWalletDetail = (country) => {
|
||||
const walletChecker = walletDetails.result_list.find(
|
||||
(item) => item.country === country
|
||||
);
|
||||
return walletChecker ? walletChecker.amount : 0;
|
||||
};
|
||||
|
||||
const handleAddJob = async (values, helpers) => {
|
||||
const reqData = {
|
||||
country: values?.country,
|
||||
price: Number(values.price) * 100,
|
||||
title: values?.title,
|
||||
@@ -102,20 +108,34 @@ function AddJob({ popUpHandler, categories }) {
|
||||
category: values.category?.join("@"),
|
||||
};
|
||||
|
||||
const walletAmount = getWalletDetail(reqData.country);
|
||||
if (reqData.price > walletAmount) {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: "Insufficient Balance",
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
setRequestStatus({ loading: false, status: false, message: "" });
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
|
||||
setRequestStatus({ loading: true, status: false, message: "" });
|
||||
ApiCall.jobManagerCreateJob(reqData)
|
||||
.then((res) => {
|
||||
if (res.data.internal_return < 1) {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: "Could not complete your request at the moment",
|
||||
});
|
||||
setTimeout(() => {
|
||||
popUpHandler();
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await ApiCall.jobManagerCreateJob(reqData);
|
||||
if (res.data.internal_return < 1) {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: "Could not complete your request at the moment",
|
||||
});
|
||||
setTimeout(() => {
|
||||
popUpHandler();
|
||||
}, 1500);
|
||||
} else {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: true,
|
||||
@@ -125,19 +145,18 @@ function AddJob({ popUpHandler, categories }) {
|
||||
dispatch(tableReload({ type: "JOBTABLE" }));
|
||||
popUpHandler();
|
||||
}, 1000);
|
||||
})
|
||||
.catch((err) => {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: "Opps! something went wrong. Try Again",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
setRequestStatus({ loading: false, status: false, message: "" });
|
||||
}, 5000);
|
||||
}
|
||||
} catch (err) {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: "Oops! Something went wrong. Try Again",
|
||||
});
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
setRequestStatus({ loading: false, status: false, message: "" });
|
||||
}, 5000);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -164,7 +183,11 @@ function AddJob({ popUpHandler, categories }) {
|
||||
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex item-center gap-1"
|
||||
>
|
||||
Currency
|
||||
{props.errors.country && props.touched.country && <span className="text-[12px] text-red-500">{props.errors.country}</span>}
|
||||
{props.errors.country && props.touched.country && (
|
||||
<span className="text-[12px] text-red-500">
|
||||
{props.errors.country}
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
<select
|
||||
id="country"
|
||||
@@ -214,7 +237,11 @@ function AddJob({ popUpHandler, categories }) {
|
||||
value={props.values.price}
|
||||
inputHandler={props.handleChange}
|
||||
blurHandler={props.handleBlur}
|
||||
error={props.errors.price && props.touched.price && props.errors.price}
|
||||
error={
|
||||
props.errors.price &&
|
||||
props.touched.price &&
|
||||
props.errors.price
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -231,7 +258,11 @@ function AddJob({ popUpHandler, categories }) {
|
||||
value={props.values.title}
|
||||
inputHandler={props.handleChange}
|
||||
blurHandler={props.handleBlur}
|
||||
error={props.errors.title && props.touched.title && props.errors.title}
|
||||
error={
|
||||
props.errors.title &&
|
||||
props.touched.title &&
|
||||
props.errors.title
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -247,7 +278,11 @@ function AddJob({ popUpHandler, categories }) {
|
||||
value={props.values.description}
|
||||
inputHandler={props.handleChange}
|
||||
blurHandler={props.handleBlur}
|
||||
error={props.errors.description && props.touched.description && props.errors.description}
|
||||
error={
|
||||
props.errors.description &&
|
||||
props.touched.description &&
|
||||
props.errors.description
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -259,7 +294,12 @@ function AddJob({ popUpHandler, categories }) {
|
||||
className='className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold flex items-center gap-1'
|
||||
>
|
||||
Job Delivery Details
|
||||
{props.errors.job_detail && props.touched.job_detail && <span className="text-[12px] text-red-500">{props.errors.job_detail}</span>}
|
||||
{props.errors.job_detail &&
|
||||
props.touched.job_detail && (
|
||||
<span className="text-[12px] text-red-500">
|
||||
{props.errors.job_detail}
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
<textarea
|
||||
id="Job Delivery Details"
|
||||
@@ -286,19 +326,28 @@ function AddJob({ popUpHandler, categories }) {
|
||||
role="group"
|
||||
aria-labelledby="checked-group"
|
||||
>
|
||||
{Object?.entries(categories).map(([key, value]) => (
|
||||
<label
|
||||
key={key}
|
||||
className="flex gap-1 w-full items-center"
|
||||
>
|
||||
<Field
|
||||
type="checkbox"
|
||||
name="category"
|
||||
value={key}
|
||||
/>
|
||||
<span className="text-[13.975px]">{value}</span>
|
||||
{categories ? (
|
||||
<>
|
||||
{Object?.entries(categories).map(([key, value]) => (
|
||||
<label
|
||||
key={key}
|
||||
className="flex gap-1 w-full items-center"
|
||||
>
|
||||
<Field
|
||||
type="checkbox"
|
||||
name="category"
|
||||
value={key}
|
||||
/>
|
||||
<span className="text-[13.975px]">{value}</span>
|
||||
</label>
|
||||
))}
|
||||
</>
|
||||
) : (
|
||||
<label className="flex gap-1 w-full items-center">
|
||||
<Field type="checkbox" name="category" />
|
||||
<span className="text-[13.975px]">null</span>
|
||||
</label>
|
||||
))}
|
||||
)}
|
||||
<span className="h-5 text-sm italic text-[#cf3917]">
|
||||
{props.errors.category &&
|
||||
props.touched.category &&
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import usersService from '../../../services/UsersService';
|
||||
import {updateUserDetails} from "../../../store/UserDetails";
|
||||
import React, { useEffect } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import usersService from "../../../services/UsersService";
|
||||
import { updateUserDetails } from "../../../store/UserDetails";
|
||||
import AuthLayout from "../AuthLayout";
|
||||
|
||||
function Redirect() {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const userApi = new usersService();
|
||||
const dispatch = useDispatch()
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const userApi = new usersService();
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const queryParams = new URLSearchParams(location?.search);
|
||||
const codeResponse = queryParams.get("code");
|
||||
const queryParams = new URLSearchParams(location?.search);
|
||||
const codeResponse = queryParams.get("code");
|
||||
|
||||
useEffect(()=>{
|
||||
if(!codeResponse){
|
||||
navigate('/login', {state: {error: true}})
|
||||
return
|
||||
}
|
||||
console.log(codeResponse);
|
||||
/*
|
||||
useEffect(() => {
|
||||
if (!codeResponse) {
|
||||
navigate("/login", { state: { error: true } });
|
||||
return;
|
||||
}
|
||||
console.log(codeResponse);
|
||||
/*
|
||||
POST /token HTTP/1.1
|
||||
Host: oauth2.googleapis.com
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
@@ -31,34 +31,40 @@ function Redirect() {
|
||||
redirect_uri=https%3A//oauth2.example.com/code&
|
||||
grant_type=authorization_code
|
||||
*/
|
||||
var reqData = {
|
||||
auth_type: "GOOGLE",
|
||||
code: codeResponse,
|
||||
redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
|
||||
};
|
||||
userApi
|
||||
.authStart(reqData)
|
||||
.then((res) => {
|
||||
if (res.status == 200 && res.data.internal_return >= 0 && res.data.member_id && res.data.uid && res.data.session) {
|
||||
localStorage.setItem("member_id", `${res.data.member_id}`);
|
||||
localStorage.setItem("uid", `${res.data.uid}`);
|
||||
localStorage.setItem("session_token", `${res.data.session}`);
|
||||
dispatch(updateUserDetails({...res.data}));
|
||||
navigate('/', {replace: true})
|
||||
return
|
||||
}
|
||||
navigate('/login', {state: {error: true}})
|
||||
})
|
||||
.catch((error) => {
|
||||
navigate('/login', {state: {error: true}})
|
||||
console.log(error);
|
||||
});
|
||||
},[])
|
||||
var reqData = {
|
||||
auth_type: "GOOGLE",
|
||||
code: codeResponse,
|
||||
redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
|
||||
};
|
||||
userApi
|
||||
.authStart(reqData)
|
||||
.then((res) => {
|
||||
if (
|
||||
res.status == 200 &&
|
||||
res.data.internal_return >= 0 &&
|
||||
res.data.member_id &&
|
||||
res.data.uid &&
|
||||
res.data.session
|
||||
) {
|
||||
localStorage.setItem("member_id", `${res.data.member_id}`);
|
||||
localStorage.setItem("uid", `${res.data.uid}`);
|
||||
localStorage.setItem("session_token", `${res.data.session}`);
|
||||
dispatch(updateUserDetails({ ...res.data }));
|
||||
navigate("/", { replace: true });
|
||||
return;
|
||||
}
|
||||
navigate("/login", { state: { error: true } });
|
||||
})
|
||||
.catch((error) => {
|
||||
navigate("/login", { state: { error: true } });
|
||||
console.log(error);
|
||||
});
|
||||
}, []);
|
||||
return (
|
||||
<AuthLayout>
|
||||
<div className='min-h-[70vh]'>Redirecting ... </div>
|
||||
</AuthLayout>
|
||||
)
|
||||
<div className="min-h-[70vh]">Redirecting ... </div>
|
||||
</AuthLayout>
|
||||
);
|
||||
}
|
||||
|
||||
export default Redirect
|
||||
export default Redirect;
|
||||
|
||||
@@ -342,6 +342,7 @@ export default function Login() {
|
||||
imgSrc={appleLogo}
|
||||
brand="Apple"
|
||||
isAnchor={true}
|
||||
style={{visibility: 'hidden'}}
|
||||
/>
|
||||
</div>
|
||||
<div className="sm:flex sm:justify-between sm:items-center sm:space-x-2">
|
||||
@@ -446,7 +447,7 @@ export default function Login() {
|
||||
);
|
||||
}
|
||||
|
||||
const BrandBtn = ({ link, imgSrc, brand, onClick, isAnchor = false }) => {
|
||||
const BrandBtn = ({ link, imgSrc, brand, onClick, isAnchor = false, style = {visibility: 'visible' } }) => {
|
||||
// const doGoogle = async () => {
|
||||
// alert("start google");
|
||||
// };
|
||||
@@ -466,7 +467,7 @@ const BrandBtn = ({ link, imgSrc, brand, onClick, isAnchor = false }) => {
|
||||
// alert("start facebook");
|
||||
// };
|
||||
return (
|
||||
<div className="w-full sm:w-1/2 flex justify-center bottomMargin">
|
||||
<div className="w-full sm:w-1/2 flex justify-center bottomMargin" style={style}>
|
||||
{isAnchor ? (
|
||||
<a
|
||||
href={link}
|
||||
|
||||
@@ -26,7 +26,8 @@ const CouponPopup = ({ popUpHandler, data }) => {
|
||||
setStatusMsg({ error: "An error occurred" });
|
||||
else setStatusMsg({ success: res.data?.status_text });
|
||||
|
||||
dispatch(tableReload({ type: "COUPONTABLE" }));
|
||||
// dispatch(tableReload({ type: "COUPONTABLE" }));
|
||||
dispatch(tableReload({ type: "WALLETTABLE" }));
|
||||
setTimeout(() => {
|
||||
popUpHandler();
|
||||
setLoader(false);
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useSelector } from "react-redux";
|
||||
|
||||
export default function MyCoupons() {
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
const {couponTable} = useSelector(state => state.tableReload)
|
||||
const {couponTable, walletTable} = useSelector(state => state.tableReload)
|
||||
let [couponHistory, setCouponHistory] = useState({
|
||||
// FOR COUPON HISTORY
|
||||
loading: true,
|
||||
@@ -38,7 +38,7 @@ export default function MyCoupons() {
|
||||
|
||||
useEffect(() => {
|
||||
getCouponHistory();
|
||||
}, [couponTable]);
|
||||
}, [couponTable, walletTable]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,45 +1,21 @@
|
||||
import React, {
|
||||
Suspense,
|
||||
lazy,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
} from "react";
|
||||
import React, { Suspense, lazy, useEffect, useState } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import usersService from "../../services/UsersService";
|
||||
import Layout from "../Partials/Layout";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
const WalletBox = lazy(() => import("./WalletBox"));
|
||||
|
||||
|
||||
const WalletRoutes = () => {
|
||||
const apiCall = new usersService();
|
||||
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||
const { walletTable } = useSelector((state) => state.tableReload);
|
||||
const [walletList, setWalletList] = useState({
|
||||
loading: true,
|
||||
data: [],
|
||||
reload: false,
|
||||
});
|
||||
|
||||
const [paymentHistory, setPaymentHistory] = useState({
|
||||
loading: true,
|
||||
data: [],
|
||||
});
|
||||
|
||||
const getWalletList = () => {
|
||||
apiCall
|
||||
.getUserWallets()
|
||||
.then((res) => {
|
||||
if (res.data.internal_return < 0) {
|
||||
setWalletList({ loading: false, data: [] });
|
||||
} else {
|
||||
setWalletList({ loading: false, data: res.data?.result_list });
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setWalletList({ loading: false, data: [] });
|
||||
});
|
||||
}
|
||||
|
||||
const getPaymentHistory = () => {
|
||||
apiCall
|
||||
.getPaymentHx()
|
||||
@@ -53,24 +29,16 @@ const WalletRoutes = () => {
|
||||
.catch(() => {
|
||||
setPaymentHistory({ loading: false, data: [] });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// const fetchData = async () => {
|
||||
// await Promise.all([getWalletList(), getPaymentHistory()]);
|
||||
// };
|
||||
|
||||
// if (walletList.loading) {
|
||||
// fetchData();
|
||||
// }
|
||||
getWalletList()
|
||||
getPaymentHistory()
|
||||
getPaymentHistory();
|
||||
}, [walletTable]);
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
||||
<WalletBox wallet={walletList} payment={paymentHistory} />
|
||||
<WalletBox wallet={walletDetails} payment={paymentHistory} />
|
||||
</Suspense>
|
||||
</Layout>
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function WalletBox({ wallet, payment }) {
|
||||
</div>
|
||||
) : wallet.data.length ? (
|
||||
wallet.data.map((item, index) => (
|
||||
<div className="lg:w-full h-full mb-10 lg:mb-0">
|
||||
<div key={item.wallet_uid} className="lg:w-full h-full mb-10 lg:mb-0">
|
||||
<WalletItemCard walletItem={item} payment={payment} />
|
||||
</div>
|
||||
))
|
||||
|
||||
@@ -41,8 +41,8 @@ export default function WalletHeader(props) {
|
||||
<div className="content px-7 pb-7">
|
||||
<ul>
|
||||
{props.myWalletList &&
|
||||
props.myWalletList?.result_list?.length > 0 &&
|
||||
props.myWalletList.result_list.map((value, index) =>
|
||||
props.myWalletList?.length > 0 &&
|
||||
props.myWalletList.map((value, index) =>
|
||||
{
|
||||
let image = value.code ? `${value.code.toLocaleLowerCase()}.svg` : 'default.png'
|
||||
return(
|
||||
|
||||
@@ -15,6 +15,7 @@ import WalletHeader from "../MyWallet/WalletHeader";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import Flag from "../../assets/images/united-states.svg";
|
||||
import siteLogo from "../../assets/images/wrenchboard-logo-text.png";
|
||||
// import { updateWalletDetails } from "../../store/walletDetails";
|
||||
import TimeDifference from "../Helpers/TimeDifference";
|
||||
|
||||
const DEFAULT_PROFILE_IMAGE = require("../../assets/images/profile.jpg");
|
||||
@@ -33,19 +34,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { notifications } = useSelector((state) => state?.notifications); // NOTIFICATION STORE
|
||||
|
||||
const getMyWalletList = async () => {
|
||||
try {
|
||||
const res = await api.getUserWallets(null);
|
||||
console.log("wallet - > ", res.data);
|
||||
setMyWalletList(res.data);
|
||||
} catch (error) {
|
||||
console.log("Error getting mode");
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
getMyWalletList();
|
||||
}, [walletTable]);
|
||||
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||
|
||||
const handlerBalance = () => {
|
||||
setbalanceValue.toggle();
|
||||
@@ -104,7 +93,6 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
||||
let userEmail = email?.split("@")[0];
|
||||
const userProfileImage = profile_pic_url || DEFAULT_PROFILE_IMAGE;
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="header-wrapper backdrop-blur-sm bg-[#efedfe5e]/60 dark:bg-transparent w-full h-full flex items-center xl:px-0 md:px-10 px-5">
|
||||
@@ -241,7 +229,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
||||
|
||||
{/*<div className="lg:hidden block"></div>*/}
|
||||
<WalletHeader
|
||||
myWalletList={myWalletList}
|
||||
myWalletList={walletDetails.data}
|
||||
handlerBalance={handlerBalance}
|
||||
balanceDropdown={balanceDropdown}
|
||||
addMoneyHandler={addMoneyHandler}
|
||||
|
||||
@@ -158,13 +158,18 @@ export default function Resources(props) {
|
||||
return (
|
||||
<ul className="lg:flex lg:space-x-14 space-x-8">
|
||||
{tabCategories?.length > 0 &&
|
||||
tabCategories?.map((tabValue, idx) => (
|
||||
<TabItem
|
||||
key={tabValue.id}
|
||||
tabValue={tabValue}
|
||||
isActive={tab === tabValue.name || (idx === 0 && tab === "")}
|
||||
/>
|
||||
))}
|
||||
tabCategories?.map((tabValue, idx) => {
|
||||
if(tabValue.enabled){
|
||||
return (
|
||||
<TabItem
|
||||
key={tabValue.id}
|
||||
tabValue={tabValue}
|
||||
isActive={tab === tabValue.name || (idx === 0 && tab === "")}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
)}
|
||||
</ul>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import React, { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import defaultImg from "../../../assets/images/myfiles/default.svg";
|
||||
import localImgLoad from "../../../lib/localImgLoad";
|
||||
import { PaginatedList, handlePagingFunc } from "../../Pagination";
|
||||
|
||||
export default function MyUploadedFiles({ uploadedFiles }) {
|
||||
@@ -50,6 +52,17 @@ export default function MyUploadedFiles({ uploadedFiles }) {
|
||||
>
|
||||
<td className=" py-4">
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
<div className="w-[60px] h-[60px] p-2 bg-alice-blue rounded-full overflow-hidden flex justify-center items-center">
|
||||
<img
|
||||
src={
|
||||
localImgLoad(
|
||||
`images/myfiles/${value.banner}`
|
||||
) || defaultImg
|
||||
}
|
||||
alt="data"
|
||||
className="w-full h-full rounded-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col flex-[0.9]">
|
||||
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
||||
{value.title || "Dummy Text"}
|
||||
@@ -87,6 +100,21 @@ export default function MyUploadedFiles({ uploadedFiles }) {
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="text-right py-4 px-2">
|
||||
<div className="flex justify-center items-center">
|
||||
<button
|
||||
type="button"
|
||||
// onClick={() => {
|
||||
// navigate("/manage-active-job", {
|
||||
// state: { ...value, pathname },
|
||||
// });
|
||||
// }}
|
||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
>
|
||||
View
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})
|
||||
|
||||
@@ -8,13 +8,16 @@ export default function TermsConditionTab() {
|
||||
<h1 className="text-3xl tracking-wide font-bold text-dark-gray dark:text-white mb-4">
|
||||
Terms of use
|
||||
</h1>
|
||||
<p className="text-base text-thin-light-gray leading-[28px] ">
|
||||
<p className="text-base text-thin-light-gray leading-[28px]">
|
||||
(updated August 10, 2023)
|
||||
</p>
|
||||
<p className="text-base text-thin-light-gray leading-[28px]">
|
||||
These Website Terms & Conditions (“T&Cs”) apply to your access and
|
||||
use of www.wrenchboard.com,dashboard.wrenchboard.com (the “Site”),
|
||||
including all software, data, reports, text, images, sounds, video,
|
||||
and all contents made available through any portion of the Site
|
||||
(collectively, the “Content”). Content includes all such elements as
|
||||
a whole, as well as individual elements and portions thereof.
|
||||
use of www.wrenchboard.com,users.wrenchboard.com (the “Site”),
|
||||
native apps, including all software, data, reports, text, images,
|
||||
sounds, video, and all contents made available through any portion
|
||||
of the Site (collectively, the “Content”). The range includes all
|
||||
such elements as whole, individual, and parts.
|
||||
</p>
|
||||
</div>
|
||||
<hr />
|
||||
@@ -37,103 +40,138 @@ export default function TermsConditionTab() {
|
||||
<h1 className="text-2xl tracking-wide font-bold text-dark-gray dark:text-white mb-4">
|
||||
General Conditions of Use
|
||||
</h1>
|
||||
<p className="text-base text-thin-light-gray leading-[28px] ">
|
||||
<b> Authorization to Access and Use Site and Content.</b> Subject to
|
||||
your compliance with these T&Cs and the provisions hereof, you may
|
||||
access or use the Site and Content solely for the purpose of your
|
||||
evaluation of WRENCHBOARD and WRENCHBOARD’s products and services.
|
||||
You may only link to the Site or Content, or any portion thereof, as
|
||||
expressly permitted by WRENCHBOARD.
|
||||
<br />
|
||||
<b> Ownership and Restrictions.</b> All rights, title, and interest
|
||||
in and to the Site and Content will remain with and belong
|
||||
exclusively to WRENCHBOARD. You will not (a) sublicense, resell,
|
||||
rent, lease, transfer, assign, time share or otherwise commercially
|
||||
exploit or make the Site and any Content available to any third
|
||||
party, (b) use the Site and Content in any unlawful manner
|
||||
(including without limitation in violation of any data, privacy or
|
||||
export control laws) or in any manner that interferes with or
|
||||
disrupts the integrity or performance of the Site and Content or
|
||||
their related components, or (c) modify, adapt or hack the Site and
|
||||
Content to, or try to, gain unauthorized access to the restricted
|
||||
portions of the Site and Content or related systems or networks
|
||||
(i.e., circumvent any encryption or other security measures, gain
|
||||
access to any source code or any other underlying form of technology
|
||||
or information, and gain access to any part of the Site and Content,
|
||||
or any other products or services of WRENCHBOARD that are not
|
||||
readily made available to the general public). You are not permitted
|
||||
to copy, modify, frame, repost, publicly perform or display, sell,
|
||||
reproduce, distribute, or create derivative works of the Site and
|
||||
Content, except that you may download, display, and print one copy
|
||||
of the publicly available materials (i.e., the Content that does not
|
||||
require an Account name or password to access) on any single
|
||||
computer solely for your personal, non-commercial use, provided that
|
||||
you do not modify the material in any way and you keep intact all
|
||||
copyright, trademark, and other proprietary notices. You agree not
|
||||
to access the Site or Content by any means other than through the
|
||||
interface that is provided by WRENCHBOARD to access the same. You
|
||||
may not use any “page-scrape,” “deep-link,” “spider,” or “robot or
|
||||
other automatic program, device, algorithm or methodology, or any
|
||||
similar manual process, to access, copy, acquire, or monitor any
|
||||
portion of the Site or any Content, or in any way reproduce or
|
||||
circumvent the presentation or navigational structure of the Site or
|
||||
any Content, to obtain or attempt to obtain any Content or other
|
||||
information through any means not made generally available through
|
||||
the Site by WRENCHBOARD. WRENCHBOARD reserves the right to take any
|
||||
lawful measures to prevent any such activity. You may not forge
|
||||
headers or otherwise manipulate identifiers in order to disguise the
|
||||
origin of any message or transmittal you send to WRENCHBOARD on or
|
||||
through the Site or any service offered on or through the Site. You
|
||||
may not pretend that you are, or that you represent, someone else,
|
||||
or impersonate any other individual or entity.
|
||||
<b> Responsibility for Your Data.</b> You are solely responsible for
|
||||
all data, information, and other content, that you upload, post, or
|
||||
otherwise provide or store (hereafter “post(ing)”) in connection
|
||||
with or relating to the Site.
|
||||
</p>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div className="my-8">
|
||||
<h1 className="text-2xl tracking-wide font-bold text-dark-gray dark:text-white mb-4">
|
||||
Use of Intellectual Property.
|
||||
</h1>
|
||||
<p className="text-base text-thin-light-gray leading-[28px] ">
|
||||
<b> Rights in User Content.</b> By posting your information and
|
||||
other content (“User Content”) on or through the Site and Content,
|
||||
you grant WRENCHBOARD a worldwide, non-exclusive, perpetual,
|
||||
irrevocable, royalty-free, fully paid, sublicensable and
|
||||
transferable license to use, modify, reproduce, distribute, display,
|
||||
publish and perform User Content in connection with the Site and
|
||||
Content. WRENCHBOARD has the right, but not the obligation, to
|
||||
monitor the Site and Content and User Content. WRENCHBOARD may
|
||||
remove or disable any User Content at any time for any reason, or
|
||||
for no reason at all. You, the user, acknowledge that you bear sole
|
||||
responsibility for adequate security, protection, and backup of User
|
||||
Content. WRENCHBOARD will have no liability to you for any
|
||||
unauthorized access or use of any of User Content, or any
|
||||
corruption, deletion, destruction, or loss of any of User Content.
|
||||
</p>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div className="my-8">
|
||||
<h1 className="text-2xl tracking-wide font-bold text-dark-gray dark:text-white mb-4">
|
||||
Feedback
|
||||
</h1>
|
||||
<p className="text-base text-thin-light-gray leading-[28px] ">
|
||||
You may submit ideas, suggestions, or comments (“Feedback”)
|
||||
regarding the Site and Content or WRENCHBOARD’s business, products,
|
||||
or services. By submitting any Feedback, you acknowledge and agree
|
||||
that (a) your Feedback is provided by you voluntarily and
|
||||
WRENCHBOARD may, without any obligations or limitation, use and
|
||||
exploit such Feedback in any manner and for any purpose, (b) you
|
||||
will not seek and are not entitled to any money or other form of
|
||||
compensation, consideration, or attribution with respect to your
|
||||
Feedback regardless of whether WRENCHBOARD considered or used your
|
||||
Feedback in any manner, and (c) your Feedback is not the
|
||||
confidential or proprietary information of you or any third party.
|
||||
</p>
|
||||
<ul className="ml-8">
|
||||
<li className="text-base text-thin-light-gray leading-[28px]">
|
||||
<h1 className="text-lg tracking-wide font-bold text-dark-gray dark:text-white my-4">
|
||||
Authorization to Access and Use Site and Content.
|
||||
</h1>
|
||||
<p className="text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
Subject to your compliance with these T&Cs and the provisions
|
||||
hereof, you may access or use the Site and Content solely to
|
||||
evaluate WRENCHBOARD and WRENCHBOARD’s products and services.
|
||||
You may only link to the Site or Content, or any portion
|
||||
thereof, as expressly permitted by WRENCHBOARD.
|
||||
</p>
|
||||
</li>
|
||||
<li className="text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
<h1 className="text-lg tracking-wide font-bold text-dark-gray dark:text-white my-4">
|
||||
Ownership and Restrictions
|
||||
</h1>
|
||||
<p className="text-base text-thin-light-gray leading-[28px]">
|
||||
All rights, title, and interest in and to the Site and Content
|
||||
will remain exclusive to WRENCHBOARD. You will not:
|
||||
</p>
|
||||
<ol className="ml-8 list-decimal">
|
||||
<li className="my-2 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
Sublicense, resell, rent, lease, transfer, assign, timeshare,
|
||||
or commercially exploit or make the Site and any Content
|
||||
available to any third party.
|
||||
</li>
|
||||
<li className="my-2 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
Use the Site and Content in any unlawful manner (including
|
||||
without limitation in violation of any data, privacy, or
|
||||
export control laws) or in any way that interferes with or
|
||||
disrupts the integrity or performance of the Site and Content
|
||||
or their related components.
|
||||
</li>
|
||||
<li className="my-2 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
Modify, adapt, or hack the Site and Content to, or try to,
|
||||
gain unauthorized access to the restricted portions of the
|
||||
Site and Content or related systems or networks (i.e.,
|
||||
circumvent any encryption or other security measures, gain
|
||||
access to any source code or any other underlying form of
|
||||
technology or information, and gain access to any part of the
|
||||
Site and Content, or any other products or services of
|
||||
WRENCHBOARD that are not readily made available to the general
|
||||
public).
|
||||
</li>
|
||||
</ol>
|
||||
<p className="my-4 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
You are not permitted to copy, modify, frame, repost, publicly
|
||||
perform or display, sell, reproduce, distribute, or create
|
||||
derivative works of the Site and Content, except that you may
|
||||
download and print one copy of the publicly available materials
|
||||
(i.e., the Content that does not require an Account name or
|
||||
password to access) on any single computer solely for your
|
||||
personal, non-commercial use, provided that you do not modify
|
||||
the material in any way. You keep intact all copyright,
|
||||
trademark, and other proprietary notices.
|
||||
</p>
|
||||
<p className="my-4 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
You agree not to access the Site or Content by any means other
|
||||
than through the interface that WRENCHBOARD provides to access
|
||||
the same. You may not use any “page-scrape,” “deep-link,”
|
||||
“spider,” or “robot or other automatic program, device,
|
||||
algorithm or methodology, or any similar manual process, to
|
||||
access, copy, acquire, or monitor any portion of the Site or any
|
||||
Content, or in any way reproduce or circumvent the presentation
|
||||
or navigational structure of the Site or any Content, to obtain
|
||||
or attempt to obtain any Content or other information through
|
||||
any means not made generally available through the Site by
|
||||
WRENCHBOARD.
|
||||
</p>
|
||||
<p className="my-4 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
WRENCHBOARD reserves the right to take lawful measures to
|
||||
prevent such activity. You may not forge headers or otherwise
|
||||
manipulate identifiers to disguise the origin of any message or
|
||||
transmittal you send to WRENCHBOARD on or through the Site or
|
||||
any service offered on or through the Site. You may not pretend
|
||||
that you are, or that you represent, someone else or impersonate
|
||||
any other individual or entity.
|
||||
</p>
|
||||
</li>
|
||||
<li className="text-base text-thin-light-gray leading-[28px]">
|
||||
<h1 className="text-lg tracking-wide font-bold text-dark-gray dark:text-white my-4">
|
||||
Responsibility for Your Data
|
||||
</h1>
|
||||
<p className="text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
You are solely responsible for all data, information, and other
|
||||
Content, that you upload, post, or otherwise provide or store
|
||||
(hereafter “post(ing)”) in connection with or relating to the
|
||||
Site. By posting your information and other Content (“User
|
||||
Content”) on or through the Site and Content, you grant
|
||||
WRENCHBOARD a worldwide, non-exclusive, perpetual, irrevocable,
|
||||
royalty-free, sublicensable, and transferable license to use,
|
||||
modify, reproduce, distribute, display, publish and perform User
|
||||
Content in connection with the Site and Content. WRENCHBOARD has
|
||||
the right, but not the obligation, to monitor the Site and
|
||||
Content and User Content. <br />
|
||||
WRENCHBOARD may remove or turn off any User Content at any time
|
||||
for any reason or no reason. WRENCHBOARD will have no liability
|
||||
to you for any unauthorized access or use of any of User Content
|
||||
or any corruption, deletion, destruction, or loss of any of User
|
||||
Content.
|
||||
</p>
|
||||
</li>
|
||||
<li className="text-base text-thin-light-gray leading-[28px]">
|
||||
<h1 className="text-lg tracking-wide font-bold text-dark-gray dark:text-white my-4">
|
||||
Feedback
|
||||
</h1>
|
||||
<p className="text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
You may submit ideas, suggestions, or comments (“Feedback”)
|
||||
regarding the Site and Content or WRENCHBOARD’s business,
|
||||
products, or services. By submitting any Feedback, you
|
||||
acknowledge and agree that:{" "}
|
||||
</p>
|
||||
<ol className="ml-8 list-decimal">
|
||||
<li className="my-2 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
Your Feedback is provided by you voluntarily, and WRENCHBOARD
|
||||
may, without any obligations or limitations, use and exploit
|
||||
such Feedback in any manner and for any purpose.
|
||||
</li>
|
||||
<li className="my-2 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
You will not seek and are not entitled to any money or other
|
||||
form of compensation, consideration, or attribution concerning
|
||||
your Feedback, regardless of whether WRENCHBOARD considered or
|
||||
used your Feedback in any manner.
|
||||
</li>
|
||||
<li className="my-2 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
Your Feedback is not confidential or proprietary information
|
||||
of you or any third party.
|
||||
</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
@@ -141,36 +179,32 @@ export default function TermsConditionTab() {
|
||||
<h1 className="text-2xl tracking-wide font-bold text-dark-gray dark:text-white mb-4">
|
||||
Termination of Access Due to Violations
|
||||
</h1>
|
||||
<p className="text-base text-thin-light-gray leading-[28px] ">
|
||||
<p className="font-bold text-base text-thin-light-gray leading-[28px] ">
|
||||
WRENCHBOARD may, in its sole discretion and without prior notice,
|
||||
terminate your access to the Site and/or block your future access to
|
||||
terminate your access to the Site and block your future access to
|
||||
the Site if we determine that you have violated these T&Cs or other
|
||||
agreements or guidelines which may be associated with your use of
|
||||
the Site. You also agree that any violation by you of these T&Cs
|
||||
will cause irreparable harm to WRENCHBOARD, for which monetary
|
||||
damages would be inadequate, and you consent to WRENCHBOARD
|
||||
obtaining any injunctive or equitable relief that WRENCHBOARD deems
|
||||
necessary or appropriate in such circumstances, without limiting
|
||||
WRENCHBOARD’s other available remedies. Further, WRENCHBOARD may, in
|
||||
its sole discretion and without prior notice, terminate your access
|
||||
to the Site, for cause, which includes (but is not limited to) (1)
|
||||
requests by law enforcement or other government agencies, (2)
|
||||
discontinuance or material modification of the Site or any service
|
||||
offered on or through the Site, or (3) unexpected technical issues
|
||||
or problems.
|
||||
the Site. Further, WRENCHBOARD may, in its sole discretion and
|
||||
without prior notice, terminate your access to the Site for cause,
|
||||
which includes (but is not limited to):
|
||||
</p>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div className="my-8">
|
||||
<h1 className="text-2xl tracking-wide font-bold text-dark-gray dark:text-white mb-4">
|
||||
T&Cs Updates
|
||||
</h1>
|
||||
<ol className="ml-8 list-decimal font-bold">
|
||||
<li className="my-2 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
Requests by law enforcement or other government agencies
|
||||
</li>
|
||||
<li className="my-2 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
Discontinuance or material modification of the Site or any service
|
||||
offered on or through the Site
|
||||
</li>
|
||||
<li className="my-2 text-base font-bold text-thin-light-gray leading-[28px]">
|
||||
Unexpected technical issues or problems.T&Cs Updates
|
||||
</li>
|
||||
</ol>
|
||||
<p className="text-base text-thin-light-gray leading-[28px] ">
|
||||
WRENCHBOARD reserves the right, at its sole discretion, to change or
|
||||
modify portions of these T&Cs at any time. WRENCHBOARD will post the
|
||||
changes to these T&Cs on the Site and will indicate at the top of
|
||||
this page the date these terms were last revised. It is your
|
||||
changes to these T&Cs on the Site and indicate at the top of this
|
||||
page the date these terms were last revised. It is your
|
||||
responsibility to check the T&Cs periodically for changes. Your
|
||||
continued use of the Site and Content after the date any such
|
||||
changes become effective constitutes your acceptance of the new or
|
||||
@@ -193,42 +227,36 @@ export default function TermsConditionTab() {
|
||||
REPRESENTATIONS OR WARRANTIES ARISING FROM COURSE OF DEALING, COURSE
|
||||
OF PERFORMANCE OR USAGE OF TRADE. YOU ACKNOWLEDGE THAT WRENCHBOARD
|
||||
DOES NOT WARRANT THAT YOUR ACCESS OR USE OR BOTH OF THE SITE AND
|
||||
CONTENT WILL BE UNINTERRUPTED, TIMELY, SECURE, ERROR-FREE OR
|
||||
CONTENT WILL BE UNINTERRUPTED, TIMELY, SECURE, ERROR-FREE, OR
|
||||
VIRUS-FREE, AND WRENCHBOARD DOES NOT MAKE ANY WARRANTY AS TO THE
|
||||
RESULTS THAT MAY BE OBTAINED FROM USE OF THE SITE AND CONTENT. NO
|
||||
INFORMATION, ADVICE OR SERVICES OBTAINED BY YOU FROM WRENCHBOARD OR
|
||||
THROUGH THE SITE WILL CREATE ANY WARRANTY NOT EXPRESSLY STATED IN
|
||||
THESE TERMS and CONDITIONS AND YOU SHOULD NOT RELY ON THE SITE AND
|
||||
RESULTS THAT MAY BE OBTAINED FROM THE USE OF THE SITE AND CONTENT.
|
||||
NO INFORMATION, ADVICE, OR SERVICES OBTAINED BY YOU FROM WRENCHBOARD
|
||||
OR THROUGH THE SITE WILL CREATE ANY WARRANTY NOT EXPRESSLY STATED IN
|
||||
THESE TERMS and CONDITIONS, AND YOU SHOULD NOT RELY ON THE SITE AND
|
||||
THE GENERAL CONTENT ALONE AS THE BASIS FOR YOUR BUSINESS DECISIONS.
|
||||
</p>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div className="my-8">
|
||||
<p className="text-base text-thin-light-gray leading-[28px] ">
|
||||
<p className="font-bold text-base text-thin-light-gray leading-[28px] ">
|
||||
WRENCHBOARD reserves the right to do any of the following, at any
|
||||
time, without notice: (1) to modify, suspend or terminate operation
|
||||
time, without notice: ( 1 ); to modify, suspend or terminate operation
|
||||
of or access to the Site, or any portion of the Site, for any
|
||||
reason; (2) to modify or change the Site, or any portion of the
|
||||
Site, for any reason; and (3) to interrupt the operation of the
|
||||
reason; ( 2 ) to modify or change the Site, or any portion of the
|
||||
Site, for any reason; and ( 3 ) to interrupt the operation of the
|
||||
Site, or any portion of the Site, as necessary to perform routine or
|
||||
non-routine maintenance, error correction, or other changes..
|
||||
non-routine maintenance, error correction, or other changes. Changes
|
||||
to the Policy
|
||||
</p>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div className="mt-8">
|
||||
<h1 className="text-2xl tracking-wide font-bold text-dark-gray dark:text-white mb-4">
|
||||
Changes To the Policy
|
||||
</h1>
|
||||
<p className="text-base text-thin-light-gray leading-[28px] ">
|
||||
We reserve the rights to update and make changes to this Privacy
|
||||
policy at anytime. Changes will become effective once posted.
|
||||
However, we will notify you by email or when you log on to the
|
||||
service or website about any changes that fundamentally affect how
|
||||
we manage your personal information. Contacting Us: You may contact
|
||||
us about this policy through our email address anytime :
|
||||
support@wrenchboard.com
|
||||
<p className="my-4 text-base text-thin-light-gray leading-[28px] ">
|
||||
We reserve the right to update and change this Privacy policy at any
|
||||
time. Changes will become effective once posted. However, we will
|
||||
notify you by email or when you log on to the service or website
|
||||
about any changes that fundamentally affect how we manage your
|
||||
personal information. Contacting Us: You may contact us about this
|
||||
policy through our email address anytime: support@wrenchboard.com
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,7 @@ import { updateUserDetails } from "../store/UserDetails";
|
||||
import { updateJobs } from "../store/jobLists";
|
||||
import { updateNotifications } from "../store/notifications";
|
||||
import { updateUserJobList } from "../store/userJobList";
|
||||
import { updateWalletDetails } from "../store/walletDetails";
|
||||
|
||||
const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
@@ -19,13 +20,13 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { jobListTable } = useSelector((state) => state.tableReload);
|
||||
const { jobListTable, walletTable } = useSelector((state) => state.tableReload);
|
||||
|
||||
const {
|
||||
userDetails: { username, uid },
|
||||
userDetails: { username, uid, session },
|
||||
} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
||||
|
||||
let loggedIn = username && uid ? true : false; // variable to determine if user is logged in
|
||||
let loggedIn = username && session && uid ? true : false; // variable to determine if user is logged in
|
||||
|
||||
useEffect(() => {
|
||||
//Removing Data stored at localStorage after session expires
|
||||
@@ -149,7 +150,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
// sort: _sorted,
|
||||
// header: _header,
|
||||
// },
|
||||
data: _sorted
|
||||
data: _sorted,
|
||||
})
|
||||
);
|
||||
})
|
||||
@@ -177,6 +178,21 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
getMyJobList();
|
||||
}, [jobListTable]);
|
||||
|
||||
useEffect(() => {
|
||||
const getMyWalletList = async () => {
|
||||
dispatch(updateWalletDetails({ loading: true, data:[] }));
|
||||
try {
|
||||
const res = await apiCall.getUserWallets();
|
||||
console.log("wallet - >", res.data);
|
||||
dispatch(updateWalletDetails({ loading: false, data:res.data?.result_list }));
|
||||
} catch (error) {
|
||||
dispatch(updateWalletDetails({ loading: false, data:[] }));
|
||||
console.log("Error getting mode");
|
||||
}
|
||||
};
|
||||
getMyWalletList();
|
||||
}, [walletTable]);
|
||||
|
||||
useEffect(() => {
|
||||
// Getting market data
|
||||
const getMarketActiveJobList = async () => {
|
||||
|
||||
@@ -358,6 +358,7 @@ class usersService {
|
||||
page: 0,
|
||||
offset: 0,
|
||||
limit: 100,
|
||||
allstatus: 0
|
||||
};
|
||||
return this.postAuxEnd("/activetaskslist", postData);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
userDetails: {}
|
||||
userDetails: {},
|
||||
};
|
||||
|
||||
export const userSlice = createSlice({
|
||||
name: "userDetails",
|
||||
initialState,
|
||||
reducers: {
|
||||
updateUserDetails: (state,action) => {
|
||||
state.userDetails = {...action.payload}
|
||||
updateUserDetails: (state, action) => {
|
||||
state.userDetails = { ...action.payload };
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -17,4 +17,4 @@ export const userSlice = createSlice({
|
||||
// Action creators are generated for each case reducer function
|
||||
export const { updateUserDetails } = userSlice.actions;
|
||||
|
||||
export default userSlice.reducer;
|
||||
export default userSlice.reducer;
|
||||
|
||||
@@ -7,6 +7,7 @@ import userDetailReducer from "./UserDetails";
|
||||
import jobReducer from "./jobLists";
|
||||
import notificationsReducer from "./notifications";
|
||||
import userJobListReducer from "./userJobList";
|
||||
import walletDetails from "./walletDetails";
|
||||
|
||||
export default configureStore({
|
||||
reducer: {
|
||||
@@ -17,5 +18,6 @@ export default configureStore({
|
||||
userJobList: userJobListReducer,
|
||||
commonHeadBanner: commonHeadBannerReducer,
|
||||
notifications: notificationsReducer,
|
||||
walletDetails: walletDetails
|
||||
},
|
||||
});
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
walletDetails: {
|
||||
loading: true,
|
||||
data: []
|
||||
},
|
||||
};
|
||||
|
||||
export const walletSlice = createSlice({
|
||||
name: "walletDetails",
|
||||
initialState,
|
||||
reducers: {
|
||||
updateWalletDetails: (state, action) => {
|
||||
state.walletDetails = { ...action.payload };
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { updateWalletDetails } = walletSlice.actions;
|
||||
export default walletSlice.reducer;
|
||||
Reference in New Issue
Block a user