Compare commits

...

4 Commits

Author SHA1 Message Date
victorAnumudu feca311e7f adjusted market modal 2025-07-17 21:47:42 +01:00
ameye bd8f25b9e8 Merge branch 'market-popout-design' of WrenchBoard/Users-Wrench into master 2025-07-17 20:03:45 +00:00
victorAnumudu b26c0a238e market popout design changed 2025-07-17 20:14:49 +01:00
ameye 8841e36136 Merge branch 'height-fix' of WrenchBoard/Users-Wrench into master 2025-07-14 17:10:03 +00:00
2 changed files with 88 additions and 97 deletions
@@ -57,6 +57,7 @@ export default function LockJob({
</div> </div>
) : ( ) : (
<> <>
<div className='md:grid md:grid-cols-4'>
<div className="px-4 py-2 w-full md:col-span-3 md:border-r-1"> <div className="px-4 py-2 w-full md:col-span-3 md:border-r-1">
<div className="min-h-[200px]"> <div className="min-h-[200px]">
<h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide"> <h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide">
@@ -277,6 +278,7 @@ export default function LockJob({
</div> </div>
</div> </div>
</div> </div>
</div>
</> </>
)} )}
</> </>
@@ -145,7 +145,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
<CloseIcon onClose={onClose} /> <CloseIcon onClose={onClose} />
</div> </div>
<div className="md:grid md:grid-cols-4 bg-white dark:bg-dark-white text-slate-900 dark:text-white rounded-lg"> <div className="bg-white dark:bg-dark-white text-slate-900 dark:text-white rounded-lg">
{details?.offer_depend_uid ? {details?.offer_depend_uid ?
<LockJob <LockJob
marketPlaceProduct={marketPlaceProduct} marketPlaceProduct={marketPlaceProduct}
@@ -160,7 +160,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
/> />
: :
<> <>
<div className="px-4 py-2 w-full md:col-span-3 md:border-r-1"> <div className="px-4 py-2 w-full">
<div className="min-h-[300px]"> <div className="min-h-[300px]">
<h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide"> <h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide">
{details?.offer_depend_uid && <i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>} {details?.offer_depend_uid && <i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>}
@@ -186,14 +186,14 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
danger: true, danger: true,
}, },
].map(({ name, content, danger }, idx) => ( ].map(({ name, content, danger }, idx) => (
<div className={`my-3 md:flex items-start`} key={idx}> <div className={`my-3 flex-col gap-1`} key={idx}>
<label className="py-2 job-label w-full md:w-[19%]"> <label className="py-2 job-label w-full md:w-[19%]">
{name} {name}
</label> </label>
<div <div
className={`w-full p-2 md:w-3/4 text-slate-900 dark:text-white market-pop rounded-2xl ${ className={`w-full p-2 text-slate-900 dark:text-white market-pop rounded-2xl ${
name == "Description" name == "Description"
? "min-h-[100px] max-h-[100px] h-full overflow-y-auto break-words bg-slate-50" ? "min-h-[60px] max-h-[75px] h-full overflow-y-auto break-words bg-slate-50"
: name == "Delivery Detail" ? " overflow-y-auto h-full min-h-[200px] max-h-[200px] bg-slate-50" : name == "Delivery Detail" ? " overflow-y-auto h-full min-h-[200px] max-h-[200px] bg-slate-50"
: "h-full flex items-center" : "h-full flex items-center"
}`} }`}
@@ -233,122 +233,111 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
))} ))}
</div> </div>
<hr className='my-1' /> <hr className='my-1' />
<div className='w-full'> <div className='w-full grid grid-cols-1 md:grid-cols-3 gap-4 md:gap-8 items-center'>
<label className="job-label w-full flex gap-2 items-center"> <div className='col-span-1 md:col-span-2 flex flex-col justify-center gap-2'>
If you have any questions about this task: <label className="job-label w-full flex gap-2 items-center">
<span className={`text-sm ${marketMsg.state ? 'text-[#57cd89]' : 'text-red-500'}`}> If you have any questions about this task:
{marketMsg.state && "Message Sent!"} <span className={`text-sm ${marketMsg.state ? 'text-[#57cd89]' : 'text-red-500'}`}>
{errMsg.market && "Failed to send"} {marketMsg.state && "Message Sent!"}
</span> {errMsg.market && "Failed to send"}
</label> </span>
<div className="w-full flex items-center gap-3"> </label>
<div className="w-full"> <div className="w-full flex items-center gap-3">
<textarea <div className="w-full">
className={`p-1 w-full text-sm text-slate-900 dark:text-white ${ <textarea
marketMsg.loading && "italic text-[#9CA3AF]" className={`p-1 w-full text-sm text-slate-900 dark:text-white ${
} bg-transparent outline-none border-2 border-slate-300 rounded-md`} marketMsg.loading && "italic text-[#9CA3AF]"
rows="3" } bg-transparent outline-none border-2 border-slate-300 rounded-md`}
style={{ resize: "none" }} rows="3"
placeholder="Enter message here ..." style={{ resize: "none" }}
value={marketMsg.loading ? "Sending..." : textValue} placeholder="Enter message here ..."
onChange={handleInputChange} value={marketMsg.loading ? "Sending..." : textValue}
/> onChange={handleInputChange}
</div> />
<div className="relative flex flex-col"> </div>
<button <div className="relative flex flex-col">
className="rounded-full flex justify-center items-center w-12 h-11 bg-yellow-500 text-white" <button
name="market-message" className="rounded-full flex justify-center items-center w-12 h-11 bg-yellow-500 text-white"
onClick={MarketDetail} name="market-message"
disabled={marketMsg.loading} onClick={MarketDetail}
> disabled={marketMsg.loading}
{marketMsg.loading ? (
<LoadingSpinner size={5} color="white" />
) : (
// "Send Message"
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 11 20"
id="Arrow"
className="w-[0.7rem]"
> >
<path {marketMsg.loading ? (
fillRule="evenodd" <LoadingSpinner size={5} color="white" />
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="" // "Send Message"
className="color000000 svgShape fill-[#fff]" <svg
></path> xmlns="http://www.w3.org/2000/svg"
</svg> viewBox="0 0 11 20"
)} id="Arrow"
</button> className="w-[0.7rem]"
{/* <span className="text-sm text-[#57cd89]"> >
{marketMsg.state && "Sent!"} <path
{errMsg.market && "Failed"} fillRule="evenodd"
</span> */} 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> </div>
</div>
</div> <div className="span-1 flex flex-col justify-center mb-4 gap-2">
<p className="flex items-center tracking-wide">
<div className="py-2 w-full md:col-span-1 h-full flex flex-col rounded-2xl"> <span className="job-label">Interest Count: </span> <b className="ml-1">{interestCount.length > 0 ? interestCount[0].interest_count : '0'}</b>
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] px-4 rounded-md w-full h-full 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?
</p> </p>
<hr /> {/* <hr /> */}
<button <button
className="btn-gradient text-white px-2 py-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl" className="btn-gradient text-white p-1 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl"
name="market-interest" name="market-interest"
onClick={ManageInterest} onClick={ManageInterest}
> >
{" "} {" "}
<div className="flex md:flex-col justify-center gap-2"> <div className="flex md:flex-col justify-center gap-2">
<span>Notify</span> <span>I am Interested</span>
<span>Owner</span> {/* <span>Owner</span> */}
</div> </div>
</button> </button>
<>
{manageInt.loading ? (
<p className="text-sm italic">please wait...</p>
) : (
<>
{manageInt?.msg !== "" && (
<p
className={`text-sm italic ${
manageInt?.state ? "text-green-500" : "text-red-500"
}`}
>
{manageInt?.msg}
</p>
)}
</>
)}
</>
</div>
<div className="text-slate-900">
<p className="flex items-center tracking-wide">
<span className="job-label">Interest: </span> <b className="ml-1">{interestCount.length > 0 ? interestCount[0].interest_count : '0'}</b>
</p>
<hr />
<p className="my-1 flex flex-col">
<span className="job-label">Expire: </span>
<span> {new Date(details.expire).toLocaleString()} </span>
</p>
</div> </div>
</div> </div>
<div>
{manageInt.loading ? (
<p className="text-sm italic">please wait...</p>
) : (
<>
{manageInt?.msg !== "" && (
<p
className={`text-sm italic ${
manageInt?.state ? "text-green-500" : "text-red-500"
}`}
>
{manageInt?.msg}
</p>
)}
</>
)}
</div>
</div> </div>
</> </>
} }
</div> </div>
<div className="modal-footer-wrapper"> <div className="modal-footer-wrapper flex justify-between gap-2 items-center">
<div className="text-slate-900">
<p className="my-1 flex flex-col">
<span className="job-label">Expire: </span>
<span> {new Date(details.expire).toLocaleString()} </span>
</p>
</div>
<button <button
className="custom-btn bg-transparent border border-red-500 text-red-500 ml-auto" className="custom-btn bg-transparent border border-red-500 text-red-500 ml-auto"
name="cancel" name="cancel"
onClick={onClose} onClick={onClose}
> >
Cancel Close
</button> </button>
</div> </div>
</div> </div>