Compare commits

...

10 Commits

13 changed files with 258 additions and 100 deletions
+4 -1
View File
@@ -114,4 +114,7 @@ REACT_APP_SHOW_NEW_FAMILY_DASH=1
REACT_APP_SHOW_ACCOUNT_DASH=1
# Displays the slider banners
REACT_APP_SHOW_SLIDER_BANNERS=0
REACT_APP_SHOW_SLIDER_BANNERS=0
# FOR MEDIA LINK
REACT_APP_MEDIA_LINK='https://dev-media.wrenchboard.com '
+4 -1
View File
@@ -82,4 +82,7 @@ REACT_APP_SHOW_NEW_FAMILY_DASH=1
REACT_APP_SHOW_ACCOUNT_DASH=1
# Displays the slider banners
REACT_APP_SHOW_SLIDER_BANNERS=0
REACT_APP_SHOW_SLIDER_BANNERS=0
# FOR MEDIA LINK
REACT_APP_MEDIA_LINK='https://dev-media.wrenchboard.com '
+4 -1
View File
@@ -88,4 +88,7 @@ REACT_APP_SHOW_NEW_FAMILY_DASH=1
REACT_APP_SHOW_ACCOUNT_DASH=1
# Displays the slider banners
REACT_APP_SHOW_SLIDER_BANNERS=0
REACT_APP_SHOW_SLIDER_BANNERS=0
# FOR MEDIA LINK
REACT_APP_MEDIA_LINK='https://media.wrenchboard.com '
@@ -300,7 +300,7 @@ const AssignTaskPopout = ({
) : (
<>
<div
className={`job-action-modal-body w-full md:grid ${
className={`job-action-modal-body w-full min-h-[450px] max-h-[450px] overflow-y-auto md:grid ${
taskType !== "new" ? "md:grid-cols-2" : "md:grid-cols-1"
}`}
>
@@ -315,7 +315,7 @@ const AssignTaskPopout = ({
checked={taskType == "select"}
onChange={switchTaskType}
/>
<span>Select Task</span>
<span className="text-lg tracking-wide font-semibold">Select Task</span>
</div>
<div className="flex items-center gap-2 text-sky-blue text-base">
<input
@@ -326,12 +326,12 @@ const AssignTaskPopout = ({
checked={taskType == "new"}
onChange={switchTaskType}
/>
<span>New Task</span>
<span className="text-lg tracking-wide font-semibold">New Task</span>
</div>
</div>
{/* Task Type === select */}
{taskType == "select" && (
<div className="p-4 w-full h-[400px] overflow-y-auto bg-slate-100 rounded-md dark:bg-[#11131f] dark:text-white">
<div className="p-4 w-full h-[380px] overflow-y-auto bg-slate-100 rounded-md dark:bg-[#11131f] dark:text-white">
{familyTask?.data?.length ? (
familyTask?.data?.map((item, index) => (
<div
@@ -364,7 +364,7 @@ const AssignTaskPopout = ({
</div>
)}
{taskType == "new" && (
<div className="p-4 w-full h-[400px]">
<div className="p-4 w-full">
<NewTasks
formState={formState}
setFormState={setFormState}
@@ -382,17 +382,25 @@ const AssignTaskPopout = ({
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide border-b-2">
{activeTask?.data?.title}
</p>
<div className="my-3">
{/* <div className="my-3">
<Detail
label="Description"
value={activeTask?.data?.description}
/>
</div> */}
<div className="my-3 w-full">
<label className="job-label">
Description
</label>
<p className="p-1 text-sm text-slate-900 dark:text-white">
{activeTask?.data?.description}
</p>
</div>
<div className="grid grid-cols-2">
<div className="w-full">
<div className="my-3 w-full flex items-center gap-1">
<label className="job-label">
Price
Reward
</label>
<p className="p-1 text-sm text-slate-900 dark:text-white">
{PriceFormatter(
@@ -49,11 +49,91 @@ export default function NewTasks({ formState, setFormState }) {
return (
<form className="w-full flex justify-between items-start">
<div className="flex flex-col gap-3 max-w-[77%]">
<div className="w-full block sm:grid grid-cols-3 gap-2">
<div className="w-full flex flex-col gap-2 col-span-2">
{/* Title */}
<div className="field w-full">
<label htmlFor="title" className="job-label">Title</label>
<InputCom
fieldClass="px-6"
// label="Title"
// labelClass="tracking-wide"
inputBg="bg-slate-100"
type="text"
name="title"
value={formState.title}
inputHandler={handleInputChange}
// blurHandler={props.handleBlur}
// error={props.errors.title && props.touched.title && props.errors.title}
/>
</div>
{/* Description */}
{/* <div className="field w-full mb-[5px]">
<label htmlFor="description" className="job-label">Description</label>
<InputCom
fieldClass="px-6"
// label="Description"
// labelClass="tracking-wide"
inputBg="bg-slate-100"
type="text"
name="description"
value={formState.description}
inputHandler={handleInputChange}
// blurHandler={props.handleBlur}
// error={props.errors.description && props.touched.description && props.errors.description}
/>
</div> */}
<div className="field flex flex-col sm:flex-row w-full gap-2">
<div className="w-full">
<label
htmlFor="description"
className='job-label'
>
Description
</label>
<textarea
id="description"
rows="5"
className={`input-field px-3 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] rounded-[10px]`}
style={{ resize: "none" }}
name="description"
value={formState.description}
onChange={handleInputChange}
// onBlur={props.handleBlur}
/>
</div>
</div>
{/* Details */}
<div className="field flex flex-col sm:flex-row w-full gap-2">
<div className="w-full">
<label
htmlFor="Job Delivery Details"
className='job-label'
>
Job Delivery Details
{/* {props.errors.job_detail && props.touched.job_detail && <span className="text-[12px] text-red-500">{props.errors.job_detail}</span>} */}
</label>
<textarea
id="Job Delivery Details"
rows="5"
className={`input-field px-3 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] rounded-[10px]`}
style={{ resize: "none" }}
name="job_detail"
value={formState.job_detail}
onChange={handleInputChange}
// onBlur={props.handleBlur}
/>
</div>
</div>
</div>
{/* inputs starts here */}
<div className="grid md:grid-cols-3 grid-cols-1 gap-6 mb-[5px]">
<div className="w-full flex flex-col gap-2">
{/* Currency */}
<div className="field w-full mb-6 xl:mb-0">
<div className="field w-full">
<label
htmlFor="country"
className="job-label"
@@ -65,7 +145,7 @@ export default function NewTasks({ formState, setFormState }) {
id="country"
name="country"
value={formState.country}
className={`input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
className={`input-field w-full h-[42px] flex items-center px-2 mt-2 rounded-full placeholder:text-base text-dark-gray dark:text-white bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
onChange={handleInputChange}
// onBlur={props.handleBlur}
>
@@ -115,7 +195,7 @@ export default function NewTasks({ formState, setFormState }) {
</div>
{/* Duration */}
<div className="field w-full mb-6 xl:mb-0">
<div className="field w-full">
<label
htmlFor="timeline_days"
className="job-label"
@@ -127,7 +207,7 @@ export default function NewTasks({ formState, setFormState }) {
id="timeline_days"
name="timeline_days"
value={formState.timeline_days}
className={`input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
className={`input-field w-full h-[42px] flex items-center px-2 mt-2 rounded-full placeholder:text-base text-dark-gray dark:text-white bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
onChange={handleInputChange}
// onBlur={props.handleBlur}
>
@@ -138,6 +218,7 @@ export default function NewTasks({ formState, setFormState }) {
</option>
{publicArray.map(({ name, duration }, idx) => (
<option
key={idx}
className="text-slate-500 text-[13.975px]"
value={duration}
>
@@ -148,74 +229,19 @@ export default function NewTasks({ formState, setFormState }) {
)}
</select>
</div>
</div>
{/* Title */}
<div className="field w-full mb-[5px]">
<label htmlFor="title" className="job-label">Title</label>
<InputCom
fieldClass="px-6"
// label="Title"
// labelClass="tracking-wide"
inputBg="bg-slate-100"
type="text"
name="title"
value={formState.title}
inputHandler={handleInputChange}
// blurHandler={props.handleBlur}
// error={props.errors.title && props.touched.title && props.errors.title}
/>
</div>
{/* Description */}
<div className="field w-full mb-[5px]">
<label htmlFor="description" className="job-label">Description</label>
<InputCom
fieldClass="px-6"
// label="Description"
// labelClass="tracking-wide"
inputBg="bg-slate-100"
type="text"
name="description"
value={formState.description}
inputHandler={handleInputChange}
// blurHandler={props.handleBlur}
// error={props.errors.description && props.touched.description && props.errors.description}
/>
</div>
{/* Details */}
<div className="field flex flex-col sm:flex-row w-full mb-[5px] gap-2">
{/* Banner Image */}
<div className="w-full">
<label
htmlFor="Job Delivery Details"
className='job-label'
>
Job Delivery Details
{/* {props.errors.job_detail && props.touched.job_detail && <span className="text-[12px] text-red-500">{props.errors.job_detail}</span>} */}
</label>
<textarea
id="Job Delivery Details"
rows="5"
className={`input-field px-3 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] rounded-[10px]`}
style={{ resize: "none" }}
name="job_detail"
value={formState.job_detail}
onChange={handleInputChange}
// onBlur={props.handleBlur}
/>
<div className="h-32 w-full">
<img
src={selectImage}
alt="task_banner_img"
className="w-full h-full object-contain"
/>
</div>
</div>
</div>
</div>
{/* Banner Image */}
<div className="max-w-[20%] w-full">
<div className="h-32 w-full">
<img
src={selectImage}
alt="task_banner_img"
className="w-full h-full object-contain"
/>
</div>
</div>
</form>
);
+45 -5
View File
@@ -5,6 +5,7 @@ import AvailableJobsCard from "../Cards/AvailableJobsCard";
import DataIteration from "../Helpers/DataIteration";
import SelectBox from "../Helpers/SelectBox";
import NewPaginatedList from "../Pagination/NewPaginatedList";
import InfiniteScroll from "../infiniteScroll/InfiniteScroll";
export default function MainSection({
className,
@@ -96,7 +97,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 +123,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 +159,42 @@ export default function MainSection({
)
}
</NewPaginatedList>
} */}
// <InfiniteScroll
// allData={products}
// addItemBy={3}
// intialItemsToShow={9}
// >
// {
// ({dataToShow})=>(
// <div className="filter-navigate-content w-full min-h-[600px]">
// <div
// className={
// contentDisplay == "grid"
// ? "grid lg:grid-cols-3 sm:grid-cols-2 gap-[30px]"
// : "w-full"
// }
// >
// {
// dataToShow.map((datum, index) => (
// <div key={datum.job_uid+index}>
// <AvailableJobsCard
// contentDisplay={contentDisplay}
// image_server={image_server}
// datas={datum}
// />
// </div>
// ))
// }
// </div>
// </div>
// )
// }
// </InfiniteScroll>
:
<div className="w-full h-[40rem] bg-white dark:bg-dark-white flex justify-center items-center">
No Jobs Found!
</div>
}
</div>
</div>
);
+7
View File
@@ -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>
@@ -89,6 +93,7 @@ export default function NewPaginatedList({
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
@@ -0,0 +1,62 @@
import React, { useEffect, useState } from 'react'
import LoadingSpinner from '../Spinners/LoadingSpinner'
export default function InfiniteScroll({
allData=data,
addItemBy=12,
intialItemsToShow=39,
children
}) {
let [currentPage, setCurrentPage] = useState(intialItemsToShow)
let [loading, setLoading] = useState(false)
let dataToShow = allData.slice(0, currentPage)
// let [winScr, setWinScr] = useState(0)
const customScroll = ()=>{
let wi = window.innerHeight + window.scrollY
// let scrollContainer = document.querySelector('.scroll-container').scrollHeight
let scrollBody = document.body.offsetHeight
if(wi >= scrollBody && allData.length > currentPage){
setLoading(true)
setTimeout(()=>{
setCurrentPage(prev => prev+addItemBy)
setLoading(false)
},2000)
}
// else if(window.scrollY < winScr && currentPage > intialItemsToShow){
// setCurrentPage(prev => prev-addItemBy)
// window.scrollTo(0,wi)
// setWinScr(window.scrollY)
// }
// else if(winScr == 0 && currentPage > intialItemsToShow){
// setCurrentPage(prev => intialItemsToShow)
// window.scrollTo(0,0)
// setWinScr(window.scrollY)
// }
}
useEffect(()=>{
window.addEventListener('scroll', customScroll)
return () => {
window.removeEventListener('scroll', customScroll)
}
},[currentPage])
return (
<div className='w-full'>
{children({ dataToShow })}
{loading &&
<div className='w-full my-2 p-2 flex justify-center items-center'>
<LoadingSpinner size='8' />
</div>
}
</div>
)
}
// let data = new Array(100).fill(0).map((_,i) => i )
@@ -123,13 +123,13 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
return (
<ModalCom action={onClose} situation={situation}>
<div className="logout-modal-wrapper w-[90%] md:w-[768px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
<div className="modal-header-con">
<h1 className="modal-title">
Start Task
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
className="modal-close-btn"
onClick={onClose}
>
<svg
@@ -153,7 +153,7 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
</svg>
</button>
</div>
<div className="md:flex bg-white rounded-lg shadow-lg">
<div className="md:flex bg-white rounded-lg">
<div className="p-4 w-full md:w-3/4 md:border-r-2">
<div className="flex gap-2">
<div className="image-wrapper w-32">
@@ -261,12 +261,12 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
</div>
{/* close button */}
<div className="p-6 flex justify-end">
<div className="modal-footer-wrapper flex justify-end">
<button
onClick={onClose}
disabled={requestStatus.loading}
type="button"
className="border-gradient text-18 tracking-wide px-2 py-2 rounded-full"
className="custom-btn border-gradient"
>
<span className="text-gradient">Cancel</span>
</button>
+6 -6
View File
@@ -103,13 +103,13 @@ function OfferJobPopout({ details, onClose, situation }) {
return (
<ModalCom action={onClose} situation={situation}>
<div className="logout-modal-wrapper w-[90%] md:w-[768px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
<div className="modal-header-con">
<h1 className="modal-title">
Start Task
</h1>
<button
type="button"
className="text-[#374557] dark:text-red-500"
className="modal-close-btn"
onClick={onClose}
>
<svg
@@ -133,7 +133,7 @@ function OfferJobPopout({ details, onClose, situation }) {
</svg>
</button>
</div>
<div className="md:flex bg-white dark:bg-dark-white rounded-lg shadow-lg">
<div className="md:flex bg-white dark:bg-dark-white rounded-lg">
<div className="p-4 w-full md:w-3/4 md:border-r-2">
<p className="text-lg my-5 font-semibold text-slate-900 dark:text-white tracking-wide">
{details.title}
@@ -234,12 +234,12 @@ function OfferJobPopout({ details, onClose, situation }) {
</div>
{/* close button */}
<div className="p-6 flex justify-end">
<div className="modal-footer-wrapper flex justify-end">
<button
onClick={onClose}
disabled={requestStatus.loading}
type="button"
className="border-gradient text-18 tracking-wide px-2 py-2 rounded-full"
className="custom-btn border-gradient"
>
<span className="text-gradient">Cancel</span>
</button>
+2 -1
View File
@@ -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 -1
View File
@@ -1,7 +1,7 @@
import { createSlice } from "@reduxjs/toolkit";
const initialState = {
jobLists: {}
jobLists: {loading: true}
};
export const jobSlice = createSlice({