Compare commits

..

1 Commits

Author SHA1 Message Date
victorAnumudu 10189a89c4 repositioned offer list display 2024-09-24 21:10:16 +01:00
57 changed files with 383 additions and 1463 deletions
-2
View File
@@ -69,7 +69,6 @@ import FamilyActivitiesPage from "./views/FamilyActivitiesPage";
import FamGamesPage from "./views/FamGamesPage";
import FamilyRoutesPage from "./views/FamilyRoutesPage";
import PromoPage from "./views/PromoPage";
import LearnMorePage from "./views/LearnMorePage";
export default function Routers() {
return (
@@ -204,7 +203,6 @@ export default function Routers() {
<Route exact path="/sell" element={<SellPage />} />
<Route exact path="/saved" element={<SavedPage />} />
<Route exact path="/history" element={<HistoryPage />} />
<Route exact path="/learnmore" element={<LearnMorePage />} />
{/*<Route exact path="/upload-product" element={<UploadProductPage />} />*/}
<Route exact path="/my-uploads" element={<UploadProductPage />} />
<Route exact path="/profile" element={<AuthProfilePage />} />
+1 -1
View File
@@ -51,7 +51,7 @@ const validationSchema = Yup.object().shape({
.required("Price is required"),
title: Yup.string()
.min(5, "Minimum 5 characters")
.max(80, "Maximum 80 characters")
.max(149, "Maximum 149 characters")
.required("Title is required"),
description: Yup.string()
.min(5, "Minimum 5 characters")
@@ -63,7 +63,7 @@ export default function ForgotPassword() {
setResetLoading(true);
try {
const res = await userApi.StartResetPassword(reqData);
if (res.status === 200 && res?.data?.internal_return >= 0) {
if (res.status === 200) {
setMsgSuccess(true);
setMail("");
setValue(false);
+8 -14
View File
@@ -16,9 +16,6 @@ import { updateUserDetails } from "../../../store/UserDetails";
import ReCAPTCHA from "react-google-recaptcha";
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
import IOSDownload from '../../../assets/images/download/apple.jpg'
export default function Login() {
// eslint-disable-next-line no-restricted-globals
const queryParams = new URLSearchParams(location?.search);
@@ -529,43 +526,40 @@ export default function Login() {
{/* APP DOWNLOAD STORE */}
<div className="w-full mt-4">
<div className="w-full flex justify-center items-center gap-4">
<div className="w-32 lg:w-48">
<div className="w-28 lg:w-32">
<a
// className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
target="_blank"
rel="noreferrer"
href={process.env.REACT_APP_APPLE_APP}
>
{/* <i className="fa-brands fa-apple text-3xl"></i>
<i className="fa-brands fa-apple text-3xl"></i>
<div className="flex flex-col">
<span className="text-[11px]">Available on the</span>
<span className="text-[12px] lg:text-base">
App Store
</span>
</div> */}
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
</div>
</a>
</div>
<div className="w-32 lg:w-48">
<div className="w-28 lg:w-32">
<a
// className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
target="_blank"
rel="noreferrer"
href={process.env.REACT_APP_ANDROID_APP}
>
{/* <i className="fa-brands fa-google-play text-2xl"></i>
<i className="fa-brands fa-google-play text-2xl"></i>
<div className="flex flex-col">
<span className="text-[11px]">Available on the</span>
<span className="text-[12px] lg:text-base">
Google Play
</span>
</div> */}
<img src={GoogleDownload} className='w-full h-auto' alt='IOS Download' />
</div>
</a>
</div>
</div>
</div>
{loginType == "full" && (
<>
<div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]">
+4 -4
View File
@@ -179,10 +179,10 @@ export default function Promo() {
</div>
</div>
{/* APP DOWNLOAD STORE */}
{/* APP DOWNLOAD STORE */}
<div className="w-full mt-4">
<div className="w-full flex justify-center items-center gap-4">
<div className="w-32 lg:w-48">
<div className="w-full flex justify-between items-center gap-10 sm:gap-32">
<div className="w-full">
<a
// className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
target="_blank"
@@ -199,7 +199,7 @@ export default function Promo() {
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
</a>
</div>
<div className="w-32 lg:w-48">
<div className="w-full">
<a
// className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
target="_blank"
+10 -15
View File
@@ -5,9 +5,6 @@ import usersService from "../../../services/UsersService";
import InputCom from "../../Helpers/Inputs/InputCom";
import AuthLayout from "../AuthLayout2";
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
import IOSDownload from '../../../assets/images/download/apple.jpg'
export default function SignUp() {
// eslint-disable-next-line no-restricted-globals
const queryParams = new URLSearchParams(location?.search);
@@ -350,38 +347,36 @@ export default function SignUp() {
{/* APP DOWNLOAD STORE */}
<div className="w-full mt-4">
<div className="w-full flex justify-center items-center gap-4">
<div className="w-32 lg:w-48">
<div className="w-28 lg:w-32">
<a
// className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
target="_blank"
rel="noreferrer"
href={process.env.REACT_APP_APPLE_APP}
rel="noreferrer"
>
{/* <i className="fa-brands fa-apple text-3xl"></i>
<i className="fa-brands fa-apple text-3xl"></i>
<div className="flex flex-col">
<span className="text-[11px]">Available on the</span>
<span className="text-[12px] lg:text-base">
App Store
</span>
</div> */}
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
</div>
</a>
</div>
<div className="w-32 lg:w-48">
<div className="w-28 lg:w-32">
<a
// className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
target="_blank"
rel="noreferrer"
href={process.env.REACT_APP_ANDROID_APP}
rel="noreferrer"
>
{/* <i className="fa-brands fa-google-play text-2xl"></i>
<i className="fa-brands fa-google-play text-2xl"></i>
<div className="flex flex-col">
<span className="text-[11px]">Available on the</span>
<span className="text-[12px] lg:text-base">
Google Play
</span>
</div> */}
<img src={GoogleDownload} className='w-full h-auto' alt='IOS Download' />
</div>
</a>
</div>
</div>
+7 -13
View File
@@ -20,7 +20,7 @@ export default function OfferCard({
let image = `${image_server}${localStorage.getItem("session_token")}/job/${datas.job_uid}`
return (
<div className="card-style-one flex flex-col gap-3 justify-between w-full bg-white dark:bg-dark-white p-3 rounded-2xl">
<div className="card-style-one flex flex-col justify-between w-full h-[387px] bg-white dark:bg-dark-white p-3 pb rounded-2xl">
<div className="content">
<div className="w-full h-40">
{/* thumbnail image/video */}
@@ -46,24 +46,24 @@ export default function OfferCard({
</h1>
<div className="w-full p-2 rounded-lg border border-[#E3E4FE] dark:border-[#a7a9b533] ">
{/* <div className="grid grid-cols-1 gap-2">
<div className="flex flex-col justify-between items-center border-r-2">
<div className="grid grid-cols-1 gap-2">
{/* <div className="flex flex-col justify-between items-center border-r-2">
<p className="text-sm text-thin-light-gray dark:text-white tracking-wide">
Task Code
</p>
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
{datas.contract}
</p>
</div>
</div> */}
<div className="flex flex-col justify-between items-center">
<p className="text-sm text-red-500 tracking-wide">Expires</p>
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
<CountDown lastDate={datas.expire} />
</p>
</div>
</div> */}
</div>
{/* <hr className="my-2" /> */}
<hr className="my-2" />
<div className="grid grid-cols-2 gap-2">
<div className="flex flex-col justify-between items-center border-r-2">
@@ -74,19 +74,13 @@ export default function OfferCard({
{thePrice}
</p>
</div>
{/* <div className="flex flex-col justify-between items-center">
<div className="flex flex-col justify-between items-center">
<p className="text-sm text-thin-light-gray dark:text-white tracking-wide">
Timeline
</p>
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
{`${datas.timeline_days} day(s)`}
</p>
</div> */}
<div className="flex flex-col justify-between items-center">
<p className="text-sm text-red-500 tracking-wide">Expires</p>
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
<CountDown lastDate={datas.expire} />
</p>
</div>
</div>
</div>
@@ -85,7 +85,6 @@ export default function SocketIOContextProvider({children}) {
}
console.log('data', data)
});
// dispatch(tableReload({ type: "HOMEBANNERS" })); // RELOADS HOME BANNERS
}, [socket]);
+19 -106
View File
@@ -5,15 +5,13 @@ import OfferJobPopout from '../../components/jobPopout/OfferJobPopout'
import { PriceFormatter } from "../Helpers/PriceFormatter";
import CountDown from '../Helpers/CountDown'
const AccountDashboard = ({ className, bannerList, offersList, imageServer }) => {
const AccountDashboard = ({ className, bannerList, offersList }) => {
let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
let offersListLength = offersList?.length > 2 ? 2 : offersList?.length
// getting the upper three banners for the home layout
const getUpperBanner = bannerList?.filter((value, idx) => idx <= 2 - offersListLength);
const getLowerBanner = bannerList?.filter((value, idx) => !getUpperBanner?.map(item => item?.title)?.includes(value.title));
const getUpperBanner = bannerList?.filter((value, idx) => idx <= 2);
const getLowerBanner = bannerList?.filter((value, idx) => idx > 2);
let getImage = ({ banner_location, banner }) => {
if (banner_location == "LOCAL") {
@@ -31,26 +29,24 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
}`}
>
{/* for normal banner section */}
<div className="w-full grid xxs:grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 items-center justify-center gap-2 md:gap-4">
{/* OFFER LIST DISPLAY */}
<>
{(offersList && offersList?.length > 0) &&
offersList.map((item, index) => {
{(offersList && offersList?.result_list?.length > 0) &&
offersList.result_list.map((item, index) => {
let thePrice = PriceFormatter(
item?.price * 0.01,
item?.currency_code,
item?.currency
);
let image = `${imageServer}${localStorage.getItem("session_token")}/job/${item.job_uid}`
if(index < offersListLength){
return (
<div key={item.offer_uid}>
<NewOfferCard datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
</div>
)
}
let image = `${offersList.session_image_server}${localStorage.getItem("session_token")}/job/${item.job_uid}`
return (
<div key={item.id}>
<NewOfferCard datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
</div>
)
})}
</>
@@ -73,30 +69,7 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
);
})}
</div>
{/* for flat banner section */}
<div className="w-full grid-cols-1 md:grid-cols-2 2xl:grid-cols-3 grid items-center justify-center gap-2 md:gap-4">
{/* OFFER LIST DISPLAY */}
{/* <>
{(offersList && offersList?.length > 0) &&
offersList.map((item, index) => {
let thePrice = PriceFormatter(
item?.price * 0.01,
item?.currency_code,
item?.currency
);
let image = `${imageServer}${localStorage.getItem("session_token")}/job/${item.job_uid}`
if(index >= 3) {
return(
<div key={item.offer_uid}>
<NewOfferCardFlat datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
</div>
)
}
})}
</> */}
<div className="w-full grid-cols-1 md:grid-cols-2 2xl::grid-cols-3 grid items-center justify-center gap-2 md:gap-4">
{getLowerBanner?.map((props, idx) => {
let image = getImage(props);
@@ -184,17 +157,10 @@ const NewOfferCard = ({ datas, hidden = false, price, setOfferPopout, image }) =
:
<div
className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4"
style={{
// background: `url(${image}) center / contain no-repeat`,
}}
>
{/* <img src={image} className='' /> */}
<div
className="thumbnail w-full h-full rounded-xl overflow-hidden"
style={{
background: `url(${image}) center / contain no-repeat`,
}}
></div>
>
{hidden && <div className="flex justify-center"></div>}
</div>
}
@@ -204,15 +170,18 @@ const NewOfferCard = ({ datas, hidden = false, price, setOfferPopout, image }) =
<h1 className="font-bold text-lg line-clamp-1 text-center">
{datas?.title}
</h1>
{/* <Link to={link_path} className="text-sm">
{desc}
</Link> */}
<div className="card-buttons flex justify-center items-center space-x-2">
<button
type="button"
onClick={() =>
setOfferPopout({ show: true, data: { ...datas, image } })
setOfferPopout({ show: true, data: { ...datas, price, image } })
}
className="btn-shine w-2/3 h-[40px] text-white rounded-full text-sm bg-pink flex justify-center items-center"
>
Start Now
Start Task
</button>
</div>
</div>
@@ -234,62 +203,6 @@ const NewOfferCard = ({ datas, hidden = false, price, setOfferPopout, image }) =
);
};
const NewOfferCardFlat = ({ datas, hidden = false, price, setOfferPopout, image }) => {
return (
<div className="flex flex-col shadow-md bg-red-50 dark:bg-dark-white rounded-xl dark:border-[#5356fb29] overflow-hidden">
<div className="w-full xxs:flex justify-between items-center border-b border-slate-300 p-2">
<div className="min-h-[130px] sm:min-h-[100px] flex justify-between items-center">
<div className="px-2 flex flex-col gap-2 dark:text-white">
<h1 className="font-bold text-lg line-clamp-1 text-center">
{datas?.title}
</h1>
<div className="card-buttons flex items-center space-x-2">
<button
type="button"
onClick={() =>
setOfferPopout({ show: true, data: { ...datas, image } })
}
className="btn-shine w-28 h-[40px] text-white rounded-full text-sm bg-pink flex justify-center items-center"
>
Start Now
</button>
</div>
</div>
</div>
<div className='w-[150px] h-[100px]'>
{datas.job_type == "MEDIA" ?
<Suspense fallback={<p>Loading...</p>}>
<VideoElement videoId={datas?.media_uid} />
</Suspense>
:
<div
className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4"
style={{
background: `url(${image}) center / contain no-repeat`,
}}
>
{hidden && <div className="flex justify-center"></div>}
</div>
}
</div>
</div>
<div className="flex justify-between w-full p-1 items-center">
<div className="flex gap-1 items-center">
<p className="text-[12px] text-red-500 tracking-wide">Expires</p>
<p className="text-[12px] font-semibold tracking-wide text-dark-gray dark:text-white">
<CountDown lastDate={datas.expire} />
</p>
</div>
<button className="flex items-center justify-center gap-2">
<div className="w-[4px] h-[4px] bg-slate-400 rounded-full"></div>
<div className="w-[4px] h-[4px] bg-slate-400 rounded-full"></div>
<div className="w-[4px] h-[4px] bg-slate-400 rounded-full"></div>
</button>
</div>
</div>
);
};
const LowerBanner = ({ image, title = "", desc = "", btn, link_path, card_type, blog_id, key }) => {
const newLinkPath = card_type == 'BLOG' ? `${link_path}?blog_id=${blog_id}` : link_path
@@ -5,6 +5,7 @@ import { useSelector } from "react-redux";
export default function FamilyParentDashboard({
className,
bannerList,
nextDueTask,
}) {
const { userDetails } = useSelector((state) => state?.userDetails);
+1 -1
View File
@@ -2,7 +2,7 @@ import React from "react";
// import HomeSliders from "./HomeSliders";
import { useSelector } from "react-redux";
export default function HomeDashboard({ className, bannerList }) {
export default function HomeDashboard({ className, bannerList, nextDueTask }) {
const { userDetails } = useSelector((state) => state?.userDetails);
let loginDate = userDetails?.last_login.split(" ")[0];
@@ -5,6 +5,7 @@ import { useSelector } from "react-redux";
export default function JobOwnerDashboard({
className,
bannerList,
nextDueTask,
}) {
const { userDetails } = useSelector((state) => state?.userDetails);
@@ -5,6 +5,7 @@ import { useSelector } from "react-redux";
export default function WorkerDashboard({
className,
bannerList,
nextDueTask,
}) {
const { userDetails } = useSelector((state) => state?.userDetails);
+8 -19
View File
@@ -20,9 +20,6 @@ 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,
@@ -68,43 +65,35 @@ export default function FamilyTableNew() {
// Function to handle tab changes
const tabHandler = (value) => {
setTab(value.toLowerCase());
setTab(value);
};
// Object that maps tab names to their corresponding components
const tabComponents = {
tasks: (
Tasks: (
<FamilyTasks
familyData={familyTasks}
action={familyAssignPopUpHandler}
/>
),
waiting: (
Waiting: (
<FamilyWaitlist
familyData={familyWaitList}
setUpdatePage={setUpdatePage}
/>
),
pending: (
Pending: (
<FamilyPending
familyData={familyPending}
/>
),
};
const defaultTabComponent = tabComponents.tasks;
const defaultTabComponent = tabComponents.Tasks;
// 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(() => {
@@ -200,7 +189,7 @@ export default function FamilyTableNew() {
<Suspense
fallback={
<div className="h-full min-h-[609px] w-full overflow-hidden flex justify-center items-center">
<LoadingSpinner size="16" color="sky-blue" height='h-[30rem]' />
<LoadingSpinner size="16" color="sky-blue" />
</div>
}
>
@@ -213,7 +202,7 @@ export default function FamilyTableNew() {
<li
onClick={() => tabHandler(name)}
className={`p-4 flex hover:text-purple transition-all ease-in-out items-center cursor-pointer overflow-hidden text-xl relative top-[2px] ${
tab.toLowerCase() === name.toLowerCase()
tab === name
? "text-purple border-r"
: "text-thin-light-gray"
}`}
@@ -235,7 +224,7 @@ export default function FamilyTableNew() {
<div className="flex-[0.9] h-full">
<div className="h-full relative overflow-y-auto">
<Suspense
fallback={<LoadingSpinner size="16" color="sky-blue" height='h-[30rem]' />}
fallback={<LoadingSpinner size="16" color="sky-blue" />}
>
{selectedTabComponent}
</Suspense>
-19
View File
@@ -75,23 +75,4 @@ export const AmountTo2DP = (
// return formattedNumber;
return formattedNumber;
};
// FUNCTION TO RETURN CURRENCY SYMBOL
export const currencySymbol = (
currencyName = "naira",
amount = "00",
) => {
// Cureency Array
let currencyArray = [
{currencyName:'naira', symbol:'₦'},
{currencyName:'usd', symbol:'$'},
]
const matchedCurrency = currencyArray.filter(item => item.currencyName.toLocaleLowerCase() == currencyName.toLocaleLowerCase())
const amountTo2DP = AmountTo2DP(amount)
// return formattedNumber;
return matchedCurrency.length ? <><span>{matchedCurrency[0].symbol}</span><span>{amountTo2DP}</span></> : <><span>$</span><span>{amountTo2DP}</span></>;
};
+5 -5
View File
@@ -7,8 +7,7 @@ import PaginatedList from '../../components/Pagination/PaginatedList';
import LoadingSpinner from '../Spinners/LoadingSpinner';
import { currencySymbol } from '../Helpers/PriceFormatter';
import {NewDateTimeFormatter} from '../../lib/NewDateTimeFormatter'
import { AmountTo2DP } from '../Helpers/PriceFormatter';
function JobsCompleted() {
@@ -48,7 +47,7 @@ function JobsCompleted() {
}, [])
return (
<div className='py-4 flex flex-col justify-between min-h-[500px]'>
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
{jobHistory?.loading ?
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
: jobHistory?.data?.length ?
@@ -72,11 +71,12 @@ function JobsCompleted() {
<div className='flex flex-col'>
<h1 className='text-lg font-bold line-clamp-1'>{item?.title}</h1>
<p className='text-sm line-clamp-2'>{item?.description}</p>
<p className='text-sm line-clamp-2'>{NewDateTimeFormatter(item?.delivery_date)}</p>
</div>
</div>
</td>
<td className="p-4 flex text-right justify-end items-center">{currencySymbol(item?.currency_code, item?.price*0.01)}</td>
<td className="p-4 text-right">{AmountTo2DP(item?.price*0.01)} {item?.currency}</td>
{/* <td className="p-4">{date}</td>
<td className="p-4">{item?.contract}</td> */}
</tr>
)
}
+11 -11
View File
@@ -7,7 +7,7 @@ import PaginatedList from '../../components/Pagination/PaginatedList';
import LoadingSpinner from '../Spinners/LoadingSpinner';
import { currencySymbol } from '../Helpers/PriceFormatter';
import { AmountTo2DP } from '../Helpers/PriceFormatter';
export const RewardsTable = memo(() => {
@@ -47,7 +47,7 @@ export const RewardsTable = memo(() => {
}, [])
return (
<div className='py-4 flex flex-col justify-between min-h-[500px] w-full overflow-x-auto'>
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
{familyRewardHistory.loading ?
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
: familyRewardHistory.data.length ?
@@ -55,9 +55,9 @@ export const RewardsTable = memo(() => {
<thead className='w-full'>
<tr className='text-slate-600 dark:text-white'>
<th className="p-4"></th>
<th className="p-4 text-center">Amount</th>
<th className="p-4 text-center">Date</th>
<th className="p-4 text-center">Confirmation</th>
<th className="p-4 text-right">Amount</th>
<th className="p-4">Date</th>
<th className="p-4">Confirmation</th>
</tr>
</thead>
<tbody>
@@ -65,18 +65,18 @@ export const RewardsTable = memo(() => {
let date = new Date(item.added).toLocaleDateString()
return (
<tr key={index} className='dark:text-white dark:bg-dark-white border-y dark:border-[#5356fb29] hover:bg-gray-50 dark:hover:bg-gray-50 dark:hover:text-black transition-all duration-300'>
<td className="p-4 min-w-[300px]">
<div className='flex w-full items-center gap-2'>
<td className="p-4">
<div className='flex items-center gap-2'>
<img src={item.icon} className='min-w-[60px] max-w-[60px] min-h-[60px] max-h-[60px] rounded-full bg-slate-500' alt='Reward Logo' />
<div className='flex flex-col w-full'>
<div className='flex flex-col'>
<h1 className='text-lg font-bold'>Reward to {item.rec_firstname} {item.rec_lastname}</h1>
<p className='text-sm'>{item.description}</p>
</div>
</div>
</td>
<td className="p-4 text-right flex-nowrap">{currencySymbol(item.currency, item.amount*0.01)}</td>
<td className="p-4 text-center">{date}</td>
<td className="p-4 text-center">{item.confirmation}</td>
<td className="p-4 text-right">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
<td className="p-4">{date}</td>
<td className="p-4">{item.confirmation}</td>
</tr>
)
}
+1 -1
View File
@@ -127,7 +127,7 @@ export default function History() {
</div>
</div>
<div className="w-[1px] bg-[#E3E4FE] dark:bg-[#a7a9b533] mr-10"></div>
<div className="w-full overflow-y-auto min-h-[520px]">
<div className="flex-1 overflow-y-auto min-h-[520px]">
<>
{/* PURCHASE SECTION */}
{selectedTab == 'purchases' &&
+8 -6
View File
@@ -22,6 +22,7 @@ export default function FullAccountDash(props) {
className="mb-4"
data={userDetails}
bannerList={props.bannerList}
nextDueTask={props.nextDueTask}
/>
);
case "FAMILY_PARENT_DASH":
@@ -30,6 +31,7 @@ export default function FullAccountDash(props) {
className="mb-4"
data={userDetails}
bannerList={props.bannerList}
nextDueTask={props.nextDueTask}
/>
);
case "WORKER_HOME_DASH":
@@ -38,6 +40,7 @@ export default function FullAccountDash(props) {
className="mb-4"
data={userDetails}
bannerList={props.bannerList}
nextDueTask={props.nextDueTask}
/>
);
case "JOBOWNER_HOME_DASH":
@@ -46,6 +49,7 @@ export default function FullAccountDash(props) {
className="mb-4"
data={userDetails}
bannerList={props.bannerList}
nextDueTask={props.nextDueTask}
/>
);
default:
@@ -58,18 +62,16 @@ export default function FullAccountDash(props) {
<div className="home-page-wrapper">
{renderDashboard()}
{process.env.REACT_APP_SHOW_ACCOUNT_DASH == "1" && (
<AccountDashboard className="mb-4" bannerList={props.bannerList} offersList={props.offersList} imageServer={props.imageServer} />
<AccountDashboard className="mb-4" bannerList={props.bannerList} offersList={props.offersList?.data} />
)}
{/* {props?.dashTypes !== "undefined" &&
{props?.dashTypes !== "undefined" &&
props.offersList?.data?.result_list?.length ? (
<MyOffersTable
MyActiveOffersList={props.offersList?.data}
className="mb-10"
/>
)
:
props.MyActiveJobList?.data?.length ? (
) : props.MyActiveJobList?.data?.length ? (
<>
<div className="w-full mb-5 flex justify-between items-center gap-1">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
@@ -82,7 +84,7 @@ export default function FullAccountDash(props) {
imageServer={props.offersList?.data?.session_image_server}
/>
</>
) : null} */}
) : null}
</div>
</>
);
+1 -1
View File
@@ -53,7 +53,7 @@ export default function HomeActivities({ className }) {
return (
<div
className={`update-table w-full bg-white dark:bg-dark-white overflow-hidden rounded-2xl relative min-h-[520px] ${
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl relative min-h-[520px] ${
className || ""
}`}
>
+49 -48
View File
@@ -5,65 +5,68 @@ import usersService from "../../services/UsersService";
import { useSelector } from "react-redux";
import FamilyDash from "./FamilyDash";
import FullAccountDash from "./FullAccountDash";
import LoadingSpinner from '../../components/Spinners/LoadingSpinner'
export default function Home(props) {
// console.log("PROPS IN HOME->", props);
const userApi = new usersService();
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
let [nextDueTask, setNextDueTask] = useState({});
const [MyOffersList, setMyOffersList] = useState({loading: true, data: []});
const { userDetails } = useSelector((state) => state?.userDetails);
// const [MyActiveJobList, setMyActiveJobList] = useState({loading:true, data:[]}); // STATE TO HOLD ACTIVE/CURRENT TASKS
const [MyActiveJobList, setMyActiveJobList] = useState({loading:true, data:[]}); // STATE TO HOLD ACTIVE/CURRENT TASKS
// const [MyActiveJobList, setMyActiveJobList] = useState([]); // STATE TO HOLD ACTIVE/CURRENT TASKS
// const getMyActiveJobList = async () => { // FUNCTION TO POPULATE ACTIVE/CURRENT TASK LIST
// try {
// const res = await userApi.getMyActiveTaskList();
// setMyActiveJobList({loading:false, data:res?.data?.result_list});
// // setMyActiveJobList(res?.data?.result_list);
// } catch (error) {
// setMyActiveJobList({loading:false, data:[]});
// // setMyActiveJobList([]);
// console.log("Error getting tasks");
// }
// };
const getMyActiveJobList = async () => { // FUNCTION TO POPULATE ACTIVE/CURRENT TASK LIST
try {
const res = await userApi.getMyActiveTaskList();
setMyActiveJobList({loading:false, data:res?.data?.result_list});
// setMyActiveJobList(res?.data?.result_list);
} catch (error) {
setMyActiveJobList({loading:false, data:[]});
// setMyActiveJobList([]);
console.log("Error getting tasks");
}
};
// FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
// const getHomeDate = () => {
// userApi
// .getHomeDate()
// .then((res) => {
// if (res.status != 200 || res.internal_return < 0) {
// return;
// }
// setNextDueTask(res.data);
// })
// .catch((error) => {
// console.log(error);
// });
// };
const getHomeDate = () => {
userApi
.getHomeDate()
.then((res) => {
if (res.status != 200 || res.internal_return < 0) {
return;
}
setNextDueTask(res.data);
})
.catch((error) => {
console.log(error);
});
};
// const getMyOffersList = async () => {
// try {
// const res = await userApi.getOffersList();
// setMyOffersList({loading:false, data:res.data});
// } catch (error) {
// setMyOffersList({loading:false, data:[]});
// console.log("Error getting offers", error);
// }
// };
const getMyOffersList = async () => {
try {
const res = await userApi.getOffersList();
setMyOffersList({loading:false, data:res.data});
} catch (error) {
setMyOffersList({loading:false, data:[]});
console.log("Error getting offers", error);
}
};
// useEffect(() => {
// if(userDetails?.account_type == 'FULL'){
// getMyActiveJobList();
// }
// }, []);
useEffect(() => {
const fetchData = async () => {
await Promise.all([getHomeDate(), getMyOffersList(), getMyActiveJobList()]);
};
if(userDetails?.account_type == 'FULL'){
fetchData();
}
}, []);
return (
<Layout>
{Object.keys(commonHeadBanner).length < 1 ?
<LoadingSpinner height='h-48' size='16' />
:
<div className="w-full">
{userDetails && userDetails?.account_type == "FAMILY" ? (
<FamilyDash
@@ -75,12 +78,11 @@ export default function Home(props) {
/>
) : userDetails && userDetails?.account_type == "FULL" ? (
<FullAccountDash
nextDueTask={nextDueTask}
bannerList={props.bannerList}
dashTypes={props.dashTypes}
// offersList={MyOffersList}
// MyActiveJobList={MyActiveJobList}
offersList={props.offersList}
imageServer={props.imageServer}
offersList={MyOffersList}
MyActiveJobList={MyActiveJobList}
/>
) : (
<div>
@@ -88,7 +90,6 @@ export default function Home(props) {
</div>
)}
</div>
}
</Layout>
);
}
-152
View File
@@ -1,152 +0,0 @@
import React, {useState, useEffect} from "react";
import Layout from "../Partials/Layout";
import usersService from "../../services/UsersService";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import TabButton from "../customTabs/TabButton";
export default function LearnMore() {
const apiCall = new usersService()
const [selectedTab, setSelectedTab] = useState("topic 1");
const [tabs, setTabs] = useState(
[ //STATE FOR SWITCHING BETWEEN TABS
{
id: 1,
title: "topic 1",
iconName: "history",
},
{
id: 2,
title: "topic 2",
iconName: "history",
},
{
id: 3,
title: "topic 3",
iconName: "history",
},
{
id: 4,
title: "topic 4",
iconName: "history",
},
]
)
// const tabs = [ //STATE FOR SWITCHING BETWEEN TABS
// {
// id: 1,
// title: "topic 1",
// iconName: "history",
// },
// {
// id: 2,
// title: "topic 2",
// iconName: "history",
// },
// {
// id: 3,
// title: "topic 3",
// iconName: "history",
// },
// {
// id: 4,
// title: "topic 4",
// iconName: "history",
// },
// ]
let [topics, setTopics] = useState({ // FOR PAYMENT HISTORY
loading: true,
data: [],
})
//FUNCTION TO GET LEARN MORE TOPIC
useEffect(()=>{
apiCall.getLearnmoreTopics().then((res)=>{
if(res.data.internal_return < 0){ // success but no data
setTopics(prev => ({...prev, loading: false}))
return
}
const resData = res?.data?.result_list
setTopics(prev => ({...prev, loading: false, data: resData}))
setTabs(prev => {
return prev.map((item, index) => ({...item, title:resData[index].topic}))
})
setSelectedTab(resData[0].topic)
// console.log('RES', resData)
}).catch((error)=>{
setTopics(prev => ({...prev, loading: false}))
})
}, [])
return (
<>
<Layout>
<div className="history-wrapper w-full mb-10">
<div className="w-full">
<div className="sm:flex justify-between items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
Learn More
</h1>
</div>
<div className="slider-btns flex space-x-4">
</div>
</div>
<div className="w-full h-full p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow lg:flex lg:px-10 px-4 justify-between">
<div className="content-tab-items lg:w-[230px] w-full mr-2">
<div className='overflow-hidden mb-5 lg:mb-0 py-2 lg:py-8'>
{(!topics.loading && topics?.data?.length > 0) && tabs.map((item) => (
<div key={item.id} className='w-full'>
<TabButton
key={item.id}
item={item.title}
iconName={item.iconName}
selectedTab={selectedTab}
setSelectedTab={setSelectedTab}
/>
</div>
))}
</div>
</div>
<div className="w-[1px] bg-[#E3E4FE] dark:bg-[#a7a9b533] mr-10"></div>
<div className="flex-1 overflow-y-auto min-h-[520px]">
<>
{/* TOPICS SECTION */}
<div className="w-full py-2 lg:py-8">
{topics.loading ?
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
:
<>
{(topics?.data && topics?.data?.length > 0) ?
<div dangerouslySetInnerHTML={{
__html: topics?.data?.filter(item => item.topic == selectedTab)[0]?.contents,
}} className='prose dark:text-white dark:bg-dark-white'
>
{/* {topics?.data?.filter(item => item.topic == selectedTab)[0]?.contents} */}
</div>
:
<p className='p-2 text-slate-500 flex flex-col grow justify-center items-center'>No Topics found</p>}
</>
}
</div>
{/* END OF TOPICS SECTION */}
</>
</div>
</div>
</div>
</div>
</Layout>
</>
);
}
@@ -19,7 +19,8 @@ export default function ActiveJobMessage({ activeJobMesList }) {
// }
return (
<div className="w-full h-full max-h-[343px] overflow-y-auto">
<div className='flex flex-col justify-between'>
<div className="w-full h-full min-h-[250px] max-h-[300px] overflow-y-auto">
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className='border-b-2'>
<tr className='text-slate-600'>
@@ -70,10 +71,9 @@ export default function ActiveJobMessage({ activeJobMesList }) {
</table>
</div>
// <div className='flex flex-col justify-between'>
// PAGINATION BUTTON
// <PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= activeJobMesList?.data?.length ? true : false} data={activeJobMesList?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
// END OF PAGINATION BUTTON
// </div>
{/* PAGINATION BUTTON */}
{/* <PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= activeJobMesList?.data?.length ? true : false} data={activeJobMesList?.data} start={indexOfFirstItem} stop={indexOfLastItem} /> */}
{/* END OF PAGINATION BUTTON */}
</div>
)
}
+22 -33
View File
@@ -12,7 +12,7 @@ import IndexJobActions from "./JobActions/IndexJobActions";
import usersService from "../../services/UsersService";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import { SocketValues } from "../Contexts/SocketIOContext";
import ManageJobTab from "../customTabs/ManageJobTab";
import TabButton from "../customTabs/TabButton";
import AttachFile from "../attachmentCom/AttachFile";
import JobDetailPopout from "./JobDetailPopout";
@@ -390,8 +390,8 @@ function ActiveJobs(props) {
{/* end of job details */}
</div>
<div className="my-4 py-[20px] bg-white dark:bg-black px-4 rounded-2xl shadow-md grid grid-cols-1 lg:grid-cols-2 gap-3">
<div className="w-full mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
<div className="my-4 py-[20px] bg-white dark:bg-black px-4 rounded-2xl shadow-md lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
<div className="w-full lg:w-1/2 mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
<div className="">
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
Actions
@@ -408,7 +408,7 @@ function ActiveJobs(props) {
{/* switch button */}
<div className="grid grid-cols-2">
{tabs.map((item) => (
<ManageJobTab
<TabButton
key={item}
item={item}
selectedTab={selectedTab}
@@ -545,16 +545,14 @@ function ActiveJobs(props) {
</div>
{/* MESSAGE SECTION */}
<div className="w-full flex flex-col">
{props.details &&
<div className="mb-4">
<AttachFile
data={props.details}
showOnData={true}
fontSize={'text-lg'}
/>
</div>
}
<div className="w-full lg:w-1/2">
<div className="mb-4">
<AttachFile
data={props.details}
showOnData={true}
fontSize={'text-lg'}
/>
</div>
<div className="flex justify-between items-center gap-5">
<p className="w-full text-lg font-bold text-dark-gray dark:text-white tracking-wide flex items-center gap-2 justify-between">
<span>Message</span>
@@ -673,46 +671,37 @@ const PopModal = ({
</svg>
</button>
</div>
<div className="job-action-modal-body w-full px-10 py-2 gap-4">
<div className="w-full">
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
<div className="w-full flex flex-col items-center">
{activeJobMesList.loading ? (
<LoadingSpinner size="16" color="sky-blue" />
) : (
<div className="message-table h-[500px] overflow-y-auto">
<table className="wallet-activity w-full table-auto border-collapse text-left">
{/* <thead className="border-b-0">
<thead className="border-b-2">
<tr className="text-slate-600">
<th className="p-0"></th>
<th className="p-2"></th>
</tr>
</thead> */}
</thead>
{activeJobMesList?.data?.length ? (
<tbody>
{activeJobMesList?.data?.map((item, index) => {
let imageLink = `${activeJobMesList?.image}${localStorage.getItem('session_token')}/contracts/${item.msg_uid}`
return (
{activeJobMesList?.data?.map((item, index) => (
<tr key={index} className="text-slate-500">
<td>
<div className={`msg_box ${item.who}`}>
<div className="msg_box">
<div className="msg_header">
{item.msg_date} {item.msg_firstname}
</div>
{/* <span
<span
className="p-2"
dangerouslySetInnerHTML={{
__html: item.message,
}}
></span> */}
{item.msg_type == 'FILE' ?
<a href={imageLink} target="_blank" className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></a>
:
<span className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></span>
}
></span>
</div>
</td>
</tr>
)
})}
))}
</tbody>
) : activeJobMesList.error ? (
<tbody>
@@ -6,14 +6,8 @@ import LoadingSpinner from '../../Spinners/LoadingSpinner'
import usersService from '../../../services/UsersService'
import {NewDateTimeFormatter }from '../../../lib/NewDateTimeFormatter'
function CurrentTaskAction({jobDetails}) {
const currTime = new Date().getTime() / (1000*60*60)
const minDueTime = new Date(jobDetails?.minimum_due).getTime() / (1000*60*60)
const canSendForReview = Number(jobDetails.strict_timeline) ? currTime >= minDueTime : true // calculation to determine when send for review button will be active
const apiCall = new usersService()
const navigate = useNavigate()
@@ -71,7 +65,7 @@ function CurrentTaskAction({jobDetails}) {
<div className="h-full w-full text-sm text-left text-gray-500">
{jobDetails.job_type == 'MEDIA' ?
<div className="h-full flex justify-center items-center">
<button onClick={popUpHandler} type="button" className="btn-gradient h-full text-white px-5 py-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl">
<button onClick={popUpHandler} type="button" className="btn-gradient h-full text-white p-1 lg:p-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl">
I have completed this task
</button>
</div>
@@ -84,7 +78,7 @@ function CurrentTaskAction({jobDetails}) {
</div>
<div className="flex justify-center items-center">
<button onClick={popUpHandler} type="button" className="custom-btn btn-gradient px-5 py-2 text-white">
<button onClick={popUpHandler} type="button" className="custom-btn btn-gradient text-white">
Send for Review
</button>
</div>
@@ -126,57 +120,36 @@ function CurrentTaskAction({jobDetails}) {
</button>
</div>
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
<div className="w-full flex flex-col min-h-[150px] gap-8 items-center">
{!canSendForReview ?
<>
<h1
// className='font-bold text-base tracking-wide text-dark-gray dark:text-white'
className='font-bold text-xl tracking-wide text-red-500 text-center'
>
This task can be marked completed after {NewDateTimeFormatter(jobDetails?.minimum_due)}
</h1>
<div className="w-full flex flex-col items-center">
<div className="mb-10 flex justify-center items-center gap-2">
<input
type='checkbox'
checked={checked}
onChange={()=>{setChecked(prev => !prev)}}
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
/>
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>If you have completed this task</p>
</div>
</>
:
<>
<div className="flex justify-center items-center gap-2">
<input
type='checkbox'
checked={checked}
onChange={()=>{setChecked(prev => !prev)}}
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
/>
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>If you have completed this task</p>
</div>
<div className="flex justify-center items-center">
{reqStatus.loading ?
<LoadingSpinner color='sky-blue' size='10' />
:
<button
type="button"
onClick={taskCompletedSubmit}
className={`px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white ${!canSendForReview && 'pointer-events-none opacity-50'}`}
>
Send for Review & Acceptance
</button>
}
</div>
{/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
{reqStatus.message &&
<div className="w-full">
<div
className={`relative p-4 text-center text-md font-light leading-[19.5px] text-[13px] ${reqStatus.status ? 'text-green-700':'text-[#912741]'}`}
>
{reqStatus.message}
</div>
</div>
<div className="mb-10 flex justify-center items-center">
{reqStatus.loading ?
<LoadingSpinner color='sky-blue' size='10' />
:
<button type="button" onClick={taskCompletedSubmit} className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
Send for Review & Acceptance
</button>
}
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
</>
}
</div>
{/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
<div className="w-full">
<div
className={`relative p-4 text-center text-md font-light leading-[19.5px] text-[13px] ${reqStatus.status ? 'text-green-700':'text-[#912741]'}`}
>
{reqStatus.message}
</div>
</div>
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
</div>
</div>
{/* cancel btn */}
@@ -121,7 +121,7 @@ function PastDueJobAction({jobDetails}) {
<button
type="button"
onClick={popUpHandler}
className="custom-btn btn-gradient px-5 py-2 text-base text-white"
className="custom-btn btn-gradient text-base text-white"
>
Cancel or Extend Timeline
</button>
@@ -1,136 +1,26 @@
import React,{useState} from 'react'
import ModalCom from '../../Helpers/ModalCom'
import LoadingSpinner from '../../Spinners/LoadingSpinner'
import { useNavigate } from 'react-router-dom'
import usersService from '../../../services/UsersService'
function PastDueTaskAction({jobDetails}) {
const apiCall = new usersService()
const navigate = useNavigate()
const [checked, setChecked] = useState(false)
const [extendedTime, setExtendedTime] = useState('') // VALUE OF NEW EXTENDED TIME
const [action, setAction] = useState('') // VALUE OF NEW EXTENDED TIME
const [reqStatus, setReqStatus] = useState({loading:false, status: false, message: ''})
let [popUp, setPopUp] = useState(false)
const popUpHandler = () => {
if(popUp){
setChecked(false)
}
setPopUp(prev => !prev)
}
// FUNCTION TO HANDLE WHEN OWNER CANCELS JOB
const cancelTask = () => {
setAction('cancel')
setReqStatus({loading:true, status: false, message: ''})
let reqData = { // API PAYLOADS
contract: jobDetails.contract,
contract_uid: jobDetails.contract_uid,
job_action: 'CANCEL_CONTRACT',
}
if(!checked){ // CHECKS IF CHECKBOX IS SELECTED
setReqStatus({loading:false, status: false, message: 'Please check the box above'})
return setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
}
// API CALL TO ACCEPT COMPLETION BY OWNER
setReqStatus({loading:false, status: false, message: 'No api added yet'})
setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
},1000)
// apiCall.ownerJobAction(reqData).then((res)=>{
// if(res.status != 200 || res.data.internal_return < 0){
// setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
// return
// }
// setReqStatus({loading:false, status: true, message: 'job cancelled successfully'})
// setTimeout(()=>{ // Sets popout to false and navigates user to /my-pastdue-jobs after 3 seconds
// popUpHandler()
// navigate('/my-pastdue-jobs', {replace: true})
// }, 3000)
// }).catch(err => {
// setReqStatus({loading:false, status: false, message: 'Opps! Network error. Try again'})
// }).finally(()=>{
// setTimeout(()=>{
// setReqStatus({loading:false, status: false, message: ''})
// }, 3000)
// })
}
// FUNCTION TO HANDLE WHEN USER/OWNER CLICKS ON EXTEND TIMELINE FOR A JOB
const extendTime = () => {
setAction('extend')
setReqStatus({loading:true, status: false, message: ''}) // Sets loading spinner active
let reqData = {
contract: jobDetails.contract,
contract_uid: jobDetails.contract_uid,
job_action: 'EXTEND_TIMELINE',
extension: Number(extendedTime)
}
if(!extendedTime){ // checks that timeline duration is selected
setReqStatus({loading:false, status: false, message: 'Please select timeline duration'})
return setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
}, 3000)
}
// API CALL EXTEND TIMELINE BY OWNER
setReqStatus({loading:false, status: false, message: 'No api added yet'})
setTimeout(()=>{
setReqStatus({loading:false, status: false, message: ''})
},1000)
// apiCall.ownerJobAction(reqData).then((res)=>{
// if(res.status != 200 || res.data.internal_return < 0){
// setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
// return
// }
// setReqStatus({loading:false, status: true, message: 'Timeline extended successfully'})
// setTimeout(()=>{ // Sets popout to false and navigates user to /my-pastdue-jobs after 3 seconds
// popUpHandler()
// navigate('/my-pastdue-jobs', {replace: true})
// }, 3000)
// }).catch(err => {
// setReqStatus({loading:false, status: false, message: 'Opps! Network error. Try again'})
// }).finally(()=>{
// setTimeout(()=>{
// setReqStatus({loading:false, status: false, message: ''})
// }, 3000)
// })
}
import React from 'react'
function PastDueTaskAction() {
return (
<div className='job-action dark:bg-black'>
<div className='job-action dark:bg-black'>
<table className="w-full text-sm text-left text-gray-500 owner-pastdue">
<table className="w-full text-sm text-left text-gray-500 worker-pastdue">
<tbody>
<tr>
<td>
<div className="flex space-x-2 items-center w-full task_action_panel">
<div className="dark:text-red-700">
<div>
You have missed the allocated time
</div>
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
</div>
</td>
</tr>
<tr>
<td>
<div className="flex justify-center items-center">
<button
type="button"
onClick={popUpHandler}
className="custom-btn btn-gradient px-5 py-2 text-base text-white"
>
<button type="button" className="w-[150px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
Request Extension
</button>
</div>
@@ -138,124 +28,6 @@ function PastDueTaskAction({jobDetails}) {
</tr>
</tbody>
</table>
{popUp && (
<ModalCom action={popUpHandler} situation={popUp}>
<div className="logout-modal-wrapper lg:w-[460px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="modal-header-con">
<h1 className="modal-title">
Past Due Task
</h1>
<button
type="button"
className="modal-close-btn"
onClick={popUpHandler}
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<div className="relative job-action-modal-body w-full px-10 py-8 gap-4">
<div className="w-full flex flex-col items-center">
<div className="mb-5 flex justify-center items-center gap-2">
<input
type='checkbox'
checked={checked}
onChange={()=>{setChecked(prev => !prev)}}
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
/>
<p className='job-label'>I am ready to cancel this task</p>
</div>
<div className="mb-5 w-full flex justify-end items-center">
{reqStatus.loading && action=='cancel'?
<LoadingSpinner color='sky-blue' size='10' />
:
<button disabled={reqStatus.loading} onClick={cancelTask} type="button" className="custom-btn border-gradient text-base text-white">
<span className='text-gradient'>Cancel this task</span>
</button>
}
</div>
{/* EXTEND TIMELINE SECTION */}
<div className='w-full my-3 py-3 border-t flex flex-col items-center'>
<div className='mb-5 flex items-center gap-2'>
<p className='job-label'>Extend the timeline by:</p>
<select
onChange={({target})=>{setExtendedTime(target.value)}}
className='text-base p-2 text-dark-gray dark:text-white border border-slate-300 outline-0 rounded-full'
>
<option className='text-slate-500 text-lg' value=''>select</option>
<option className='text-slate-500 text-lg' value='2'>1 days</option>
<option className='text-slate-500 text-lg' value='3'>3 days</option>
<option className='text-slate-500 text-lg' value='5'>5 days</option>
<option className='text-slate-500 text-lg' value='7'>1 week</option>
</select>
</div>
{reqStatus.loading && action=='extend' ?
<LoadingSpinner color='sky-blue' size='10' />
:
<div className='w-full flex justify-end items-center'>
<button disabled={reqStatus.loading} type="button" onClick={extendTime} className="custom-btn btn-gradient text-base text-white">
Request Extension
</button>
</div>
}
</div>
{/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
<div className="w-full absolute left-0 bottom-0 text-center">
{reqStatus.message != "" &&
(!reqStatus.status ? (
<div
className={`relative p-2 mx-2 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{reqStatus.message}
</div>
) : (
reqStatus.status && (
<div
className={`relative p-2 mx-2 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
>
{reqStatus.message}
</div>
)
))}
</div>
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
</div>
</div>
{/* cancel btn */}
<div className='modal-footer-wrapper flex justify-center items-center'>
<button onClick={popUpHandler} type="button"
// className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white"
className='custom-btn text-base bg-transparent border border-red-500 text-red-500'
>
Cancel Task
{/* <span className='text-gradient'>Cancel</span> */}
</button>
</div>
</div>
</ModalCom>
)}
</div>
)
}
@@ -36,21 +36,7 @@ export default function JobDetailPopout({action, situation, jobDetail}) {
</button>
</div>
<div className="modal-body-wrapper">
{/* <p className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'>{jobDetail}</p> */}
{/* <div
className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'
dangerouslySetInnerHTML={{__html: jobDetail}}
>
</div> */}
<textarea
id="Job Delivery Details"
readOnly
// rows="5"
className={`w-full h-full overflow-y-auto text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white`}
style={{ resize: "none" }}
name="job_detail"
value={jobDetail}
/>
<p className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'>{jobDetail}</p>
</div>
<div className="modal-footer-wrapper justify-end">
<button
@@ -1,225 +0,0 @@
import { useState } from "react";
import dataImage1 from "../../assets/images/data-table-user-1.png";
import PaginatedList from "../Pagination/PaginatedList";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import { useNavigate, useLocation } from "react-router-dom";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import localImgLoad from "../../lib/localImgLoad";
const noTasksBg = require("../../assets/images/no-task-background.jpg");
const noFamilyTasksBg = require("../../assets/images/family-no-task-background.jpg");
export default function RecentPastDueTable({ className, recentPastDue, Account, imageServer }) {
let navigate = useNavigate();
let { pathname } = useLocation();
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentTask = recentPastDue?.data?.result_list?.slice(
indexOfFirstItem,
indexOfLastItem
);
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
let accountType = Account?.account_type == "FULL"
// To navigate to task
const [btnLoader, setBtnLoader] = useState(false);
const navigateMarket = () => {
setBtnLoader(true);
const timeoutId = setTimeout(() => {
navigate(accountType ? "/market" : "/familymarket", { replace: true });
setBtnLoader(false);
}, 2500);
return () => clearTimeout(timeoutId);
};
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] relative ${
className || ""
} bg-cover bg-center`}
style={{
backgroundImage: !recentPastDue?.data?.result_list?.length
? `url('${accountType ? noTasksBg : noFamilyTasksBg}')`
: "none",
}}
>
{/* Adding this dark overlay in order to see the texts properly */}
{!recentPastDue?.data?.result_list?.length && accountType && (
<div className="absolute inset-0 bg-black opacity-30"></div>
)}
{recentPastDue?.loading ?
<div className="w-full h-[520px] flex items-center justify-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
:
<div className="relative w-full sm:rounded-lg">
<div className="h-auto w-full">
{recentPastDue?.data?.result_list?.length > 0 ?
currentTask?.map((task, idx) => {
// find due date
const dueDate = task?.delivery_date.split(" ")[0];
let thePrice = PriceFormatter(
task?.price * 0.01,
task?.currency_code,
task?.currency
);
let image = `${imageServer}${localStorage.getItem('session_token')}/job/${task.origin_job_uid}`
return (
<div
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] w-full flex justify-between items-center hover:bg-gray-50"
key={idx}
>
<div className="py-4 max-w-[80%]">
<div className="flex space-x-2 items-center">
<div className="w-full min-w-[60px] max-w-[60px] flex-[0.1] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
<img
src={image}
alt="data"
className="w-full h-full"
/>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
{task?.title}
</h1>
<span className="text-base text-gray-600">
{task?.description}
</span>
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
Reward:
<span className="text-purple ml-1">{thePrice}</span>
</span>
<div className="flex flex-col sm:flex-row items-start gap-1 md:gap-4 md:items-center">
<span className="text-sm text-thin-light-gray">
Duration:
<span className="text-purple ml-1">
{Number(task?.timeline_days) === 1
? `${task?.timeline_days} day`
: `${task?.timeline_days} day(s)`}
</span>
</span>
<span className="text-sm text-thin-light-gray">
Due Date:
<span className="text-purple ml-1">{dueDate}</span>
</span>
<span className="text-sm text-thin-light-gray">
Confirmation:
<span className="text-purple ml-1">
{task?.contract}
</span>
</span>
</div>
</div>
</div>
</div>
<div className="flex justify-center items-center py-4 px-2">
{accountType ?
<button
type="button"
onClick={() => {
navigate("/manage-active-job", {
state: { ...task, pathname },
});
}}
className="px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
{task.owner_status == 'OWNER' ? 'Manage' : 'Send Updates'}
</button>
:
<button
type="button"
onClick={() => {
navigate("/manage-active-job", {
state: { ...task, pathname },
});
}}
className="w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 11 20"
id="Arrow"
className="w-[0.7rem]"
>
<path
fillRule="evenodd"
d="M.366 19.708c.405.39 1.06.39 1.464 0l8.563-8.264a1.95 1.95 0 0 0 0-2.827L1.768.292A1.063 1.063 0 0 0 .314.282a.976.976 0 0 0-.011 1.425l7.894 7.617a.975.975 0 0 1 0 1.414L.366 18.295a.974.974 0 0 0 0 1.413"
// fill=""
className="color000000 svgShape fill-[#fff]"
></path>
</svg>
</button>
}
</div>
</div>
);
})
:
<div
className={`flex flex-col ${
accountType ? "items-center" : "items-end"
} justify-center gap-9 my-5`}
>
<div
className={`p-2 font-bold text-3xl ${
accountType ? "text-white" : "text-sky-blue"
} whitespace-nowrap`}
>
You currently have {accountType ? '"0"' : "no"} Past due task
</div>
<div
className={`
${!accountType &&
"bg-[#f0f8ff] h-[17rem] p-5 rounded-md -translate-x-20"}
`}
>
<button
className={`${
!accountType
? "w-[150px] h-20 bg-[#22b14c] text-lg font-semibold rounded-md py-2 px-4"
: "w-[115px] h-11 btn-gradient rounded-full"
} flex justify-center items-center text-base text-white`}
onClick={navigateMarket}
>
{btnLoader ? (
<div className="signup btn-loader"></div>
) : accountType ? (
"Find Task"
) : (
"Suggest tasks to your parent"
)}
</button>
</div>
</div>
}
</div>
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
recentPastDue?.data?.result_list?.length
? true
: false
}
data={recentPastDue?.data?.result_list}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
}
</div>
);
}
@@ -1,76 +0,0 @@
import React, { useState } from "react";
import Layout from "../Partials/Layout";
import RecentPastDueTable from "./RecentPastDueTable";
import CommonHead from "../UserHeader/CommonHead";
import { useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
export default function RecentlyPastDue({
imageServer,
recentPastDue,
commonHeadData,
}) {
const { userDetails } = useSelector(
(state) => state?.userDetails
);
const navigate = useNavigate()
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
};
let accountType = userDetails?.account_type == "FULL"
return (
<Layout>
{userDetails?.account_type == 'FULL' &&
<CommonHead commonHeadData={commonHeadData} />
}
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
<div className="w-full mb-5 flex justify-between items-center gap-1">
<CustomBreadcrumb
title = 'Past Due Tasks'
breadcrumb={
[
{ link: "/", title: "Home" },
{ link: "/mytask", title: "My Tasks", active: true},
]
}
/>
{/* } */}
{/* <div className='flex gap-4 justify-end'>
<>
<Link
to='/mytask?tab=pastdue'
className="px-4 h-10 flex justify-center items-center text-lg md:text-xl rounded-xl text-red-600"
>
Past Due
</Link>
{ActiveJobList?.data?.length > 0 && userDetails.account_type == 'FAMILY' &&
<button
type="button"
onClick={() => {
navigate("/familymarket");
}}
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
More Task
</button>
}
</>
</div> */}
</div>
<RecentPastDueTable recentPastDue={recentPastDue} Account={userDetails} imageServer={imageServer} />
</div>
</div>
</Layout>
);
}
+13 -27
View File
@@ -5,7 +5,7 @@ import CommonHead from "../UserHeader/CommonHead";
// import TopSellerTopBuyerSliderSection from "../Home/TopSellerTopBuyerSliderSection";
import MyOffersTable from "./MyOffersTable";
import { useSelector } from "react-redux";
import { useNavigate, Link } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
export default function MyTasks({
@@ -37,7 +37,7 @@ export default function MyTasks({
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full">
{/* heading */}
<div className="sm:flex justify-between items-center hidden">
<div className="sm:flex justify-between items-center mb-6">
{/* <div className="w-full mb-5 sm:mb-0 flex justify-between items-center gap-1">
{userDetails.account_type == 'FAMILY' &&
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
@@ -94,32 +94,18 @@ export default function MyTasks({
}
/>
{/* } */}
<div className='flex gap-4 justify-end'>
<>
<Link
// onClick={() => {
// navigate(`/mytask?tab=pastdue`);
// }}
to='/mytask?tab=pastdue'
className="px-4 h-10 flex justify-center items-center text-lg md:text-xl rounded-xl text-red-600"
>
Past Due
</Link>
{ActiveJobList?.data?.length > 0 && userDetails.account_type == 'FAMILY' &&
<button
type="button"
onClick={() => {
navigate("/familymarket");
}}
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
More Task
</button>
}
</>
</div>
{ActiveJobList?.data?.length > 0 && userDetails.account_type == 'FAMILY' &&
<button
type="button"
onClick={() => {
navigate("/familymarket");
}}
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
More Task
</button>
}
</div>
<MyJobTable ActiveJobList={ActiveJobList} Account={userDetails} imageServer={MyActiveOffersList.session_image_server} />
@@ -3,8 +3,6 @@ import React, {useState} from 'react'
import PaginatedList from '../../Pagination/PaginatedList';
import { handlePagingFunc } from '../../Pagination/HandlePagination';
import { currencySymbol } from '../../Helpers/PriceFormatter';
function PurchasesTable({purchase}) {
const [currentPage, setCurrentPage] = useState(0);
@@ -17,7 +15,7 @@ function PurchasesTable({purchase}) {
}
return (
<div className='py-4 flex flex-col justify-between min-h-[500px]'>
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
{purchase.data.length ?
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className='w-full'>
@@ -33,8 +31,8 @@ function PurchasesTable({purchase}) {
<td className="p-4">{item.added_date}<br />
<b>{item.confirmation} </b>
</td>
<td className="p-4 text-right">{currencySymbol(item.currency, item.amount)}</td>
<td className="p-4 text-right">{currencySymbol(item.currency, item.fee)}</td>
<td className="p-4 text-right">{item.amount}</td>
<td className="p-4 text-right">{item.fee}</td>
</tr>
))}
</tbody>
@@ -3,8 +3,6 @@ import React, { useState } from "react";
import PaginatedList from "../../Pagination/PaginatedList";
import { handlePagingFunc } from "../../Pagination/HandlePagination";
import { currencySymbol } from '../../Helpers/PriceFormatter';
function RecentActivityTable({ payment }) {
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
@@ -20,7 +18,7 @@ function RecentActivityTable({ payment }) {
};
return (
<div className="py-4 flex flex-col justify-between min-h-[500px]">
<div className="p-4 flex flex-col justify-between min-h-[500px]">
{payment?.data?.length > 0 ?
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className="w-full">
@@ -40,9 +38,9 @@ function RecentActivityTable({ payment }) {
dangerouslySetInnerHTML={{ __html: item.recipient }}
></td>
<td className="p-4 text-right">
{currencySymbol(item.currency, item.amount)}
{item.amount}
<br />
{currencySymbol(item.currency, item.fee)}
{item.fee}
</td>
<td className="p-4">{item.status}</td>
</tr>
+12 -16
View File
@@ -73,22 +73,18 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
</div>
</div>
</div>
{walletItem.escrow > 0 ?
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
HOLDINGS :{" "}
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
{PriceFormatter(
walletItem.escrow * 0.01,
walletItem.code,
undefined,
"text-[1.5rem]"
)}
</span>
</p>
:
null
}
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
HOLDINGS :{" "}
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
{PriceFormatter(
walletItem.escrow * 0.01,
walletItem.code,
undefined,
"text-[1.5rem]"
)}
</span>
</p>
<div className="w-full h-[1px] bg-white"></div>
+1 -1
View File
@@ -413,7 +413,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
</div>
</Link>
</li>
{(userDetails && userDetails?.account_type !== "FAMILY" && Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1) && (
{userDetails && userDetails?.account_type !== "FAMILY" && (
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
<Link to="/yourpage" className="notifications">
<div className="name">
+1 -1
View File
@@ -457,7 +457,7 @@ export default function MediaHeader({ logoutModalHandler, sidebarHandler, backpa
</div>
</Link>
</li>
{(userDetails && userDetails?.account_type !== "FAMILY" && Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1) && (
{userDetails && userDetails?.account_type !== "FAMILY" && (
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
<Link to="/yourpage" className="notifications">
<div className="name">
+1 -1
View File
@@ -92,7 +92,7 @@ export default function MobileSidebar({
{/* Using mini component reduces the bulk amount of html */}
<ListItem
title={
userDetails?.account_type == "FULL" ? "Home" : "Home"
userDetails?.account_type == "FULL" ? "Dashboard" : "Home"
}
route="/"
sidebar={sidebar}
+1 -1
View File
@@ -112,7 +112,7 @@ export default function Sidebar({
<ul className="flex flex-col space-y-6">
{/* Using mini component reduces the bulk amount of html */}
<ListItem
title={userDetails?.account_type == "FULL" ? "Home" : "Home"}
title={userDetails?.account_type == "FULL" ? "Dashboard" : "Home"}
route="/"
sidebar={sidebar}
iconName="new-dashboard"
+26 -38
View File
@@ -2,10 +2,9 @@ import ProductCardStyleTwo from "../../Cards/ProductCardStyleTwo";
import DataIteration from "../../Helpers/DataIteration";
import SearchCom from "../../Helpers/SearchCom";
import ResourceBlogCard from "../../Cards/ResourceBlogCard";
import NewPaginatedList from '../../../components/Pagination/NewPaginatedList'
export default function BlogTab({ className, blogdata }) {
// console.log("Blog data here>> ", blogdata);
console.log("Blog data here>> ", blogdata);
// debugger;
return (
<>
@@ -16,9 +15,33 @@ export default function BlogTab({ className, blogdata }) {
<div className="sm:w-1/2 w-full sm:pr-20 pr-0 mb-5 sm:mb-0">
<SearchCom placeholder='Search Blog Items...' />
</div>
{/* filer-dropdown */}
<div className="flex-1 flex sm:justify-end">
{/* <div className="flex space-x-1 items-center">*/}
{/*<span className="text-18 text-thin-light-gray">*/}
{/* Recently Received*/}
{/*</span>*/}
{/* <span>*/}
{/* <svg*/}
{/* width="20"*/}
{/* height="10"*/}
{/* viewBox="0 0 13 6"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* opacity="0.7"*/}
{/* d="M12.4124 0.247421C12.3327 0.169022 12.2379 0.106794 12.1335 0.0643287C12.0291 0.0218632 11.917 0 11.8039 0C11.6908 0 11.5787 0.0218632 11.4743 0.0643287C11.3699 0.106794 11.2751 0.169022 11.1954 0.247421L7.27012 4.07837C7.19045 4.15677 7.09566 4.219 6.99122 4.26146C6.88678 4.30393 6.77476 4.32579 6.66162 4.32579C6.54848 4.32579 6.43646 4.30393 6.33202 4.26146C6.22758 4.219 6.13279 4.15677 6.05312 4.07837L2.12785 0.247421C2.04818 0.169022 1.95338 0.106794 1.84895 0.0643287C1.74451 0.0218632 1.63249 0 1.51935 0C1.40621 0 1.29419 0.0218632 1.18975 0.0643287C1.08531 0.106794 0.990517 0.169022 0.910844 0.247421C0.751218 0.404141 0.661621 0.616141 0.661621 0.837119C0.661621 1.0581 0.751218 1.2701 0.910844 1.42682L4.84468 5.26613C5.32677 5.73605 5.98027 6 6.66162 6C7.34297 6 7.99647 5.73605 8.47856 5.26613L12.4124 1.42682C12.572 1.2701 12.6616 1.0581 12.6616 0.837119C12.6616 0.616141 12.572 0.404141 12.4124 0.247421Z"*/}
{/* fill="#374557"*/}
{/* fillOpacity="0.6"*/}
{/* />*/}
{/* </svg>*/}
{/*</span>*/}
{/* </div>*/}
</div>
</div>
{/* <div className="content-section w-full-width">
<div className="content-section w-full-width">
<div className="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-[30px]">
<DataIteration
datas={blogdata?.blogdata}
@@ -34,42 +57,7 @@ export default function BlogTab({ className, blogdata }) {
)}
</DataIteration>
</div>
</div> */}
{blogdata?.blogdata?.length ?
<NewPaginatedList
data={blogdata?.blogdata}
itemsPerPage={9}
filterItem=''
tableTitle=''
>
{
({data})=>(
<div className="filter-navigate-content w-full min-h-[600px]">
<div
className={"grid lg:grid-cols-3 sm:grid-cols-2 gap-[30px]"}
>
{
data.map((datum, index) => (
<div key={index}>
<ResourceBlogCard
key={index}
datas={datum}
bg={blogdata.image_url}
/>
</div>
))
}
</div>
</div>
)
}
</NewPaginatedList>
:
<div className="w-full h-[40rem] bg-white dark:bg-dark-white flex justify-center items-center">
No Blog Found!
</div>
}
</div>
</div>
</>
@@ -2,7 +2,7 @@
import React, { useState } from "react";
import Icons from "../../Helpers/Icons";
// import PasswordSvg from "../PasswordSvg";
import PasswordSvg from "../PasswordSvg";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import usersService from "../../../services/UsersService";
import { useNavigate } from "react-router-dom";
@@ -113,19 +113,14 @@ export default function ChangePasswordTab() {
}
return (
<div className="changePasswordTab w-full">
<div className="w-full">
<div className="content-heading w-full mb-8">
<h1 className="text-2xl font-extrabold text-black dark:text-white antialiased">
Reset Password
</h1>
</div>
<div className="w-full md:w-[calc(100%-100px)] md:ml-auto pb-10">
<div className="w-full flex xxl:flex-row flex-col-reverse space-x-5 xxl:items-start">
<div className="flex-1 mb-10">
<div className="input-field mb-6">
<label
className="input-label text-dark-gray dark:text-white text-xl font-bold block mb-2.5"
htmlFor="old_password"
>
Current Password <span className="text-[10px] text-red-500 italic px-2">{(inputEmpty && !inputs.old_pwd) && 'required'}</span>
Old Password <span className="text-[10px] text-red-500 italic px-2">{(inputEmpty && !inputs.old_pwd) && 'required'}</span>
</label>
<div className="input-wrapper border border-light-purple dark:border-[#5356fb29] w-full rounded-[50px] h-[58px] overflow-hidden relative ">
<div className="absolute left-6 bottom-[17px] z-10">
@@ -207,7 +202,7 @@ export default function ChangePasswordTab() {
</div>
</div>
</div>
<div className="flex w-full md:w-[calc(100%-128px)] md:ml-auto justify-between gap-4 items-center">
<div className="flex justify-center space-x-4 items-center">
<button
type="button"
className="text-light-red text-18 tracking-wide border-b dark:border-[#5356fb29] border-light-red"
@@ -251,9 +246,9 @@ export default function ChangePasswordTab() {
))}
{/* End of error or success display */}
</div>
{/* <div className="w-[440px] sm:flex hidden justify-end">
<div className="w-[440px] sm:flex hidden justify-end">
<PasswordSvg />
</div> */}
</div>
</div>
</div>
);
@@ -1,43 +0,0 @@
import React from "react";
import Icons from "../../Helpers/Icons";
export default function Preferences() {
return (
<div className="login-activity-tab w-full">
<div className="relative w-full overflow-x-auto sm:rounded-lg">
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
{/* <thead>
<tr className="text-base text-thin-light-gray border-b dark:border-[#5356fb29] default-border-b ">
<td className="py-4 text-center">Channel</td>
<td className="py-4 text-center">Date</td>
<td className="py-4 text-center">Location</td>
</tr>
</thead>
<tbody>
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
<td className="text-center py-4">
<div className="flex items-center justify-center">
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
Desktop
</span>
</div>
</td>
<td className="text-center py-4">
<div className="flex space-x-1 items-center justify-center">
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
10-10-2035
</span>
</div>
</td>
<td className="text-center py-4">
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
10.0.0.1000
</span>
</td>
</tr>
</tbody> */}
</table>
</div>
</div>
);
}
@@ -80,7 +80,7 @@ export default function RecipientAccountTab({
})
) : (
<h1 className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
No Recipient on this account yet.
No Cards Found
</h1>
)}
</ul>
-2
View File
@@ -7,7 +7,6 @@ import PersonalInfoTab from "./PersonalInfoTab";
import PrivacyPolicyTab from "./PrivacyPolicyTab";
import RecentActivitiesTab from "./RecentActivitiesTab";
import TermsConditionTab from "./TermsConditionTab";
import Preferences from './Preferences'
export {
ChangePasswordTab,
@@ -19,5 +18,4 @@ export {
PrivacyPolicyTab,
RecentActivitiesTab,
TermsConditionTab,
Preferences
};
+3 -4
View File
@@ -13,7 +13,6 @@ import {
PrivacyPolicyTab,
RecentActivitiesTab,
TermsConditionTab,
Preferences,
} from "./Tabs";
import RecipientAccountTab from "./Tabs/RecipientAccountTab";
@@ -92,8 +91,8 @@ export default function Settings({ faq }) {
},
{
id: 5,
name: "preferences",
title: "Preferences",
name: "login_activity",
title: "Login Activity",
iconName: "login-activity",
},
{
@@ -167,7 +166,7 @@ export default function Settings({ faq }) {
<NotificationSettingTab />
</div>
),
preferences: <Preferences />,
login_activity: <LoginActivityTab />,
recent_activities: <RecentActivitiesTab />,
password: <ChangePasswordTab />,
faq: <FaqTab datas={faq} />,
@@ -1,23 +0,0 @@
import React from 'react'
import Icons from '../Helpers/Icons'
export default function ManageJobTab({ item='', iconName='', selectedTab='', setSelectedTab=()=>{} }) {
return (
<button
className={`flex lg:space-x-4 space-x-2 hover:text-purple transition-all duration-300 ease-in-out items-center cursor-pointer mb-2 mr-6 lg:mr-0 float-left lg:float-none overflow-hidden ${
selectedTab === item ? "text-purple" : " text-thin-light-gray"
}`}
value={item}
name={item}
onClick={() => setSelectedTab(item)}
>
<div>
<Icons name={iconName} />
</div>
<div>
<p className="text-18 tracking-wide">{item[0]?.toUpperCase() + item?.slice(1)}</p>
</div>
</button>
)
}
+1 -1
View File
@@ -15,7 +15,7 @@ export default function TabButton({ item='', iconName='', selectedTab='', setSel
<Icons name={iconName} />
</div>
<div>
<p className="text-18 tracking-wide">{item[0]?.toUpperCase() + item?.slice(1)}</p>
<p className="text-18 tracking-wide">{item[0].toUpperCase() + item.slice(1)}</p>
</div>
</button>
)
+1 -1
View File
@@ -27,7 +27,7 @@ const validationSchema = Yup.object().shape({
.required("Price is required"),
title: Yup.string()
.min(5, "Minimum 5 characters")
.max(80, "Maximum 80 characters")
.max(149, "Maximum 149 characters")
.required("Title is required"),
description: Yup.string()
.min(5, "Minimum 5 characters")
@@ -28,7 +28,7 @@ const validationSchema = Yup.object().shape({
.required("Price is required"),
title: Yup.string()
.min(5, "Minimum 5 characters")
.max(80, "Maximum 80 characters")
.max(149, "Maximum 149 characters")
.required("Title is required"),
description: Yup.string()
.min(5, "Minimum 5 characters")
+46 -73
View File
@@ -8,7 +8,6 @@ import LoadingSpinner from "../Spinners/LoadingSpinner";
import { tableReload } from "../../store/TableReloads";
import { useDispatch } from "react-redux";
import { PriceFormatter } from "../Helpers/PriceFormatter";
function OfferJobPopout({ details, onClose, situation }) {
const apiUrl = new usersService();
@@ -22,12 +21,6 @@ function OfferJobPopout({ details, onClose, situation }) {
trigger: "",
});
let thePrice = PriceFormatter(
details?.price * 0.01,
details?.currency_code,
details?.currency
);
//FUNCTION TO HANDLE AN OFFER
const handleOffer = ({ target: { name } }) => {
const reqData = {
@@ -78,7 +71,6 @@ function OfferJobPopout({ details, onClose, situation }) {
setTimeout(() => {
onClose();
dispatch(tableReload({ type: "MYTASKTABLE" }));
dispatch(tableReload({ type: "HOMEBANNERS" }));
navigate("/mytask", { replace: true });
setRequestStatus({
loading: false,
@@ -141,74 +133,56 @@ function OfferJobPopout({ details, onClose, situation }) {
</svg>
</button>
</div>
<div className="grid md:grid-cols-4 bg-white dark:bg-dark-white rounded-lg">
<div className="md:col-span-3 md:border-r-2">
<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}
</p>
{/* INPUT SECTION */}
<div className='bg-[#FFFDEE] p-4 w-full'>
<div className='grid md:grid-cols-2'>
<div className="my-2 md:flex">
<label className='job-label w-full md:w-[150px] md:text-right'>Date :</label>
<p className={`p-1 w-full md:w-3/4 text-sm text-slate-900 dark:text-white`}>
{
(details.offer_added && details.offer_added?.split(" ")[0]) ||
"default"
}
</p>
</div>
<div className="my-2 md:flex">
<label className='job-label w-full md:w-[150px] md:text-right'>Expire :</label>
<p className={`p-1 w-full md:w-3/4 text-sm text-slate-900 dark:text-white`}>{details.expire && details.expire.split(" ")[0]}</p>
</div>
</div>
<div className='grid md:grid-cols-2'>
<div className="my-2 md:flex">
<label className='job-label w-full md:w-[150px] md:text-right'>Reward :</label>
<p className={`p-1 w-full md:w-3/4 text-sm text-slate-900 dark:text-white`}>{thePrice}</p>
</div>
<div className="my-2 md:flex">
<label className='job-label w-full md:w-[150px] md:text-right'>Duration :</label>
<p className={`p-1 w-full md:w-3/4 text-sm text-slate-900 dark:text-white`}>{`${details.timeline_days} day(s)`}</p>
</div>
</div>
</div>
<div className='p-4 w-full'>
<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">
<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: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 className="my-2 md:flex">
<Detail
label="Date"
value={
(details.offer_added && details.offer_added?.split(" ")[0]) ||
"default"
}
/>
</div>
<div className="my-2 md:flex">
<Detail label="Description" value={details.description} />
</div>
<div className="my-2 md:flex">
<Detail
label="Offer Expire"
value={details.expire && details.expire.split(" ")[0]}
/>
</div>
<div className="my-2 md:flex">
<Detail label="Reward" value={details.thePrice} />
</div>
<div className="my-2 md:flex">
<Detail
label="Duration"
value={`${details.timeline_days} day(s)`}
/>
</div>
<div className="my-2 md:flex">
<Detail
label="Detail"
value={details.job_description || details.description}
/>
</div>
</div>
{/* ACTION SECTION */}
<div className="p-4 w-full md:col-span-1 h-full flex flex-col justify-between">
<div className="my-3 md:flex flex-col md:justify-center">
<h1 className='mb-2 text-base font-semibold text-slate-900 dark:text-white tracking-wide'>I understand the task</h1>
<div className="p-4 w-full md:w-1/4 h-full">
<div className="my-3 md:flex md:justify-center">
{requestStatus.loading && requestStatus.trigger == "offer" ? (
<LoadingSpinner size={8} color="sky-blue" />
) : (
@@ -216,9 +190,9 @@ function OfferJobPopout({ details, onClose, situation }) {
name="accept"
onClick={handleOffer}
disabled={requestStatus.loading}
className="px-2 h-28 flex justify-center items-center btn-gradient text-2xl rounded-xl text-white"
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Start Now
Accept Offer
</button>
)}
</div>
@@ -231,10 +205,9 @@ function OfferJobPopout({ details, onClose, situation }) {
name="reject"
onClick={handleOffer}
disabled={requestStatus.loading}
className="group relative px-2 h-11 flex justify-center items-center text-base text-black dark:text-white"
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Reject Offer
<div className='absolute bottom-1 w-full h-[1px] bg-black hidden group-hover:block'></div>
</button>
)}
</div>
@@ -5,7 +5,6 @@ import usersService from "../../services/UsersService";
import ModalCom from "../Helpers/ModalCom";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import Detail from "./popoutcomponent/Detail";
import {PriceFormatter} from '../Helpers/PriceFormatter'
import { useDispatch } from "react-redux";
import { NewDateTimeFormatter } from "../../lib/NewDateTimeFormatter";
+1 -1
View File
@@ -53,7 +53,7 @@
.job-action {
background-color: #4687ba;
border-radius: 15px;
padding: 10px;
padding: 3px;
}
.msg_box {
+38 -40
View File
@@ -27,7 +27,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
const navigate = useNavigate();
const { jobListTable, marketTableList, walletTable, familyBannersListTable, homeBanners } = useSelector(
const { jobListTable, marketTableList, walletTable, familyBannersListTable } = useSelector(
(state) => state.tableReload
);
@@ -111,26 +111,8 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}
}, []);
//FUNCTION TO GET COMMON HEAD DATA
useEffect(() => {
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
return
}
apiCall
.getHeroJBanners()
.then((res) => {
if (res.data?.internal_return < 0) {
return;
}
dispatch(commonHeadBanner(res.data));
})
.catch((error) => {
console.log("ERROR ", error);
});
}, [isLogin.status, homeBanners]);
useEffect(() => { // FUNCTION TO GET NOTIFICATIONS LIST
const notifications = () => {
const getNotifications = () => {
// function to load user notification
dispatch(updateNotifications({ loading: true }));
apiCall
@@ -186,9 +168,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
dispatch(updateNotifications({ loading: false, data: null }));
});
};
// delay verify requests by 10000ms
const delay15secs = setTimeout(notifications, 15000)
return ()=> clearTimeout(delay15secs)
getNotifications();
}, []);
useEffect(() => {
@@ -250,23 +230,41 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}, [apiCall, dispatch, marketTableList, isLogin.status]);
//FUNCTION TO GET COMMON HEAD DATA
// useEffect(() => {
// if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
// return
// }
// apiCall
// .getRecentActivitiedData()
// .then((res) => {
// // debugger;
// if (res?.data?.internal_return < 0) {
// return;
// }
// dispatch(recentActivitiesData(res.data));
// })
// .catch((error) => {
// console.log("ERROR ", error);
// });
// }, [isLogin.status]);
useEffect(() => {
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
return
}
apiCall
.getHeroJBanners()
.then((res) => {
if (res.data?.internal_return < 0) {
return;
}
dispatch(commonHeadBanner(res.data));
})
.catch((error) => {
console.log("ERROR ", error);
});
}, [isLogin.status]);
//FUNCTION TO GET COMMON HEAD DATA
useEffect(() => {
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
return
}
apiCall
.getRecentActivitiedData()
.then((res) => {
// debugger;
if (res?.data?.internal_return < 0) {
return;
}
dispatch(recentActivitiesData(res.data));
})
.catch((error) => {
console.log("ERROR ", error);
});
}, [isLogin.status]);
//FUNCTION TO GET FAMILY BANNERS
+9 -31
View File
@@ -126,7 +126,7 @@ class usersService {
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
};
return this.postAuxEnd("/wallets", postData);
return this.postAuxEnd("/getwallets", postData);
}
getApiGate() {
// localStorage.setItem("session_token", ``);
@@ -1502,36 +1502,14 @@ class usersService {
return this.postAuxEnd("/promoverify", postData);
}
// API FUNCTION TO LOGIN USER THROUGH PROMO LINK
loginPromo(reqData) {
var postData = {
action: apiConst.WRENCHBOARD_LOGIN_PROMO,
...reqData
};
return this.postAuxEnd("/loginpromo", postData);
}
// API FUNCTION TO GET LEARN MORE TOPICS
getLearnmoreTopics() {
var postData = {
member_uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
// action: apiConst.WRENCHBOARD_LOGIN_PROMO,
};
return this.postAuxEnd("/learnmore", postData);
}
// API FUNCTION RECENTLY PAST DUE
getRecentPastDueList() {
var postData = {
member_uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
// action: apiConst.WRENCHBOARD_LOGIN_PROMO,
};
return this.postAuxEnd("/recentpastdue", postData);
}
// API FUNCTION TO LOGIN USER THROUGH PROMO LINK
loginPromo(reqData) {
var postData = {
action: apiConst.WRENCHBOARD_LOGIN_PROMO,
...reqData
};
return this.postAuxEnd("/loginpromo", postData);
}
/*
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
-4
View File
@@ -14,7 +14,6 @@ const initialState = {
familyOfferList: false,
parentFamilyTaskList: false,
offerInterestListReload: false,
homeBanners: false,
};
export const tableReloadSlice = createSlice({
@@ -62,9 +61,6 @@ export const tableReloadSlice = createSlice({
case "OFFERINTERESTLISTRELOAD": // to reload offer interest list of owner when a worker sends interest in a job
state.offerInterestListReload = !state.offerInterestListReload;
return;
case "HOMEBANNERS": // to reload offer interest list of owner when a worker sends interest in a job
state.homeBanners = !state.homeBanners;
return;
default:
return state;
}
+4 -14
View File
@@ -1,23 +1,13 @@
import {useState, useEffect} from 'react'
import { useSelector } from "react-redux";
import Home from "../components/Home";
export default function HomePages() {
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
const [bannerOptions, setBannerOptions] = useState({})
useEffect(()=>{
const bannerOptions = {
bannerList: commonHeadBanner?.result_list,
dashTypes: commonHeadBanner?.home_dash_type,
offersList: commonHeadBanner?.offers_list,
imageServer: commonHeadBanner?.session_image_server
};
setBannerOptions(bannerOptions)
},[commonHeadBanner])
const bannerOptions = {
bannerList: commonHeadBanner?.result_list,
dashTypes: commonHeadBanner?.home_dash_type,
};
return (
<>
-10
View File
@@ -1,10 +0,0 @@
import React from "react";
import LearnMore from "../components/LearnMore/LearnMore";
export default function LearnMorePage() {
return (
<>
<LearnMore />
</>
);
}
+6 -38
View File
@@ -4,13 +4,8 @@ import MyTasks from "../components/MyTasks";
import usersService from "../services/UsersService";
import { useSelector } from "react-redux";
import RecentlyPastDue from "../components/MyTasks/RecentlyPastDue";
export default function MyTaskPage() {
const api = new usersService();
const queryParams = new URLSearchParams(location?.search);
const tab = queryParams.get("tab")?.toLowerCase();
const { myTaskTable } = useSelector((state) => state.tableReload);
let { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
@@ -21,8 +16,7 @@ export default function MyTaskPage() {
data: [],
});
const [MyActiveOffersList, setMyActiveOffersList] = useState([]);
const [recentPastDue, setRecentPastDue] = useState({loading: true, data: {}});
const api = new usersService();
const getMyActiveJobList = async () => {
setMyActiveJobList({ loading: true, status: false, data: [] });
@@ -38,7 +32,6 @@ export default function MyTaskPage() {
console.log("Error getting tasks");
}
};
const getMyActiveOffersList = async () => {
// setMyActiveOffersList({loading: true, status:false, data:[]});
try {
@@ -49,21 +42,6 @@ export default function MyTaskPage() {
console.log("Error getting offers");
}
};
const getRecentPastDue = async () => {
try {
const res = await api.getRecentPastDueList();
setRecentPastDue({loading: false, data:res?.data});
} catch (error) {
setRecentPastDue({loading: false, data:{}});
console.log("Error getting offers");
}
};
useEffect(()=>{
getRecentPastDue()
},[])
useEffect(() => {
const fetchData = async () => {
await Promise.all([getMyActiveJobList(), getMyActiveOffersList()]);
@@ -74,20 +52,10 @@ export default function MyTaskPage() {
//debugger;
return (
<>
{tab == 'pastdue' ?
<RecentlyPastDue
recentPastDue={recentPastDue}
imageServer={recentPastDue?.data?.session_image_server}
commonHeadData={commonHeadBanner?.result_list}
/>
:
<MyTasks
ActiveJobList={MyActiveJobList}
MyActiveOffersList={MyActiveOffersList}
commonHeadData={commonHeadBanner?.result_list}
/>
}
</>
<MyTasks
ActiveJobList={MyActiveJobList}
MyActiveOffersList={MyActiveOffersList}
commonHeadData={commonHeadBanner?.result_list}
/>
);
}