Compare commits

...

15 Commits

Author SHA1 Message Date
victorAnumudu d2a406563a text updated 2024-06-28 13:46:24 +01:00
ameye d509fb024c Merge branch 'video-upload-max-size' of WrenchBoard/Users-Wrench into master 2024-06-27 10:35:14 +00:00
victorAnumudu 4acae3401d video upload file size increased to 30mb 2024-06-26 18:54:53 +01:00
ameye 05a1dc3663 Merge branch 'new-file-upload' of WrenchBoard/Users-Wrench into master 2024-06-25 21:25:53 +00:00
victorAnumudu 63eb8b9729 new contract file upload link added 2024-06-25 19:28:17 +01:00
ameye a474d42d85 Merge branch 'no-wallet-post-job-hidden' of WrenchBoard/Users-Wrench into master 2024-06-24 21:19:38 +00:00
victorAnumudu dcb820590d set post job link hidden if no wallet is available 2024-06-24 22:06:55 +01:00
ameye 614c376c92 Merge branch 'market-box-reduction' of WrenchBoard/Users-Wrench into master 2024-06-24 13:37:50 +00:00
victorAnumudu b589277678 market box reduction 2024-06-24 11:32:57 +01:00
ameye 00a70f3574 Merge branch 'no-wallet-view' of WrenchBoard/Users-Wrench into master 2024-06-20 17:02:36 +00:00
victorAnumudu 7859cffd49 no wallet view dummy component added 2024-06-20 15:43:58 +01:00
victorAnumudu 3a574d1fd0 added no wallet message 2024-06-19 18:32:33 +01:00
ameye 7c6a2316a8 Merge branch 'my-page-link-hidden' of WrenchBoard/Users-Wrench into master 2024-06-01 13:25:20 +00:00
ameye ef99a8f1f7 Merge branch 'market-thumbnail' of WrenchBoard/Users-Wrench into master 2024-06-01 13:25:12 +00:00
victorAnumudu ba0aac126c set some links hidden base on wallet status 2024-05-31 17:56:48 +01:00
16 changed files with 217 additions and 167 deletions
+6 -2
View File
@@ -72,7 +72,8 @@ REACT_APP_APPLE_SOCIAL_LOGIN=0
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
#File Handling
REACT_APP_MAX_FILE_SIZE=1000000
REACT_APP_MAX_FILE_SIZE=1048576
REACT_APP_MAX_VIDEO_FILE_SIZE=31457280
REACT_APP_TOTAL_NUM_FILE=4
#Auth Text(s)
@@ -124,4 +125,7 @@ REACT_APP_MEDIA_LINK='https://dev-media.wrenchboard.com'
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
# REACT APP CUSTOMTIMER
REACT_APP_CUSTOMTIMER=90
REACT_APP_CUSTOMTIMER=90
#SHOW OR HIDE MY PAGE LINK ROUTE
REACT_APP_SHOW_USER_PAGE=1
+7 -2
View File
@@ -43,7 +43,9 @@ REACT_APP_GOOGLE_CLIENT_SECRET=aozK_2G8UjaCmLgPPkv9abIm
REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
REACT_APP_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/
REACT_APP_MAX_FILE_SIZE=1000000
#File Handling
REACT_APP_MAX_FILE_SIZE=1048576
REACT_APP_MAX_VIDEO_FILE_SIZE=31457280
REACT_APP_TOTAL_NUM_FILE=4
REACT_APP_LOGOUT_TEXT="Sign Out"
@@ -92,4 +94,7 @@ REACT_APP_MEDIA_LINK='https://dev-media.wrenchboard.com'
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
# REACT APP CUSTOMTIMER
REACT_APP_CUSTOMTIMER=90
REACT_APP_CUSTOMTIMER=90
#SHOW OR HIDE MY PAGE LINK ROUTE
REACT_APP_SHOW_USER_PAGE=1
+7 -2
View File
@@ -50,7 +50,9 @@ REACT_APP_FACEBOOK_REDIRECT_URL="https://users.wrenchboard.com/login/auth/flogin
DISABLE_ESLINT_PLUGIN=true
REACT_APP_MAX_FILE_SIZE=1000000
#File Handling
REACT_APP_MAX_FILE_SIZE=1048576
REACT_APP_MAX_VIDEO_FILE_SIZE=31457280
REACT_APP_TOTAL_NUM_FILE=4
REACT_APP_LOGOUT_TEXT="Sign Out"
@@ -98,4 +100,7 @@ REACT_APP_MEDIA_LINK='https://media.wrenchboard.com'
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
# REACT APP CUSTOMTIMER
REACT_APP_CUSTOMTIMER=90
REACT_APP_CUSTOMTIMER=90
#SHOW OR HIDE MY PAGE LINK ROUTE
REACT_APP_SHOW_USER_PAGE=0
@@ -145,6 +145,7 @@ export default function Login() {
localStorage.setItem("member_id", `${res.data.member_id}`);
localStorage.setItem("uid", `${res.data.uid}`);
localStorage.setItem("session_token", `${res.data.session}`);
localStorage.setItem("wallet_available_status", `${res.data.wallet_available_status}`);
if (res.data?.account_type == "FAMILY") {
sessionStorage.setItem("family_uid", res.data?.family_uid);
sessionStorage.setItem("parent_uid", res.data?.parent_uid);
+7 -8
View File
@@ -34,7 +34,7 @@ export default function AvailableJobsCard({
<>
{contentDisplay == "grid" ? (
<div
className={`card-style-two w-full h-[426px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
className={`card-style-two w-full p-[10px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
className || ""
}`}
>
@@ -42,7 +42,7 @@ export default function AvailableJobsCard({
onClick={() => {
setMarketPopUp({ show: true, data: datas });
}}
className="flex flex-col justify-between w-full h-full"
className="flex flex-col gap-2 justify-between w-full h-full"
>
<div className='w-full flex items-center gap-4'>
<div className='min-w-[60px] min-h-[60px] max-w-[60px] max-h-[60px] rounded-full overflow-hidden'>
@@ -64,7 +64,7 @@ export default function AvailableJobsCard({
</p>
</div>
</div>
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
<div className="created-by flex space-x-2 items-center flex-row-reverse">
<div>
<p className="text-thin-light-gray text-sm leading-3 text-right">
@@ -80,19 +80,18 @@ export default function AvailableJobsCard({
</div>
<div className="thumbnail-area w-full">
<div
className="w-full h-[236px] p-6 rounded-xl overflow-hidden bg-center bg-cover bg-no-repeat"
className="w-full h-[236px] rounded-xl overflow-y-auto bg-center bg-cover bg-no-repeat"
// style={{
// backgroundImage: `url('${image}')`,
// }}
>
<div className="flex justify-center bg-slate-100 p-2 rounded-md">
{datas.description}
<div className="flex flex-col h-full bg-slate-100 p-2 rounded-md">
<p>{datas.description}</p>
</div>
</div>
</div>
<div className="details-area">
<div className="product-two-options flex justify-between mb-5 relative"></div>
{/* <div className="product-two-options flex justify-between mb-5 relative"></div> */}
<div className="flex justify-between">
<div className="flex items-center space-x-2">
<div>
+1 -1
View File
@@ -20,7 +20,7 @@ export default function MainSection({
);
const [tab, setTab] = useState(Object.keys(marketCategories)[0]);
let [contentDisplay, setContentDisplay] = useState("list"); // STATE TO HOLD LIST VIEW STYLE
let [contentDisplay, setContentDisplay] = useState("grid"); // STATE TO HOLD LIST VIEW STYLE
// Convert to array in order to map
const mappedArray = Object.entries(marketCategories).map(([key, value]) => {
@@ -252,7 +252,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] px-4 rounded-md md:min-h-[420px] flex flex-col justify-between">
<div className="w-full flex flex-col justify-center pb-4 gap-2">
<p className="job-label w-full">
Interested in the task?
Interested?
</p>
<hr />
<button
@@ -262,9 +262,8 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
>
{" "}
<div className="w-full flex flex-col justify-between gap-2">
<span>Send</span>
<span>Interest</span>
<span>Request</span>
<span>Notify</span>
<span>Owner</span>
</div>
</button>
<>
+53 -55
View File
@@ -75,7 +75,19 @@ function ActiveJobs(props) {
// IF NO FILE SELECTED RETURN
return;
}
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) {
let fileType = files[0].type.split('/')[0].toLowerCase()
if (fileType == 'video' && files[0].size > Number(process.env.REACT_APP_MAX_VIDEO_FILE_SIZE)) { // return if video file is more than 30mb
setRequestStatus({
loading: false,
status: false,
message: "File must be <= 30mb",
});
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
return;
}
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) { // return if other files is more than 1mb
setRequestStatus({
loading: false,
status: false,
@@ -100,7 +112,8 @@ function ActiveJobs(props) {
return;
}
// INCLUDE FILE IF NO ERROR
setFilesToSend((prev) => [...prev, files[0]]);
// setFilesToSend((prev) => [...prev, files[0]]); //for sending multiple file if need be
setFilesToSend([files[0]])
};
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
@@ -189,61 +202,46 @@ function ActiveJobs(props) {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
}
// const fileToBase64 = async () => {
// // Converts file data to base64 string
// try {
// const base64String = await convertFileToBase64(filesToSend[i]);
// return base64String;
// } catch (error) {
// return false;
// }
// };
for (let i = 0; i <= filesToSend.length - 1; i++) {
// Loops through files to send array and trigger upload API call
let reqData = {
// file_name: filesToSend[i].name,
// file_size: filesToSend[i].size,
// file_type: "image/png",
// file_data: await fileToBase64(),
msg_type: "FILE",
contract: props.details.contract,
file: filesToSend[0],
};
const fileToBase64 = async () => {
// Converts file data to base64 string
try {
const base64String = await convertFileToBase64(filesToSend[i]);
return base64String;
} catch (error) {
return false;
ApiCall.sendFilesNew(reqData)
.then((res) => {
if(res.status != 200 || res.data.internal_return < 0){
setRequestStatus({loading: false, status: false, message: 'File could not be sent, try again later'})
return
}
};
// if(await !fileToBase64()){
// return
// }
let reqData = {
file_name: filesToSend[i].name,
file_size: filesToSend[i].size,
file_type: "image/png",
file_data: await fileToBase64(),
msg_type: "FILE",
contract: props.details.contract,
};
ApiCall.sendFiles(reqData)
.then((res) => {
// if(res.status != 200 || res.data.internal_return < 0){
// setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'})
// return
// }
// setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
})
.catch((error) => {
// setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
})
.finally(() => {
if (i == filesToSend.length - 1) {
setRequestStatus({
loading: false,
status: true,
message: "File(s) Uploaded Successfully",
});
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
}
});
}
setRequestStatus({loading: false, status: true, message: 'File Uploaded Successfully'})
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
})
.catch((error) => {
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
})
.finally(() => {
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
});
};
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
@@ -445,7 +443,7 @@ function ActiveJobs(props) {
<input
type="file"
id="file"
accept="image/*"
accept="image/*,video/*"
style={{ display: "none" }}
onChange={handleFileChange}
/>
+50 -55
View File
@@ -69,7 +69,19 @@ function ActiveJobsMedia(props) {
// IF NO FILE SELECTED RETURN
return;
}
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) {
let fileType = files[0].type.split('/')[0].toLowerCase()
if (fileType == 'video' && files[0].size > Number(process.env.REACT_APP_MAX_VIDEO_FILE_SIZE)) { // return if video file is more than 30mb
setRequestStatus({
loading: false,
status: false,
message: "File must be <= 30mb",
});
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
return;
}
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) { // return if other files is more than 1mb
setRequestStatus({
loading: false,
status: false,
@@ -94,7 +106,8 @@ function ActiveJobsMedia(props) {
return;
}
// INCLUDE FILE IF NO ERROR
setFilesToSend((prev) => [...prev, files[0]]);
// setFilesToSend((prev) => [...prev, files[0]]); //for sending multiple file if need be
setFilesToSend([files[0]])
};
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
@@ -184,60 +197,42 @@ function ActiveJobsMedia(props) {
}, 5000);
}
for (let i = 0; i <= filesToSend.length - 1; i++) {
// Loops through files to send array and trigger upload API call
// const fileToBase64 = async () => {
// // Converts file data to base64 string
// try {
// const base64String = await convertFileToBase64(filesToSend[i]);
// return base64String;
// } catch (error) {
// return false;
// }
// };
const fileToBase64 = async () => {
// Converts file data to base64 string
try {
const base64String = await convertFileToBase64(filesToSend[i]);
return base64String;
} catch (error) {
return false;
}
};
let reqData = {
msg_type: "FILE",
contract: props.details.contract,
file: filesToSend[0],
};
// if(await !fileToBase64()){
// return
// }
let reqData = {
file_name: filesToSend[i].name,
file_size: filesToSend[i].size,
file_type: "image/png",
file_data: await fileToBase64(),
msg_type: "FILE",
contract: props.details.contract,
};
ApiCall.sendFiles(reqData)
.then((res) => {
// if(res.status != 200 || res.data.internal_return < 0){
// setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'})
// return
// }
// setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
})
.catch((error) => {
// setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
})
.finally(() => {
if (i == filesToSend.length - 1) {
setRequestStatus({
loading: false,
status: true,
message: "File(s) Uploaded Successfully",
});
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
}
});
}
ApiCall.sendFilesNew(reqData)
.then((res) => {
if(res.status != 200 || res.data.internal_return < 0){
setRequestStatus({loading: false, status: false, message: 'File could not be sent, try again later'})
return
}
setRequestStatus({loading: false, status: true, message: 'File Uploaded Successfully'})
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
})
.catch((error) => {
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
})
.finally(() => {
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
}, 5000);
});
};
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
@@ -437,7 +432,7 @@ function ActiveJobsMedia(props) {
<input
type="file"
id="file"
accept="image/*"
accept="image/*,video/*"
style={{ display: "none" }}
onChange={handleFileChange}
/>
-7
View File
@@ -60,13 +60,6 @@ const WalletRoutes = () => {
getPaymentHistory();
}, [walletTable]);
console.log(
"Testing all country: ",
allCountries,
"Testing wallet: ",
walletDetails
);
return (
<Layout>
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
+22 -10
View File
@@ -11,7 +11,7 @@ import { useSelector } from "react-redux";
export default function WalletHeader(props) {
const {userDetails: { account_type }} = useSelector((state) => state?.userDetails);
const {userDetails: { account_type, wallet_available_status }} = useSelector((state) => state?.userDetails);
// debugger;
//props.myWalletList.result_list
let { pathname } = useLocation();
@@ -22,6 +22,7 @@ export default function WalletHeader(props) {
props.setBalanceDropdown.toggle();
else navigate("/my-wallet", { replace: true });
}
// console.log('props.myWalletList', wallet_available_status)
return (
<>
{account_type == 'FULL' ?
@@ -49,6 +50,8 @@ export default function WalletHeader(props) {
</h3>
</div>
<div className="content px-7 pb-7">
{/* wallet_available_status == 'WALLET_AVAILABLE' */}
{(wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE') ?
<ul>
{props.myWalletList &&
props.myWalletList?.length > 0 &&
@@ -176,17 +179,25 @@ export default function WalletHeader(props) {
{/* </div>*/}
{/*</li>*/}
</ul>
:
<div className='p-2 w-full flex gap-4 items-center'>
<img className='w-[100px!important] h-auto' src={localImgLoad('images/icons/wallet.svg')} alt='Wallet Icon' />
<p className='text-lg text-red-500'>We do not currently support wallets in your area. We are diligently working on it. </p>
</div>
}
{(wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE') &&
<div className="add-money-btn flex justify-center items-center mt-3">
{/* <button
onClick={() => {
if(pathname == '/my-wallet') props.setBalanceDropdown.toggle()
else navigate('/my-wallet', {replace: true})
}}
type="button"
className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Manage
</button> */}
onClick={() => {
if(pathname == '/my-wallet') props.setBalanceDropdown.toggle()
else navigate('/my-wallet', {replace: true})
}}
type="button"
className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Manage
</button> */}
<Link
to="/my-wallet"
onClick={onWalletClick}
@@ -195,6 +206,7 @@ export default function WalletHeader(props) {
Manage
</Link>
</div>
}
</div>
</div>
</div>
+3 -1
View File
@@ -21,6 +21,8 @@ export default function MobileSidebar({
const marketData = jobLists?.result_list;
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
return (
<div className="w-full h-full">
{/* logo-area */}
@@ -138,7 +140,7 @@ export default function MobileSidebar({
</div>
)}
{userDetails?.account_type !== "FAMILY" && (
{(userDetails?.account_type !== "FAMILY" && walletExist) && (
<>
{!userDetails?.post_jobs ? (
<div
+22 -19
View File
@@ -36,6 +36,7 @@ export default function RightSideBar({ myJobList }) {
};
const { userDetails } = useSelector((state) => state?.userDetails);
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
return (
<>
@@ -129,25 +130,27 @@ export default function RightSideBar({ myJobList }) {
</p>
</div>
</div>
<div className="item flex space-x-3 items-center">
{/* image */}
<div className="w-8 h-8 rounded-full bg-sky-500/50 p-1 flex justify-center items-center">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 50" id="Page">
<path
fillRule="evenodd"
d="M0 13V2a2 2 0 0 1 2-2h64a2 2 0 0 1 2 2v11H0Zm0 4v31a2 2 0 0 0 2 2h20V17H0Zm26 33h40a2 2 0 0 0 2-2V17H26v33Z"
fill="#ffffff"
className="color000000 svgShape"
></path>
</svg>
{ Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1 &&
<div className="item flex space-x-3 items-center">
{/* image */}
<div className="w-8 h-8 rounded-full bg-sky-500/50 p-1 flex justify-center items-center">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 50" id="Page">
<path
fillRule="evenodd"
d="M0 13V2a2 2 0 0 1 2-2h64a2 2 0 0 1 2 2v11H0Zm0 4v31a2 2 0 0 0 2 2h20V17H0Zm26 33h40a2 2 0 0 0 2-2V17H26v33Z"
fill="#ffffff"
className="color000000 svgShape"
></path>
</svg>
</div>
{/* name */}
<div>
<p className="text-thin-light-gray text-base font-medium">
<NavLink to="/yourpage">My Page</NavLink>
</p>
</div>
</div>
{/* name */}
<div>
<p className="text-thin-light-gray text-base font-medium">
<NavLink to="/yourpage">My Page</NavLink>
</p>
</div>
</div>
}
</>
)}
@@ -278,7 +281,7 @@ export default function RightSideBar({ myJobList }) {
</div>
{/*JOB LINKS*/}
{userDetails?.account_type !== "FAMILY" &&
{(userDetails?.account_type !== "FAMILY" && walletExist) &&
myJobList?.data?.result_list?.length > 0 && (
<div className="top-platform mt-6 bg-white dark:bg-dark-white rounded-2xl py-8 w-full 2xl:mb-10 2xl:border-none border ">
{/* heading */}
+3 -1
View File
@@ -22,6 +22,8 @@ export default function Sidebar({
const marketData = jobLists?.result_list;
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
useEffect(() => {
const title = document.querySelectorAll(".menu-setting-items .heading");
if (sidebar) {
@@ -157,7 +159,7 @@ export default function Sidebar({
</div>
</div>
)}
{userDetails?.account_type !== "FAMILY" && (
{(userDetails?.account_type !== "FAMILY" && walletExist) && (
<>
{!userDetails?.post_jobs ? (
<div
+18
View File
@@ -908,6 +908,24 @@ class usersService {
return this.postAuxEnd("/uploads", postData);
}
// FUNCTION FOR NEW FILE UPLOAD
sendFilesNew(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: apiConst.WRENCHBOARD_CONTRACT_MESSAGE,
...reqData,
};
const formData = new FormData();
for (let data in postData) {
formData.append(data, postData[data]);
}
return this.postAuxEnd("/upload/contract", formData, true);
}
// FUNCTION TO UPLOAD RESOURCE FILES
uploadFile(reqData) {
var postData = {
+14
View File
@@ -1,5 +1,19 @@
import {useEffect} from 'react'
import WalletRoutes from "../components/MyWallet/Wallet";
import { useSelector } from "react-redux";
import {useNavigate} from 'react-router-dom'
export default function MyWalletPage() {
const {userDetails: { account_type, wallet_available_status }} = useSelector((state) => state?.userDetails);
const navigate = useNavigate()
useEffect(()=>{
let walletExist = wallet_available_status || localStorage.getItem('wallet_available_status')
console.log(walletExist)
if(account_type == 'FULL' && walletExist != 'WALLET_AVAILABLE'){
navigate('/', {replace: true})
}
},[])
return <WalletRoutes />;
}