Compare commits

...

4 Commits

Author SHA1 Message Date
victorAnumudu 9ec8855ed6 flat box fixed for offer list 2024-09-26 19:07:47 +01:00
victorAnumudu 06450808ed Merge with master 2024-09-26 18:42:32 +01:00
victorAnumudu 7eecd34a5e initial commit 2024-09-26 18:41:30 +01:00
ameye ab3693fc0b Merge branch 'offer-list-flat-banner' of WrenchBoard/Users-Wrench into master 2024-09-26 17:00:15 +00:00
3 changed files with 42 additions and 20 deletions
+11 -12
View File
@@ -44,13 +44,13 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
);
let image = `${imageServer}${localStorage.getItem("session_token")}/job/${item.job_uid}`
return (
<div key={item.id}>
{index < 3 &&
<NewOfferCard datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
}
</div>
)
if(index < 3){
return (
<div key={item.offer_uid}>
<NewOfferCard datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
</div>
)
}
})}
</>
@@ -89,12 +89,11 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
let image = `${imageServer}${localStorage.getItem("session_token")}/job/${item.job_uid}`
if(index >= 3) {
return
(<div key={item.id}>
return(
<div key={item.offer_uid}>
<NewOfferCardFlat datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
</div>)
}else{
null
</div>
)
}
})}
</>
+14 -3
View File
@@ -20,6 +20,9 @@ export default function FamilyTableNew() {
let { pathname } = useLocation();
const queryParams = new URLSearchParams(location?.search);
const preSelectedTab = queryParams.get("tab");
// Initial state for family details
const initialDetailState = {
loading: false,
@@ -55,9 +58,9 @@ export default function FamilyTableNew() {
// Array of tab names
const tabs = [
{ id: 1, name: "Tasks" },
{ id: 2, name: "Waiting" },
{ id: 3, name: "Pending" },
{ id: 1, name: "tasks" },
{ id: 2, name: "waiting" },
{ id: 3, name: "pending" },
];
// State for the currently selected tab
@@ -94,6 +97,14 @@ export default function FamilyTableNew() {
// Selected tab component based on the current 'tab'
const selectedTabComponent = tabComponents[tab] || defaultTabComponent;
useEffect(()=>{ // EFFECT TO CHECK FOR PRE SELECTED TAB AND DEFAULT TO IT OR TO DEFAULT IF NOT AVALIABLE
if(preSelectedTab && tabs.map(item => item.name.toLowerCase()).includes(preSelectedTab.toLowerCase())){
setTab(preSelectedTab)
}else{
setTab(tabs[0].name)
}
},[])
// Effect to manage active family task details
useEffect(() => {
+17 -5
View File
@@ -177,19 +177,31 @@ function OfferJobPopout({ details, onClose, situation }) {
</div>
</div>
<p className="text-lg my-5 font-semibold text-slate-900 dark:text-white tracking-wide line-clamp-1">
<p className="text-lg my-2 font-semibold text-slate-900 dark:text-white tracking-wide max-h-[200px] overflow-y-auto">
{details.title}
</p>
<div className="my-2 md:flex">
<Detail label="Description" value={details.description} />
<label className='job-label w-full md:w-[150px]'>Description</label>
<p className={`p-1 w-full md:w-3/4 text-sm text-slate-900 dark:text-white max-h-[200px] overflow-y-auto`}>{details.description}</p>
{/* <Detail label="Description" value={details.description} /> */}
</div>
<div className="my-2 md:flex">
<label className='job-label w-full md:w-[150px]'>Detail</label>
<p className={`p-1 w-full md:w-3/4 text-sm text-slate-900 dark:text-white min-h-[100px] max-h-[200px] overflow-y-auto border boder-2 rounded-md`}>{details.job_description || details.job_detail}</p>
<div className="my-2 md:flx">
{/* <label className='job-label w-full md:w-[150px]'>Detail</label>
<p className={`p-1 w-full md:w-3/4 text-sm text-slate-900 dark:text-white min-h-[100px] max-h-[200px] overflow-y-auto border-2 rounded-md`}>{details.job_description || details.job_detail}</p> */}
<label className="w-full text-slate-900 dark:text-white tracking-wide font-semibold">
Delivery Detail
</label>
<textarea
className={`p-2 w-full text-sm text-slate-900 dark:text-white bg-transparent outline-none border border-slate-300 rounded-md`}
rows="5"
style={{ resize: "none" }}
value={details.job_description || details.job_detail}
readOnly
/>
</div>
</div>