Compare commits

...

19 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
victorAnumudu 05453661ee job thumbnail position changed 2024-05-31 13:33:01 +01:00
ameye aee1b9e3bb Merge branch 'job-detail-min-height' of WrenchBoard/Users-Wrench into master 2024-05-30 16:59:29 +00:00
victorAnumudu 9a0dc0d01a Job detail min height implemented 2024-05-30 17:48:52 +01:00
ameye a467626fae Merge branch 'delivery-details' of WrenchBoard/Users-Wrench into master 2024-05-30 13:41:08 +00:00
19 changed files with 288 additions and 205 deletions
+6 -2
View File
@@ -72,7 +72,8 @@ REACT_APP_APPLE_SOCIAL_LOGIN=0
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0 REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
#File Handling #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 REACT_APP_TOTAL_NUM_FILE=4
#Auth Text(s) #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_FAM_GAME_LINK='https://games.wrenchboard.com'
# REACT APP CUSTOMTIMER # 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_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_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_TOTAL_NUM_FILE=4
REACT_APP_LOGOUT_TEXT="Sign Out" 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_FAM_GAME_LINK='https://games.wrenchboard.com'
# REACT APP CUSTOMTIMER # 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 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_TOTAL_NUM_FILE=4
REACT_APP_LOGOUT_TEXT="Sign Out" 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_FAM_GAME_LINK='https://games.wrenchboard.com'
# REACT APP CUSTOMTIMER # 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("member_id", `${res.data.member_id}`);
localStorage.setItem("uid", `${res.data.uid}`); localStorage.setItem("uid", `${res.data.uid}`);
localStorage.setItem("session_token", `${res.data.session}`); localStorage.setItem("session_token", `${res.data.session}`);
localStorage.setItem("wallet_available_status", `${res.data.wallet_available_status}`);
if (res.data?.account_type == "FAMILY") { if (res.data?.account_type == "FAMILY") {
sessionStorage.setItem("family_uid", res.data?.family_uid); sessionStorage.setItem("family_uid", res.data?.family_uid);
sessionStorage.setItem("parent_uid", res.data?.parent_uid); sessionStorage.setItem("parent_uid", res.data?.parent_uid);
+39 -33
View File
@@ -34,7 +34,7 @@ export default function AvailableJobsCard({
<> <>
{contentDisplay == "grid" ? ( {contentDisplay == "grid" ? (
<div <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 || "" className || ""
}`} }`}
> >
@@ -42,50 +42,56 @@ export default function AvailableJobsCard({
onClick={() => { onClick={() => {
setMarketPopUp({ show: true, data: datas }); 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"
> >
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize"> <div className='w-full flex items-center gap-4'>
{datas.title} <div className='min-w-[60px] min-h-[60px] max-w-[60px] max-h-[60px] rounded-full overflow-hidden'>
</h1> <img className='w-full h-full object-cover' src={image} alt='Job Image' />
<div className="card-two-info flex justify-between items-center">
<div className="owned-by flex space-x-2 items-center">
<div>
<p className="text-thin-light-gray text-sm leading-3">
Added
</p>
<p className="text-base text-dark-gray dark:text-white">
{new Date(datas.offer_added).toLocaleDateString()}
</p>
</div>
</div> </div>
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div> <div className='w-full'>
<div className="created-by flex space-x-2 items-center flex-row-reverse"> <h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
<div> {datas.title}
<p className="text-thin-light-gray text-sm leading-3 text-right"> </h1>
Expires
</p> <div className="card-two-info flex justify-between items-center">
<p className="text-base text-dark-gray dark:text-white text-right"> <div className="owned-by flex space-x-2 items-center">
{new Date(datas.expire).toLocaleDateString()} <div>
</p> <p className="text-thin-light-gray text-sm leading-3">
Added
</p>
<p className="text-base text-dark-gray dark:text-white">
{new Date(datas.offer_added).toLocaleDateString()}
</p>
</div>
</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">
Expires
</p>
<p className="text-base text-dark-gray dark:text-white text-right">
{new Date(datas.expire).toLocaleDateString()}
</p>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div className="thumbnail-area w-full"> <div className="thumbnail-area w-full">
<div <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={{ // style={{
backgroundImage: `url('${image}')`, // backgroundImage: `url('${image}')`,
}} // }}
> >
<div className="flex justify-center bg-slate-100 p-2 rounded-md"> <div className="flex flex-col h-full bg-slate-100 p-2 rounded-md">
{datas.description} <p>{datas.description}</p>
</div> </div>
</div> </div>
</div> </div>
<div className="details-area"> <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 justify-between">
<div className="flex items-center space-x-2"> <div className="flex items-center space-x-2">
<div> <div>
+1 -1
View File
@@ -20,7 +20,7 @@ export default function MainSection({
); );
const [tab, setTab] = useState(Object.keys(marketCategories)[0]); 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 // Convert to array in order to map
const mappedArray = Object.entries(marketCategories).map(([key, value]) => { 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="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"> <div className="w-full flex flex-col justify-center pb-4 gap-2">
<p className="job-label w-full"> <p className="job-label w-full">
Interested in the task? Interested?
</p> </p>
<hr /> <hr />
<button <button
@@ -262,9 +262,8 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
> >
{" "} {" "}
<div className="w-full flex flex-col justify-between gap-2"> <div className="w-full flex flex-col justify-between gap-2">
<span>Send</span> <span>Notify</span>
<span>Interest</span> <span>Owner</span>
<span>Request</span>
</div> </div>
</button> </button>
<> <>
+53 -55
View File
@@ -75,7 +75,19 @@ function ActiveJobs(props) {
// IF NO FILE SELECTED RETURN // IF NO FILE SELECTED RETURN
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({ setRequestStatus({
loading: false, loading: false,
status: false, status: false,
@@ -100,7 +112,8 @@ function ActiveJobs(props) {
return; return;
} }
// INCLUDE FILE IF NO ERROR // 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 // FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
@@ -189,61 +202,46 @@ function ActiveJobs(props) {
setRequestStatus({ loading: false, status: false, message: "" }); setRequestStatus({ loading: false, status: false, message: "" });
}, 5000); }, 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++) { let reqData = {
// Loops through files to send array and trigger upload API call // 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 () => { ApiCall.sendFilesNew(reqData)
// Converts file data to base64 string .then((res) => {
try { if(res.status != 200 || res.data.internal_return < 0){
const base64String = await convertFileToBase64(filesToSend[i]); setRequestStatus({loading: false, status: false, message: 'File could not be sent, try again later'})
return base64String; return
} catch (error) {
return false;
} }
}; setRequestStatus({loading: false, status: true, message: 'File Uploaded Successfully'})
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
// if(await !fileToBase64()){ // setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
// return })
// } .catch((error) => {
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
let reqData = { })
file_name: filesToSend[i].name, .finally(() => {
file_size: filesToSend[i].size, setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
file_type: "image/png", props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
file_data: await fileToBase64(), setTimeout(() => {
msg_type: "FILE", setRequestStatus({ loading: false, status: false, message: "" });
contract: props.details.contract, }, 5000);
}; });
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);
}
});
}
}; };
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED // FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
@@ -445,7 +443,7 @@ function ActiveJobs(props) {
<input <input
type="file" type="file"
id="file" id="file"
accept="image/*" accept="image/*,video/*"
style={{ display: "none" }} style={{ display: "none" }}
onChange={handleFileChange} onChange={handleFileChange}
/> />
+50 -55
View File
@@ -69,7 +69,19 @@ function ActiveJobsMedia(props) {
// IF NO FILE SELECTED RETURN // IF NO FILE SELECTED RETURN
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({ setRequestStatus({
loading: false, loading: false,
status: false, status: false,
@@ -94,7 +106,8 @@ function ActiveJobsMedia(props) {
return; return;
} }
// INCLUDE FILE IF NO ERROR // 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 // FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
@@ -184,60 +197,42 @@ function ActiveJobsMedia(props) {
}, 5000); }, 5000);
} }
for (let i = 0; i <= filesToSend.length - 1; i++) { // const fileToBase64 = async () => {
// Loops through files to send array and trigger upload API call // // Converts file data to base64 string
// try {
// const base64String = await convertFileToBase64(filesToSend[i]);
// return base64String;
// } catch (error) {
// return false;
// }
// };
const fileToBase64 = async () => { let reqData = {
// Converts file data to base64 string msg_type: "FILE",
try { contract: props.details.contract,
const base64String = await convertFileToBase64(filesToSend[i]); file: filesToSend[0],
return base64String; };
} catch (error) {
return false;
}
};
// if(await !fileToBase64()){ ApiCall.sendFilesNew(reqData)
// return .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'})
let reqData = { return
file_name: filesToSend[i].name, }
file_size: filesToSend[i].size, setRequestStatus({loading: false, status: true, message: 'File Uploaded Successfully'})
file_type: "image/png", // props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
file_data: await fileToBase64(), // setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
msg_type: "FILE", })
contract: props.details.contract, .catch((error) => {
}; setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
})
ApiCall.sendFiles(reqData) .finally(() => {
.then((res) => { setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
// if(res.status != 200 || res.data.internal_return < 0){ props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
// setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'}) setTimeout(() => {
// return setRequestStatus({ loading: false, status: false, message: "" });
// } }, 5000);
// 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);
}
});
}
}; };
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED // FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
@@ -437,7 +432,7 @@ function ActiveJobsMedia(props) {
<input <input
type="file" type="file"
id="file" id="file"
accept="image/*" accept="image/*,video/*"
style={{ display: "none" }} style={{ display: "none" }}
onChange={handleFileChange} onChange={handleFileChange}
/> />
@@ -35,7 +35,7 @@ export default function JobDetailPopout({action, situation, jobDetail}) {
</svg> </svg>
</button> </button>
</div> </div>
<div className="modal-body-wrapper h-[auto!important]"> <div className="modal-body-wrapper">
<p className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'>{jobDetail}</p> <p className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'>{jobDetail}</p>
</div> </div>
<div className="modal-footer-wrapper justify-end"> <div className="modal-footer-wrapper justify-end">
+37 -11
View File
@@ -122,17 +122,43 @@ export default function MyJobTable({ className, ActiveJobList, Account, imageSer
</div> </div>
<div className="flex justify-center items-center py-4 px-2"> <div className="flex justify-center items-center py-4 px-2">
<button {accountType ?
type="button" <button
onClick={() => { type="button"
navigate("/manage-active-job", { onClick={() => {
state: { ...task, pathname }, navigate("/manage-active-job", {
}); state: { ...task, pathname },
}} });
className="px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white" }}
> className="px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
{task.owner_status == 'OWNER' ? 'Manage' : 'Send Updates'} >
</button> {task.owner_status == 'OWNER' ? 'Manage' : 'Send Updates'}
</button>
:
<button
type="button"
onClick={() => {
navigate("/manage-active-job", {
state: { ...task, pathname },
});
}}
className="w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 11 20"
id="Arrow"
className="w-[0.7rem]"
>
<path
fillRule="evenodd"
d="M.366 19.708c.405.39 1.06.39 1.464 0l8.563-8.264a1.95 1.95 0 0 0 0-2.827L1.768.292A1.063 1.063 0 0 0 .314.282a.976.976 0 0 0-.011 1.425l7.894 7.617a.975.975 0 0 1 0 1.414L.366 18.295a.974.974 0 0 0 0 1.413"
// fill=""
className="color000000 svgShape fill-[#fff]"
></path>
</svg>
</button>
}
</div> </div>
</div> </div>
); );
-7
View File
@@ -60,13 +60,6 @@ const WalletRoutes = () => {
getPaymentHistory(); getPaymentHistory();
}, [walletTable]); }, [walletTable]);
console.log(
"Testing all country: ",
allCountries,
"Testing wallet: ",
walletDetails
);
return ( return (
<Layout> <Layout>
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}> <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) { 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; // debugger;
//props.myWalletList.result_list //props.myWalletList.result_list
let { pathname } = useLocation(); let { pathname } = useLocation();
@@ -22,6 +22,7 @@ export default function WalletHeader(props) {
props.setBalanceDropdown.toggle(); props.setBalanceDropdown.toggle();
else navigate("/my-wallet", { replace: true }); else navigate("/my-wallet", { replace: true });
} }
// console.log('props.myWalletList', wallet_available_status)
return ( return (
<> <>
{account_type == 'FULL' ? {account_type == 'FULL' ?
@@ -49,6 +50,8 @@ export default function WalletHeader(props) {
</h3> </h3>
</div> </div>
<div className="content px-7 pb-7"> <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> <ul>
{props.myWalletList && {props.myWalletList &&
props.myWalletList?.length > 0 && props.myWalletList?.length > 0 &&
@@ -176,17 +179,25 @@ export default function WalletHeader(props) {
{/* </div>*/} {/* </div>*/}
{/*</li>*/} {/*</li>*/}
</ul> </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"> <div className="add-money-btn flex justify-center items-center mt-3">
{/* <button {/* <button
onClick={() => { onClick={() => {
if(pathname == '/my-wallet') props.setBalanceDropdown.toggle() if(pathname == '/my-wallet') props.setBalanceDropdown.toggle()
else navigate('/my-wallet', {replace: true}) else navigate('/my-wallet', {replace: true})
}} }}
type="button" type="button"
className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white" className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
> >
Manage Manage
</button> */} </button> */}
<Link <Link
to="/my-wallet" to="/my-wallet"
onClick={onWalletClick} onClick={onWalletClick}
@@ -195,6 +206,7 @@ export default function WalletHeader(props) {
Manage Manage
</Link> </Link>
</div> </div>
}
</div> </div>
</div> </div>
</div> </div>
+3 -1
View File
@@ -21,6 +21,8 @@ export default function MobileSidebar({
const marketData = jobLists?.result_list; const marketData = jobLists?.result_list;
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length; let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
return ( return (
<div className="w-full h-full"> <div className="w-full h-full">
{/* logo-area */} {/* logo-area */}
@@ -138,7 +140,7 @@ export default function MobileSidebar({
</div> </div>
)} )}
{userDetails?.account_type !== "FAMILY" && ( {(userDetails?.account_type !== "FAMILY" && walletExist) && (
<> <>
{!userDetails?.post_jobs ? ( {!userDetails?.post_jobs ? (
<div <div
+22 -19
View File
@@ -36,6 +36,7 @@ export default function RightSideBar({ myJobList }) {
}; };
const { userDetails } = useSelector((state) => state?.userDetails); const { userDetails } = useSelector((state) => state?.userDetails);
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
return ( return (
<> <>
@@ -129,25 +130,27 @@ export default function RightSideBar({ myJobList }) {
</p> </p>
</div> </div>
</div> </div>
<div className="item flex space-x-3 items-center"> { Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1 &&
{/* image */} <div className="item flex space-x-3 items-center">
<div className="w-8 h-8 rounded-full bg-sky-500/50 p-1 flex justify-center items-center"> {/* image */}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 50" id="Page"> <div className="w-8 h-8 rounded-full bg-sky-500/50 p-1 flex justify-center items-center">
<path <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 50" id="Page">
fillRule="evenodd" <path
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" fillRule="evenodd"
fill="#ffffff" 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"
className="color000000 svgShape" fill="#ffffff"
></path> className="color000000 svgShape"
</svg> ></path>
</svg>
</div>
{/* name */}
<div>
<p className="text-thin-light-gray text-base font-medium">
<NavLink to="/yourpage">My Page</NavLink>
</p>
</div>
</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> </div>
{/*JOB LINKS*/} {/*JOB LINKS*/}
{userDetails?.account_type !== "FAMILY" && {(userDetails?.account_type !== "FAMILY" && walletExist) &&
myJobList?.data?.result_list?.length > 0 && ( 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 "> <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 */} {/* heading */}
+3 -1
View File
@@ -22,6 +22,8 @@ export default function Sidebar({
const marketData = jobLists?.result_list; const marketData = jobLists?.result_list;
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length; let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
useEffect(() => { useEffect(() => {
const title = document.querySelectorAll(".menu-setting-items .heading"); const title = document.querySelectorAll(".menu-setting-items .heading");
if (sidebar) { if (sidebar) {
@@ -157,7 +159,7 @@ export default function Sidebar({
</div> </div>
</div> </div>
)} )}
{userDetails?.account_type !== "FAMILY" && ( {(userDetails?.account_type !== "FAMILY" && walletExist) && (
<> <>
{!userDetails?.post_jobs ? ( {!userDetails?.post_jobs ? (
<div <div
+1 -1
View File
@@ -178,7 +178,7 @@
/* Modal Body section */ /* Modal Body section */
.modal-body-wrapper { .modal-body-wrapper {
@apply w-full h-full overflow-y-auto flex flex-col items-center px-10 p-2 @apply w-full min-h-[300px] h-full overflow-y-auto flex flex-col items-center px-10 p-2
} }
/* modal footer */ /* modal footer */
+18
View File
@@ -908,6 +908,24 @@ class usersService {
return this.postAuxEnd("/uploads", postData); 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 // FUNCTION TO UPLOAD RESOURCE FILES
uploadFile(reqData) { uploadFile(reqData) {
var postData = { var postData = {
+14
View File
@@ -1,5 +1,19 @@
import {useEffect} from 'react'
import WalletRoutes from "../components/MyWallet/Wallet"; import WalletRoutes from "../components/MyWallet/Wallet";
import { useSelector } from "react-redux";
import {useNavigate} from 'react-router-dom'
export default function MyWalletPage() { 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 />; return <WalletRoutes />;
} }