Compare commits

...

4 Commits

5 changed files with 29 additions and 8 deletions
+13 -5
View File
@@ -96,7 +96,9 @@ export default function MainSection({
</div> </div>
{/* end of contentDisplay toggler */} {/* end of contentDisplay toggler */}
</div> </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 <div
className={ className={
contentDisplay == "grid" contentDisplay == "grid"
@@ -120,11 +122,13 @@ export default function MainSection({
)} )}
</DataIteration> </DataIteration>
</div> </div>
</div> </div> */}
{/* {products?.length && {/* END OF OLD MARKET JOB LISTING */}
{products?.length ?
<NewPaginatedList <NewPaginatedList
data={products} data={products}
itemsPerPage={6} itemsPerPage={9}
filterItem='' filterItem=''
tableTitle='' tableTitle=''
> >
@@ -154,7 +158,11 @@ export default function MainSection({
) )
} }
</NewPaginatedList> </NewPaginatedList>
} */} :
<div className="w-full h-[40rem] bg-white dark:bg-dark-white flex justify-center items-center">
No Jobs Found!
</div>
}
</div> </div>
</div> </div>
); );
+7
View File
@@ -3,6 +3,7 @@ import Layout from "../Partials/Layout";
import CommonHead from "../UserHeader/CommonHead"; import CommonHead from "../UserHeader/CommonHead";
import MainSection from "./MainSection"; import MainSection from "./MainSection";
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb"; import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
import LoadingSpinner from "../Spinners/LoadingSpinner";
export default function MarketPlace({ commonHeadData }) { export default function MarketPlace({ commonHeadData }) {
let { jobLists } = useSelector((state) => state.jobLists); let { jobLists } = useSelector((state) => state.jobLists);
@@ -25,12 +26,18 @@ export default function MarketPlace({ commonHeadData }) {
} }
/> />
</div> </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 <MainSection
marketPlaceProduct={marketData} marketPlaceProduct={marketData}
categories={categories} categories={categories}
image_server={image_server} image_server={image_server}
className="mb-10" className="mb-10"
/> />
}
</Layout> </Layout>
</> </>
); );
@@ -42,7 +42,11 @@ export default function NewPaginatedList({
filteredData?.slice(currentPage, numberOfSelection + currentPage) filteredData?.slice(currentPage, numberOfSelection + currentPage)
); );
}, [currentPage, filteredData]); }, [currentPage, filteredData]);
console.log("newData", newData, filteredData);
useEffect(()=>{
setCurrentPage(0)
},[itemsPerPage])
return ( return (
<div className="w-full"> <div className="w-full">
<h1 className="text-2xl mb-5 font-semibold">{tableTitle}</h1> <h1 className="text-2xl mb-5 font-semibold">{tableTitle}</h1>
@@ -89,6 +93,7 @@ export default function NewPaginatedList({
if(index%itemsPerPage == 0 && index >= currentPage && index <= currentPage+itemsPerPage){ if(index%itemsPerPage == 0 && index >= currentPage && index <= currentPage+itemsPerPage){
return ( return (
<button <button
key={index}
onClick={handleNext} onClick={handleNext}
className={`w-12 h-12 rounded-full flex justify-center items-center border transition-all duration-300 ${ className={`w-12 h-12 rounded-full flex justify-center items-center border transition-all duration-300 ${
currentPage != index currentPage != index
+2 -1
View File
@@ -219,8 +219,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
const getMarketActiveJobList = async () => { const getMarketActiveJobList = async () => {
try { try {
const res = await apiCall.getActiveJobList(); const res = await apiCall.getActiveJobList();
dispatch(updateJobs(res.data)); dispatch(updateJobs({loading: false, ...res.data}));
} catch (error) { } catch (error) {
dispatch(updateJobs({loading: false}));
console.log("Error getting mode"); console.log("Error getting mode");
} }
}; };
+1 -1
View File
@@ -1,7 +1,7 @@
import { createSlice } from "@reduxjs/toolkit"; import { createSlice } from "@reduxjs/toolkit";
const initialState = { const initialState = {
jobLists: {} jobLists: {loading: true}
}; };
export const jobSlice = createSlice({ export const jobSlice = createSlice({