Compare commits

...

46 Commits

Author SHA1 Message Date
victorAnumudu 40b5e92047 wallet API changed 2024-10-14 20:24:52 +01:00
ameye bc867ee8aa Merge branch 'nav-link-rename' of WrenchBoard/Users-Wrench into master 2024-10-12 01:24:59 +00:00
victorAnumudu 7c430d03bd nav link updated and view all message popout fixed 2024-10-10 16:58:39 +01:00
ameye 9125990d70 Merge branch 'change-pwd-update' of WrenchBoard/Users-Wrench into master 2024-10-10 00:42:28 +00:00
victorAnumudu e64728e127 padding adjusted 2024-10-10 01:35:13 +01:00
victorAnumudu d82b454caf headed added 2024-10-09 22:11:08 +01:00
victorAnumudu db423a3f1e change pwd page updated 2024-10-09 21:09:00 +01:00
ameye 4376938217 Merge branch 'currency-fix' of WrenchBoard/Users-Wrench into master 2024-10-09 17:15:48 +00:00
victorAnumudu 0411ab82f0 currency fixed 2024-10-09 17:56:54 +01:00
ameye c7d5d5533c Merge branch 'preferences-tab' of WrenchBoard/Users-Wrench into master 2024-10-09 14:55:18 +00:00
ameye 3f7c673087 Merge branch 'resources-pagination' of WrenchBoard/Users-Wrench into master 2024-10-09 14:55:13 +00:00
victorAnumudu da389c937e preference component added 2024-10-09 15:21:03 +01:00
victorAnumudu c71d901556 added pagination to resources page blog display 2024-10-09 09:44:11 +01:00
ameye 804f76100a Merge branch 'settings-page-update' of WrenchBoard/Users-Wrench into master 2024-10-08 21:27:10 +00:00
victorAnumudu 64f6e55fb6 currency code added 2024-10-08 20:09:56 +01:00
ameye 16119dc332 Merge branch 'recipient-account' of WrenchBoard/Users-Wrench into master 2024-10-08 16:10:52 +00:00
victorAnumudu ae08f392ca updated message for account with no recipient yet 2024-10-08 16:58:26 +01:00
ameye b646f020a5 Merge branch 'history-page-update' of WrenchBoard/Users-Wrench into master 2024-10-08 15:46:51 +00:00
victorAnumudu 31b411dcab table style updated 2024-10-08 16:40:41 +01:00
ameye 48d66d263e Merge branch 'managetask-style-update' of WrenchBoard/Users-Wrench into master 2024-10-07 11:57:15 +00:00
victorAnumudu 2a6900f6a9 style updated 2024-10-07 11:16:23 +01:00
ameye 8b3e1e8923 Merge branch 'min-due-time' of WrenchBoard/Users-Wrench into master 2024-10-04 10:52:37 +00:00
victorAnumudu c87657eaef used min due time to determine when send for review button is active 2024-10-03 19:56:26 +01:00
ameye 9cccd72512 Merge branch 'managejob-strict-timeline' of WrenchBoard/Users-Wrench into master 2024-10-03 15:08:55 +00:00
victorAnumudu 146e8b383e send review task strict timeline implemented 2024-10-03 09:27:27 +01:00
ameye 7bb78772f7 Merge branch 'addjob-title' of WrenchBoard/Users-Wrench into master 2024-10-02 17:09:31 +00:00
victorAnumudu 094ba4fde8 bug fixed 2024-10-01 18:13:45 +01:00
victorAnumudu d31005c1ce shows password reset error message if internal return is false 2024-10-01 17:06:46 +01:00
victorAnumudu 3992ab696c add job title character length reduced to 80 2024-10-01 11:34:41 +01:00
victorAnumudu f1ed5f3a95 add job title character length reduced to 80 2024-10-01 11:34:21 +01:00
ameye 65b4c59129 Merge branch 'recently-pastdue' of WrenchBoard/Users-Wrench into master 2024-09-30 19:28:03 +00:00
victorAnumudu d620728651 Merge with master 2024-09-30 20:19:59 +01:00
victorAnumudu 4499f2d356 recentlt past due task added 2024-09-30 20:18:51 +01:00
ameye fa00555a6f Merge branch 'offercard-height-reduction' of WrenchBoard/Users-Wrench into master 2024-09-30 16:21:16 +00:00
victorAnumudu 00fcb275f1 Merge with master 2024-09-30 16:58:11 +01:00
victorAnumudu c987ba63ff height reduced 2024-09-30 16:57:05 +01:00
ameye 89797cdb3f Merge branch 'home-banner-api' of WrenchBoard/Users-Wrench into master 2024-09-30 15:55:29 +00:00
victorAnumudu c719c15b2b made home banner API load after login 2024-09-30 12:01:01 +01:00
ameye f3b1c229ea Merge branch 'accept-offer-bg' of WrenchBoard/Users-Wrench into master 2024-09-27 21:00:01 +00:00
victorAnumudu 0335edf1dc tab capitalization 2024-09-27 19:46:10 +01:00
victorAnumudu f7db65d527 added bg color 2024-09-27 19:17:40 +01:00
ameye 27dc4090fb Merge branch 'familywaiting-offer-bug' of WrenchBoard/Users-Wrench into master 2024-09-27 17:28:02 +00:00
victorAnumudu 7f631190dc bug fixed 2024-09-27 18:23:32 +01:00
ameye 6815eea66c Merge branch 'accept-task-update' of WrenchBoard/Users-Wrench into master 2024-09-27 16:44:14 +00:00
ameye c8e2ae9efb Merge branch 'learnmore-page' of WrenchBoard/Users-Wrench into master 2024-09-27 16:44:01 +00:00
victorAnumudu 956abc8411 learn more page added 2024-09-27 17:00:11 +01:00
45 changed files with 1204 additions and 284 deletions
+2
View File
@@ -69,6 +69,7 @@ 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 (
@@ -203,6 +204,7 @@ 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(149, "Maximum 149 characters")
.max(80, "Maximum 80 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) {
if (res.status === 200 && res?.data?.internal_return >= 0) {
setMsgSuccess(true);
setMail("");
setValue(false);
+13 -7
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 justify-between w-full h-[387px] bg-white dark:bg-dark-white p-3 pb rounded-2xl">
<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="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,13 +74,19 @@ 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>
@@ -9,7 +9,7 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
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
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);
@@ -44,7 +44,7 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
);
let image = `${imageServer}${localStorage.getItem("session_token")}/job/${item.job_uid}`
if(index < 3){
if(index < offersListLength){
return (
<div key={item.offer_uid}>
<NewOfferCard datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
@@ -78,7 +78,7 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
{/* 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(
@@ -96,7 +96,7 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
)
}
})}
</>
</> */}
{getLowerBanner?.map((props, idx) => {
let image = getImage(props);
+11 -11
View File
@@ -58,9 +58,9 @@ export default function FamilyTableNew() {
// Array of tab names
const tabs = [
{ id: 1, name: "tasks" },
{ id: 2, name: "waiting" },
{ id: 3, name: "pending" },
{ id: 1, name: "Tasks" },
{ id: 2, name: "Waiting" },
{ id: 3, name: "Pending" },
];
// State for the currently selected tab
@@ -68,31 +68,31 @@ export default function FamilyTableNew() {
// Function to handle tab changes
const tabHandler = (value) => {
setTab(value);
setTab(value.toLowerCase());
};
// 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;
@@ -200,7 +200,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" />
<LoadingSpinner size="16" color="sky-blue" height='h-[30rem]' />
</div>
}
>
@@ -213,7 +213,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 === name
tab.toLowerCase() === name.toLowerCase()
? "text-purple border-r"
: "text-thin-light-gray"
}`}
@@ -235,7 +235,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" />}
fallback={<LoadingSpinner size="16" color="sky-blue" height='h-[30rem]' />}
>
{selectedTabComponent}
</Suspense>
+19
View File
@@ -75,4 +75,23 @@ 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,7 +7,8 @@ import PaginatedList from '../../components/Pagination/PaginatedList';
import LoadingSpinner from '../Spinners/LoadingSpinner';
import { AmountTo2DP } from '../Helpers/PriceFormatter';
import { currencySymbol } from '../Helpers/PriceFormatter';
import {NewDateTimeFormatter} from '../../lib/NewDateTimeFormatter'
function JobsCompleted() {
@@ -47,7 +48,7 @@ function JobsCompleted() {
}, [])
return (
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
<div className='py-4 flex flex-col justify-between min-h-[500px]'>
{jobHistory?.loading ?
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
: jobHistory?.data?.length ?
@@ -71,12 +72,11 @@ 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 text-right">{AmountTo2DP(item?.price*0.01)} {item?.currency}</td>
{/* <td className="p-4">{date}</td>
<td className="p-4">{item?.contract}</td> */}
<td className="p-4 flex text-right justify-end items-center">{currencySymbol(item?.currency_code, item?.price*0.01)}</td>
</tr>
)
}
+11 -11
View File
@@ -7,7 +7,7 @@ import PaginatedList from '../../components/Pagination/PaginatedList';
import LoadingSpinner from '../Spinners/LoadingSpinner';
import { AmountTo2DP } from '../Helpers/PriceFormatter';
import { currencySymbol } from '../Helpers/PriceFormatter';
export const RewardsTable = memo(() => {
@@ -47,7 +47,7 @@ export const RewardsTable = memo(() => {
}, [])
return (
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
<div className='py-4 flex flex-col justify-between min-h-[500px] w-full overflow-x-auto'>
{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-right">Amount</th>
<th className="p-4">Date</th>
<th className="p-4">Confirmation</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>
</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">
<div className='flex items-center gap-2'>
<td className="p-4 min-w-[300px]">
<div className='flex w-full 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'>
<div className='flex flex-col w-full'>
<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">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
<td className="p-4">{date}</td>
<td className="p-4">{item.confirmation}</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>
</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="flex-1 overflow-y-auto min-h-[520px]">
<div className="w-full overflow-y-auto min-h-[520px]">
<>
{/* PURCHASE SECTION */}
{selectedTab == 'purchases' &&
+1 -1
View File
@@ -53,7 +53,7 @@ export default function HomeActivities({ className }) {
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl relative min-h-[520px] ${
className={`update-table w-full bg-white dark:bg-dark-white overflow-hidden rounded-2xl relative min-h-[520px] ${
className || ""
}`}
>
+152
View File
@@ -0,0 +1,152 @@
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,8 +19,7 @@ export default function ActiveJobMessage({ activeJobMesList }) {
// }
return (
<div className='flex flex-col justify-between'>
<div className="w-full h-full min-h-[250px] max-h-[300px] overflow-y-auto">
<div className="w-full h-full max-h-[343px] 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'>
@@ -71,9 +70,10 @@ export default function ActiveJobMessage({ activeJobMesList }) {
</table>
</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>
// <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>
)
}
+33 -22
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 TabButton from "../customTabs/TabButton";
import ManageJobTab from "../customTabs/ManageJobTab";
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 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="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="">
<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) => (
<TabButton
<ManageJobTab
key={item}
item={item}
selectedTab={selectedTab}
@@ -545,14 +545,16 @@ function ActiveJobs(props) {
</div>
{/* MESSAGE SECTION */}
<div className="w-full lg:w-1/2">
<div className="mb-4">
<AttachFile
data={props.details}
showOnData={true}
fontSize={'text-lg'}
/>
</div>
<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="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>
@@ -671,37 +673,46 @@ const PopModal = ({
</svg>
</button>
</div>
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
<div className="w-full flex flex-col items-center">
<div className="job-action-modal-body w-full px-10 py-2 gap-4">
<div className="w-full">
{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-2">
{/* <thead className="border-b-0">
<tr className="text-slate-600">
<th className="p-2"></th>
<th className="p-0"></th>
</tr>
</thead>
</thead> */}
{activeJobMesList?.data?.length ? (
<tbody>
{activeJobMesList?.data?.map((item, index) => (
{activeJobMesList?.data?.map((item, index) => {
let imageLink = `${activeJobMesList?.image}${localStorage.getItem('session_token')}/contracts/${item.msg_uid}`
return (
<tr key={index} className="text-slate-500">
<td>
<div className="msg_box">
<div className={`msg_box ${item.who}`}>
<div className="msg_header">
{item.msg_date} {item.msg_firstname}
</div>
<span
{/* <span
className="p-2"
dangerouslySetInnerHTML={{
__html: item.message,
}}
></span>
></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>
}
</div>
</td>
</tr>
))}
)
})}
</tbody>
) : activeJobMesList.error ? (
<tbody>
@@ -6,8 +6,14 @@ 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()
@@ -65,7 +71,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 p-1 lg:p-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 px-5 py-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl">
I have completed this task
</button>
</div>
@@ -78,7 +84,7 @@ function CurrentTaskAction({jobDetails}) {
</div>
<div className="flex justify-center items-center">
<button onClick={popUpHandler} type="button" className="custom-btn btn-gradient text-white">
<button onClick={popUpHandler} type="button" className="custom-btn btn-gradient px-5 py-2 text-white">
Send for Review
</button>
</div>
@@ -120,36 +126,57 @@ 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 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="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>
}
</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]'}`}
<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'
>
{reqStatus.message}
This task can be marked completed after {NewDateTimeFormatter(jobDetails?.minimum_due)}
</h1>
</>
:
<>
<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>
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
<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>
}
{/* 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 text-base text-white"
className="custom-btn btn-gradient px-5 py-2 text-base text-white"
>
Cancel or Extend Timeline
</button>
@@ -1,26 +1,136 @@
import React from 'react'
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)
// })
}
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 worker-pastdue">
<table className="w-full text-sm text-left text-gray-500 owner-pastdue">
<tbody>
<tr>
<td>
<div className="flex space-x-2 items-center w-full task_action_panel">
<div>
<div className="dark:text-red-700">
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" className="w-[150px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
<button
type="button"
onClick={popUpHandler}
className="custom-btn btn-gradient px-5 py-2 text-base text-white"
>
Request Extension
</button>
</div>
@@ -28,6 +138,124 @@ function PastDueTaskAction() {
</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,7 +36,21 @@ 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>
{/* <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}
/>
</div>
<div className="modal-footer-wrapper justify-end">
<button
@@ -0,0 +1,225 @@
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>
);
}
@@ -0,0 +1,76 @@
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>
);
}
+27 -13
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 } from "react-router-dom";
import { useNavigate, Link } 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 mb-6">
<div className="sm:flex justify-between items-center hidden">
{/* <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,18 +94,32 @@ 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,6 +3,8 @@ 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);
@@ -15,7 +17,7 @@ function PurchasesTable({purchase}) {
}
return (
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
<div className='py-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'>
@@ -31,8 +33,8 @@ function PurchasesTable({purchase}) {
<td className="p-4">{item.added_date}<br />
<b>{item.confirmation} </b>
</td>
<td className="p-4 text-right">{item.amount}</td>
<td className="p-4 text-right">{item.fee}</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>
</tr>
))}
</tbody>
@@ -3,6 +3,8 @@ 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);
@@ -18,7 +20,7 @@ function RecentActivityTable({ payment }) {
};
return (
<div className="p-4 flex flex-col justify-between min-h-[500px]">
<div className="py-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">
@@ -38,9 +40,9 @@ function RecentActivityTable({ payment }) {
dangerouslySetInnerHTML={{ __html: item.recipient }}
></td>
<td className="p-4 text-right">
{item.amount}
{currencySymbol(item.currency, item.amount)}
<br />
{item.fee}
{currencySymbol(item.currency, item.fee)}
</td>
<td className="p-4">{item.status}</td>
</tr>
+16 -12
View File
@@ -73,18 +73,22 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
</div>
</div>
</div>
<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>
{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
}
<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" && (
{(userDetails && userDetails?.account_type !== "FAMILY" && Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1) && (
<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" && (
{(userDetails && userDetails?.account_type !== "FAMILY" && Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1) && (
<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" ? "Dashboard" : "Home"
userDetails?.account_type == "FULL" ? "Home" : "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" ? "Dashboard" : "Home"}
title={userDetails?.account_type == "FULL" ? "Home" : "Home"}
route="/"
sidebar={sidebar}
iconName="new-dashboard"
+38 -26
View File
@@ -2,9 +2,10 @@ 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 (
<>
@@ -15,33 +16,9 @@ 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}
@@ -57,7 +34,42 @@ 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,14 +113,19 @@ export default function ChangePasswordTab() {
}
return (
<div className="changePasswordTab w-full">
<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="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="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"
>
Old Password <span className="text-[10px] text-red-500 italic px-2">{(inputEmpty && !inputs.old_pwd) && 'required'}</span>
Current 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">
@@ -202,7 +207,7 @@ export default function ChangePasswordTab() {
</div>
</div>
</div>
<div className="flex justify-center space-x-4 items-center">
<div className="flex w-full md:w-[calc(100%-128px)] md:ml-auto justify-between gap-4 items-center">
<button
type="button"
className="text-light-red text-18 tracking-wide border-b dark:border-[#5356fb29] border-light-red"
@@ -246,9 +251,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>
);
@@ -0,0 +1,43 @@
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 Cards Found
No Recipient on this account yet.
</h1>
)}
</ul>
+2
View File
@@ -7,6 +7,7 @@ import PersonalInfoTab from "./PersonalInfoTab";
import PrivacyPolicyTab from "./PrivacyPolicyTab";
import RecentActivitiesTab from "./RecentActivitiesTab";
import TermsConditionTab from "./TermsConditionTab";
import Preferences from './Preferences'
export {
ChangePasswordTab,
@@ -18,4 +19,5 @@ export {
PrivacyPolicyTab,
RecentActivitiesTab,
TermsConditionTab,
Preferences
};
+4 -3
View File
@@ -13,6 +13,7 @@ import {
PrivacyPolicyTab,
RecentActivitiesTab,
TermsConditionTab,
Preferences,
} from "./Tabs";
import RecipientAccountTab from "./Tabs/RecipientAccountTab";
@@ -91,8 +92,8 @@ export default function Settings({ faq }) {
},
{
id: 5,
name: "login_activity",
title: "Login Activity",
name: "preferences",
title: "Preferences",
iconName: "login-activity",
},
{
@@ -166,7 +167,7 @@ export default function Settings({ faq }) {
<NotificationSettingTab />
</div>
),
login_activity: <LoginActivityTab />,
preferences: <Preferences />,
recent_activities: <RecentActivitiesTab />,
password: <ChangePasswordTab />,
faq: <FaqTab datas={faq} />,
@@ -0,0 +1,23 @@
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(149, "Maximum 149 characters")
.max(80, "Maximum 80 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(149, "Maximum 149 characters")
.max(80, "Maximum 80 characters")
.required("Title is required"),
description: Yup.string()
.min(5, "Minimum 5 characters")
+53 -66
View File
@@ -142,80 +142,67 @@ function OfferJobPopout({ details, onClose, situation }) {
</button>
</div>
<div className="grid md:grid-cols-4 bg-white dark:bg-dark-white rounded-lg">
<div className="p-4 w-full md:col-span-3 md:border-r-2">
<div className="md:col-span-3 md:border-r-2">
{/* INPUT SECTION */}
<div className='grid md:grid-cols-2'>
<div className="my-2 md:flex">
{/* <Detail
label="Date :"
value={
(details.offer_added && details.offer_added?.split(" ")[0]) ||
"default"
}
/> */}
<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 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">
{/* <Detail
label="Offer Expire :"
value={details.expire && details.expire.split(" ")[0]}
/> */}
<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>
<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>
<div className='grid md:grid-cols-2'>
<div className="my-2 md:flex">
{/* <Detail label="Reward :" value={thePrice} /> */}
<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">
{/* <Detail
label="Duration :"
value={`${details.timeline_days} day(s)`}
/> */}
<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>
<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>
{/* ACTION SECTION */}
@@ -5,6 +5,7 @@ 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: 3px;
padding: 10px;
}
.msg_box {
+18 -18
View File
@@ -111,6 +111,24 @@ 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 = () => {
// function to load user notification
@@ -231,24 +249,6 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
getMarketActiveJobList();
}, [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
.getHeroJBanners()
.then((res) => {
if (res.data?.internal_return < 0) {
return;
}
dispatch(commonHeadBanner(res.data));
})
.catch((error) => {
console.log("ERROR ", error);
});
}, [isLogin.status, homeBanners]);
//FUNCTION TO GET COMMON HEAD DATA
// useEffect(() => {
// if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
+31 -9
View File
@@ -126,7 +126,7 @@ class usersService {
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
};
return this.postAuxEnd("/getwallets", postData);
return this.postAuxEnd("/wallets", postData);
}
getApiGate() {
// localStorage.setItem("session_token", ``);
@@ -1502,14 +1502,36 @@ 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 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);
}
/*
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
+10
View File
@@ -0,0 +1,10 @@
import React from "react";
import LearnMore from "../components/LearnMore/LearnMore";
export default function LearnMorePage() {
return (
<>
<LearnMore />
</>
);
}
+38 -6
View File
@@ -4,8 +4,13 @@ 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);
@@ -16,7 +21,8 @@ export default function MyTaskPage() {
data: [],
});
const [MyActiveOffersList, setMyActiveOffersList] = useState([]);
const api = new usersService();
const [recentPastDue, setRecentPastDue] = useState({loading: true, data: {}});
const getMyActiveJobList = async () => {
setMyActiveJobList({ loading: true, status: false, data: [] });
@@ -32,6 +38,7 @@ export default function MyTaskPage() {
console.log("Error getting tasks");
}
};
const getMyActiveOffersList = async () => {
// setMyActiveOffersList({loading: true, status:false, data:[]});
try {
@@ -42,6 +49,21 @@ 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()]);
@@ -52,10 +74,20 @@ export default function MyTaskPage() {
//debugger;
return (
<MyTasks
ActiveJobList={MyActiveJobList}
MyActiveOffersList={MyActiveOffersList}
commonHeadData={commonHeadBanner?.result_list}
/>
<>
{tab == 'pastdue' ?
<RecentlyPastDue
recentPastDue={recentPastDue}
imageServer={recentPastDue?.data?.session_image_server}
commonHeadData={commonHeadBanner?.result_list}
/>
:
<MyTasks
ActiveJobList={MyActiveJobList}
MyActiveOffersList={MyActiveOffersList}
commonHeadData={commonHeadBanner?.result_list}
/>
}
</>
);
}