diff --git a/src/components/Cards/AvailableJobsCard.jsx b/src/components/Cards/AvailableJobsCard.jsx index 0e860b7..04523e7 100644 --- a/src/components/Cards/AvailableJobsCard.jsx +++ b/src/components/Cards/AvailableJobsCard.jsx @@ -10,6 +10,7 @@ export default function AvailableJobsCard({ hidden = false, contentDisplay, image_server, + marketPlaceProduct }) { //debugger; const [marketPopUp, setMarketPopUp] = useState({ show: false, data: {} }); @@ -222,6 +223,7 @@ export default function AvailableJobsCard({ setMarketPopUp({ show: false, data: {} }); }} situation={marketPopUp.show} + marketPlaceProduct={marketPlaceProduct} /> )} diff --git a/src/components/MarketPlace/MainSection.jsx b/src/components/MarketPlace/MainSection.jsx index 837380f..8878039 100644 --- a/src/components/MarketPlace/MainSection.jsx +++ b/src/components/MarketPlace/MainSection.jsx @@ -150,6 +150,7 @@ export default function MainSection({ contentDisplay={contentDisplay} image_server={image_server} datas={datum} + marketPlaceProduct={marketPlaceProduct} /> )) diff --git a/src/components/MarketPlace/PopUp/LockJob.jsx b/src/components/MarketPlace/PopUp/LockJob.jsx new file mode 100644 index 0000000..cf41baa --- /dev/null +++ b/src/components/MarketPlace/PopUp/LockJob.jsx @@ -0,0 +1,252 @@ +import React, {useEffect, useState} from 'react' +import { PriceFormatter } from "../../Helpers/PriceFormatter"; +import usersService from "../../../services/UsersService"; +import LoadingSpinner from "../../Spinners/LoadingSpinner"; + + +export default function LockJob({details, marketPlaceProduct, ManageInterest, manageInt, handleInputChange, MarketDetail, marketMsg, errMsg, textValue}) { + const apiCall = new usersService() + + const [completedTask, setCompletedTask] = useState({ + loading: true, + data: [] + }) + + let thePrice = PriceFormatter( + details?.price * 0.01, + details?.currency_code, + details?.currency + ); + + let cleanedText = details?.job_description + ?.replace(/</g, "<") + .replace(/>/g, ">") + .replace(/"/g, '"') + .replace(/&/g, "&"); + + let dependOn = marketPlaceProduct?.filter(item => item?.job_uid == details?.offer_depend_uid)[0] + + useEffect(()=>{ + apiCall.getVerifyCompletedTask({offer_depend_uid:details?.offer_depend_uid}).then(res => { + console.log('RES', res.data) + setCompletedTask({loading:false, data:res?.data?.result_list}) + }).catch(err =>{ + setCompletedTask({loading:false, data:[]}) + }) + },[]) + + return ( + <> + {completedTask.loading ? +
+ +
+ : + <> +
+
+

+ {details?.offer_depend_uid && } + {details?.title} +

+ + {/* INPUT SECTION */} + {[ + { + name: "Description", + content: details.description, + }, + { + name: "", + content: { + text: `Timeline: ${details.timeline_days} day(s) -- `, + bold: `Budget: ${thePrice}`, + }, + }, + { + name: "Delivery Detail", + content: cleanedText, + danger: true, + }, + ].map(({ name, content, danger }, idx) => ( +
+ +
+ {danger ? ( +

+ ) : ( +

+ {name !== "Delivery Detail" ? ( + <> + {typeof content !== "object" ? content : null} + {typeof content === "object" && ( + <> + {/*


*/} + + + {content?.text} + {thePrice} + + + {/*
*/} + + )} + + ) : ( + "" + )} +

+ )} +
+
+ ))} +
+
+ {completedTask.loading ? +

Loading...

+ :completedTask?.data?.filter(item => item?.job_uid == details.offer_depend_uid).length > 0 ? +
+ +
+
+