Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d3b1462fe3 | |||
| 748546641d | |||
| 48a50fd47c | |||
| e87cb95b43 | |||
| 7638d68a7d | |||
| 3541363f9f | |||
| 30ce6a7d6e | |||
| 115366672a |
@@ -78,11 +78,12 @@ export default function SocketIOContextProvider({children}) {
|
||||
});
|
||||
|
||||
socket.on("marketjob_actions", (data) => { // Triggers refresh on owner side, when somebody sends/shows interest in a job
|
||||
// let user_uid = userDetails.account_type == 'FULL' ? userDetails.uid : sessionStorage.getItem('family_uid') // gets user UID
|
||||
let user_uid = userDetails.account_type == 'FULL' ? userDetails.uid : sessionStorage.getItem('family_uid') // gets user UID
|
||||
let {message} = data
|
||||
if(message.action == "REFRESH_OFFERS" && message.audience == "MERCHANT"){ // for refreshing job owner offer interest list when any worker sends interest
|
||||
if(message.action == "REFRESH_OFFERS" && message.audience == "MERCHANT" && message.market_uid == user_uid){ // for refreshing job owner offer interest list when any worker sends interest
|
||||
dispatch(tableReload({type:'OFFERINTERESTLISTRELOAD'}))
|
||||
}
|
||||
console.log('data', data)
|
||||
});
|
||||
|
||||
}, [socket]);
|
||||
|
||||
@@ -96,7 +96,9 @@ export default function MainSection({
|
||||
</div>
|
||||
{/* end of contentDisplay toggler */}
|
||||
</div>
|
||||
<div className="filter-navigate-content w-full min-h-screen">
|
||||
|
||||
{/* OLD MARKET JOB LISTING */}
|
||||
{/* <div className="filter-navigate-content w-full min-h-screen">
|
||||
<div
|
||||
className={
|
||||
contentDisplay == "grid"
|
||||
@@ -120,11 +122,13 @@ export default function MainSection({
|
||||
)}
|
||||
</DataIteration>
|
||||
</div>
|
||||
</div>
|
||||
{/* {products?.length &&
|
||||
</div> */}
|
||||
{/* END OF OLD MARKET JOB LISTING */}
|
||||
|
||||
{products?.length ?
|
||||
<NewPaginatedList
|
||||
data={products}
|
||||
itemsPerPage={6}
|
||||
itemsPerPage={9}
|
||||
filterItem=''
|
||||
tableTitle=''
|
||||
>
|
||||
@@ -154,7 +158,11 @@ export default function MainSection({
|
||||
)
|
||||
}
|
||||
</NewPaginatedList>
|
||||
} */}
|
||||
:
|
||||
<div className="w-full h-[40rem] bg-white dark:bg-dark-white flex justify-center items-center">
|
||||
No Jobs Found!
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -16,6 +16,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
||||
"offer_code": details?.offer_code,
|
||||
"offer_uid": details?.offer_uid,
|
||||
"job_uid": details?.job_uid,
|
||||
"market_uid": details?.market_uid
|
||||
}
|
||||
let room = `INTEREST-${details?.market_uid}`
|
||||
sendJobInterestToOwner(message, room)
|
||||
|
||||
@@ -3,6 +3,7 @@ import Layout from "../Partials/Layout";
|
||||
import CommonHead from "../UserHeader/CommonHead";
|
||||
import MainSection from "./MainSection";
|
||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
|
||||
export default function MarketPlace({ commonHeadData }) {
|
||||
let { jobLists } = useSelector((state) => state.jobLists);
|
||||
@@ -25,12 +26,18 @@ export default function MarketPlace({ commonHeadData }) {
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{jobLists.loading ?
|
||||
<div className="w-full flex justify-center items-center bg-white dark:bg-dark-white">
|
||||
<LoadingSpinner size='20' height='h-[40rem]' />
|
||||
</div>
|
||||
:
|
||||
<MainSection
|
||||
marketPlaceProduct={marketData}
|
||||
categories={categories}
|
||||
image_server={image_server}
|
||||
className="mb-10"
|
||||
/>
|
||||
}
|
||||
</Layout>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -42,7 +42,11 @@ export default function NewPaginatedList({
|
||||
filteredData?.slice(currentPage, numberOfSelection + currentPage)
|
||||
);
|
||||
}, [currentPage, filteredData]);
|
||||
console.log("newData", newData, filteredData);
|
||||
|
||||
useEffect(()=>{
|
||||
setCurrentPage(0)
|
||||
},[itemsPerPage])
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
<h1 className="text-2xl mb-5 font-semibold">{tableTitle}</h1>
|
||||
@@ -74,27 +78,46 @@ export default function NewPaginatedList({
|
||||
{/* show prev and next button if data exist */}
|
||||
{data.length > 0 && (
|
||||
<div className="mt-10 w-full flex gap-4 justify-center items-center">
|
||||
<button
|
||||
onClick={handlePrev}
|
||||
className={`w-12 h-12 rounded-full flex justify-center items-center border ${
|
||||
currentPage == 0
|
||||
? "text-slate-300 border-slate-300 dark:text-slate-400 dark:border-slate-400 pointer-events-none"
|
||||
: "text-slate-600 border-slate-600 dark:text-slate-300 dark:border-slate-300"
|
||||
} transition-all duration-500`}
|
||||
>
|
||||
<
|
||||
</button>
|
||||
<button
|
||||
onClick={handleNext}
|
||||
className={`w-12 h-12 rounded-full flex justify-center items-center border ${
|
||||
currentPage + numberOfSelection >= data.length
|
||||
? "text-slate-300 border-slate-300 dark:text-slate-400 dark:border-slate-400 pointer-events-none"
|
||||
: "text-slate-600 border-slate-600 dark:text-slate-300 dark:border-slate-300"
|
||||
} transition-all duration-500`}
|
||||
>
|
||||
>
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
onClick={handlePrev}
|
||||
className={`w-12 h-12 rounded-full flex justify-center items-center transition-all duration-300 ${
|
||||
currentPage == 0
|
||||
? "text-slate-400 border-slate-400 dark:text-slate-400 dark:border-slate-400 pointer-events-none"
|
||||
: "text-slate-600 border-slate-600 dark:text-white dark:border-white"
|
||||
}`}
|
||||
>
|
||||
<
|
||||
</button>
|
||||
|
||||
{data.length && data.map((item, index)=>{
|
||||
if(index%itemsPerPage == 0 && index >= currentPage && index <= currentPage+itemsPerPage){
|
||||
return (
|
||||
<button
|
||||
key={index}
|
||||
onClick={handleNext}
|
||||
className={`w-12 h-12 rounded-full flex justify-center items-center border transition-all duration-300 ${
|
||||
currentPage != index
|
||||
? "text-slate-400 border-slate-400 dark:text-slate-400 dark:border-slate-400"
|
||||
: "text-slate-600 border-slate-600 dark:text-white dark:border-white pointer-events-none"
|
||||
}`}
|
||||
>
|
||||
{index/itemsPerPage +1}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
})}
|
||||
|
||||
<button
|
||||
onClick={handleNext}
|
||||
className={`w-12 h-12 rounded-full flex justify-center items-center transition-all duration-300 ${
|
||||
currentPage + numberOfSelection >= data.length
|
||||
? "text-slate-400 border-slate-400 dark:text-slate-400 dark:border-slate-400 pointer-events-none"
|
||||
: "text-slate-600 border-slate-600 dark:text-white dark:border-white"
|
||||
}`}
|
||||
>
|
||||
>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -219,8 +219,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
const getMarketActiveJobList = async () => {
|
||||
try {
|
||||
const res = await apiCall.getActiveJobList();
|
||||
dispatch(updateJobs(res.data));
|
||||
dispatch(updateJobs({loading: false, ...res.data}));
|
||||
} catch (error) {
|
||||
dispatch(updateJobs({loading: false}));
|
||||
console.log("Error getting mode");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
jobLists: {}
|
||||
jobLists: {loading: true}
|
||||
};
|
||||
|
||||
export const jobSlice = createSlice({
|
||||
|
||||
Reference in New Issue
Block a user