From 30ce6a7d6eb48deb75f6271df4048797111e6579 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Fri, 22 Mar 2024 15:07:13 +0100 Subject: [PATCH 1/2] initial commit --- src/components/Contexts/SocketIOContext.js | 5 +++-- src/components/MarketPlace/PopUp/MarketPopUp.jsx | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Contexts/SocketIOContext.js b/src/components/Contexts/SocketIOContext.js index 436fe24..c8c4b1e 100644 --- a/src/components/Contexts/SocketIOContext.js +++ b/src/components/Contexts/SocketIOContext.js @@ -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]); diff --git a/src/components/MarketPlace/PopUp/MarketPopUp.jsx b/src/components/MarketPlace/PopUp/MarketPopUp.jsx index c9158e4..21f8126 100644 --- a/src/components/MarketPlace/PopUp/MarketPopUp.jsx +++ b/src/components/MarketPlace/PopUp/MarketPopUp.jsx @@ -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) From 3541363f9fc2fd6edccbc2127e97442f7b9ffc19 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Fri, 22 Mar 2024 16:18:19 +0100 Subject: [PATCH 2/2] added dummy pagination --- .../Pagination/NewPaginatedList.jsx | 60 ++++++++++++------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/src/components/Pagination/NewPaginatedList.jsx b/src/components/Pagination/NewPaginatedList.jsx index 9283b6c..ec9a057 100644 --- a/src/components/Pagination/NewPaginatedList.jsx +++ b/src/components/Pagination/NewPaginatedList.jsx @@ -74,27 +74,45 @@ export default function NewPaginatedList({ {/* show prev and next button if data exist */} {data.length > 0 && (
- - -
+ + + {data.length && data.map((item, index)=>{ + if(index%itemsPerPage == 0 && index >= currentPage && index <= currentPage+itemsPerPage){ + return ( + + ) + } + })} + + + )} );