Compare commits

..

96 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 455248f9db reject btn placed below 2024-09-27 17:22:52 +01:00
victorAnumudu fee3376a88 style updated 2024-09-27 17:15:02 +01:00
victorAnumudu 956abc8411 learn more page added 2024-09-27 17:00:11 +01:00
ameye 64f3625990 Merge branch 'flat-offer-bug' of WrenchBoard/Users-Wrench into master 2024-09-26 19:06:10 +00:00
victorAnumudu 9ec8855ed6 flat box fixed for offer list 2024-09-26 19:07:47 +01:00
victorAnumudu 06450808ed Merge with master 2024-09-26 18:42:32 +01:00
victorAnumudu 7eecd34a5e initial commit 2024-09-26 18:41:30 +01:00
ameye ab3693fc0b Merge branch 'offer-list-flat-banner' of WrenchBoard/Users-Wrench into master 2024-09-26 17:00:15 +00:00
victorAnumudu e1879222b3 offer list flat banner bug fixed 2024-09-26 17:06:43 +01:00
victorAnumudu 22250da988 offer list flat banner fixed 2024-09-26 16:54:32 +01:00
ameye 7e8704d633 Merge branch 'unsed-api-removal' of WrenchBoard/Users-Wrench into master 2024-09-25 20:21:38 +00:00
victorAnumudu 99d9a468f6 clean up on unused APIs 2024-09-25 20:40:37 +01:00
ameye 2ca1c668f5 Merge branch 'appstore-link-image-update' of WrenchBoard/Users-Wrench into master 2024-09-25 15:54:09 +00:00
ameye 0bb9528690 Merge branch 'dashdata-api-removal' of WrenchBoard/Users-Wrench into master 2024-09-25 15:53:57 +00:00
victorAnumudu 78a9c4bf5f Merge with master 2024-09-25 13:24:01 +01:00
victorAnumudu 0440b36f24 dashdata api removed 2024-09-25 13:13:19 +01:00
ameye de56fb601a Merge branch 'offerlist-display-bug' of WrenchBoard/Users-Wrench into master 2024-09-24 23:50:17 +00:00
victorAnumudu f286960bed top banner offer list display fixed 2024-09-25 00:45:54 +01:00
ameye a8a090c671 Merge branch 'offerlist-dark-color' of WrenchBoard/Users-Wrench into master 2024-09-24 21:13:03 +00:00
victorAnumudu 24e2a905d2 moved refer friend section 2024-09-24 22:07:33 +01:00
victorAnumudu 19c2500263 added dark color for offer list card 2024-09-24 21:13:03 +01:00
ameye 909c74b734 Merge branch 'dashboard-offerlist-position' of WrenchBoard/Users-Wrench into master 2024-09-24 20:09:14 +00:00
victorAnumudu 0ea988fcea repositioned offer list display 2024-09-24 21:05:01 +01:00
victorAnumudu 8be4ee52f1 updated app store link image 2024-09-24 19:40:50 +01:00
ameye db5eb85794 Merge branch 'blog-page-image' of WrenchBoard/Users-Wrench into master 2024-09-24 16:58:06 +00:00
victorAnumudu fb6a2767bc Merged with master 2024-09-24 17:34:00 +01:00
ameye c48ae540cc Merge branch 'changed-price-to-reward' of WrenchBoard/Users-Wrench into master 2024-09-24 15:56:46 +00:00
victorAnumudu c51693deb5 changed text price to reward 2024-09-24 15:36:38 +01:00
victorAnumudu b28d02b2f5 blog image fixed 2024-09-24 13:54:47 +01:00
ameye 74b395d99e Merge branch 'blog-id-fix' of WrenchBoard/Users-Wrench into master 2024-09-21 13:49:46 +00:00
victorAnumudu 21a2754fc9 blog id added 2024-09-21 14:47:22 +01:00
ameye 19282ad15a Merge branch 'home-page-image' of WrenchBoard/Users-Wrench into master 2024-09-21 11:45:46 +00:00
victorAnumudu f48b72b149 updated home page image 2024-09-21 12:15:10 +01:00
ameye 72d4af20aa Merge branch 'promo-page-update' of WrenchBoard/Users-Wrench into master 2024-09-21 09:52:42 +00:00
victorAnumudu e6f5746692 promo page download links added 2024-09-21 06:15:25 +01:00
CHIEFSOFT\ameye d0e7f58d5f Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench 2024-09-20 12:02:29 -04:00
CHIEFSOFT\ameye f4e21cb73e app links 2024-09-20 12:02:16 -04:00
ameye 6ad8ed34f5 Merge branch 'promo-login' of WrenchBoard/Users-Wrench into master 2024-09-19 18:24:42 +00:00
victorAnumudu b4bbe03bdd added promo login API 2024-09-19 19:21:15 +01:00
ameye 2c54aa36f8 Merge branch 'promo-page' of WrenchBoard/Users-Wrench into master 2024-09-18 18:54:19 +00:00
victorAnumudu 00c83b357f added promo page 2024-09-18 19:48:24 +01:00
ameye 0b7ec73409 Merge branch 'referal-page-header' of WrenchBoard/Users-Wrench into master 2024-09-13 16:53:31 +00:00
victorAnumudu f58e8834fb added referal page header 2024-09-13 10:22:04 +01:00
ameye 1a829789d4 Merge branch 'referral-page-update' of WrenchBoard/Users-Wrench into master 2024-09-13 07:26:35 +00:00
victorAnumudu 84dccfca50 updated referral page 2024-09-12 19:36:31 +01:00
ameye 49e3fc5810 Merge branch 'interest-count-added' of WrenchBoard/Users-Wrench into master 2024-09-07 11:54:02 +00:00
ameye e4b6391ed2 Merge branch 'assign-job-btn-harmonized' of WrenchBoard/Users-Wrench into master 2024-09-07 11:53:56 +00:00
victorAnumudu 3abbdd32eb interest count bug fixed 2024-09-06 21:03:58 +01:00
victorAnumudu e4a5c2682e interest count added 2024-09-06 20:53:45 +01:00
victorAnumudu 21abc93a04 made assign job btn name same as what is in mobile app 2024-09-02 20:21:31 +01:00
ameye d51bbdbc29 Merge branch 'timeline-default-value' of WrenchBoard/Users-Wrench into master 2024-08-26 19:38:54 +00:00
95 changed files with 2506 additions and 889 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+4
View File
@@ -68,6 +68,8 @@ import FamilyWalletPage from "./views/FamilyWalletPage";
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 (
@@ -93,6 +95,7 @@ export default function Routers() {
<Route exact path="/outmessage" element={<VerifyYouPagesTwo />} />
<Route exact path="/eoffer" element={<LoginPageTwo />} />
<Route exact path="/invite" element={<LoginPageTwo />} />
<Route exact path="/promo/:name/:id" element={<PromoPage />} />
</>
) : (
<>
@@ -201,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 />} />
Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

+1 -1
View File
@@ -162,7 +162,7 @@ function AddJob({ popUpHandler, categories }) {
<div className="field w-full mb-[5px] xl:mb-0">
<InputCom
fieldClass="px-6 text-right flex"
label="Price"
label="Reward"
labelClass=""
type="number"
name="price"
+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")
@@ -42,7 +42,7 @@ export default function ActivitiesTab({ className }) {
<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">
<tbody>
<tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">
<tr className="text-base text-thin-light-gray whitespace-nowrap border-b default-border-b dark:border-[#5356fb29] ottom ">
<td className="py-4 pr-12">List</td>
<td className="py-4 text-start px-2">Product Name</td>
<td className="py-4 text-start px-2">Price</td>
@@ -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);
+14 -8
View File
@@ -16,6 +16,9 @@ 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);
@@ -526,40 +529,43 @@ 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-28 lg:w-32">
<div className="w-32 lg:w-48">
<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>
</div> */}
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
</a>
</div>
<div className="w-28 lg:w-32">
<div className="w-32 lg:w-48">
<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>
</div> */}
<img src={GoogleDownload} className='w-full h-auto' alt='IOS Download' />
</a>
</div>
</div>
</div>
{loginType == "full" && (
<>
<div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]">
+252
View File
@@ -0,0 +1,252 @@
import React, {useState, useEffect} from 'react'
import { Link, useParams, useNavigate } from "react-router-dom";
import { useDispatch } from "react-redux";
import { updateUserDetails } from "../../../store/UserDetails";
import usersService from "../../../services/UsersService";
import PromoPageLayout from '../PromoPageLayout'
import InputCom from "../../Helpers/Inputs/InputCom";
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
import LoadingSpinner from '../../../components/Spinners/LoadingSpinner'
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
import IOSDownload from '../../../assets/images/download/apple.jpg'
export default function Promo() {
const api = new usersService()
const {name, id} = useParams() // PARAMETERS COMING FROM THE LINK
// console.log(name, id)
const navigate = useNavigate()
const dispatch = useDispatch();
const [requestStatus, setRequestStatus] = useState({loading:true, data:{}})
const [completeSignUp, setCompleteSignUp] = useState({loading:false, status:false, message: ''});
const [showPassword, setShowPassword] = useState(false);
const [password, setPassword] = useState("");
const handlePassword = (e) => {
setPassword(e.target.value);
};
// To Show and Hide Password
const togglePasswordVisibility = () => {
setShowPassword(!showPassword);
};
const handleContinue = () => {
let reqData = { // API REQUEST DATA/PAYLOAD
username: requestStatus?.data?.email,
promo: name,
promo_owner: id,
password: password,
sessionid: '24271A99426'
}
setCompleteSignUp({loading:true, status:false, message: ''})
if(!password){ // CHECKS FOR EMPTY PASSWORD
setCompleteSignUp({loading:false, status:false, message: 'Please Enter Password'})
return setTimeout(()=>{
setCompleteSignUp({loading:false, status:false, message: ''})
},2000)
}
api.loginPromo(reqData).then(res => { //loginPromo
console.log('RES', res)
if(res.data?.internal_return < 0 || !res?.data?.member_id || !res?.data?.uid || !res?.data?.session || res?.data?.status_message == 'VALID_LINK_NOT_FOUND'){
setCompleteSignUp({loading:false, status:false, message: 'Unable to login'})
return setTimeout(()=>{
setCompleteSignUp({loading:false, status:false, message: ''})
},4000)
}
// Do LOGIN HERE
localStorage.setItem("member_id", `${res.data.member_id}`);
localStorage.setItem("uid", `${res.data.uid}`);
localStorage.setItem("session_token", `${res.data.session}`);
localStorage.setItem("wallet_available_status", `${res.data.wallet_available_status}`);
if (res.data?.account_type == "FAMILY") {
sessionStorage.setItem("family_uid", res.data?.family_uid);
sessionStorage.setItem("parent_uid", res.data?.parent_uid);
}
dispatch(updateUserDetails({ ...res.data }));
setTimeout(() => {
navigate("/", { replace: true });
setCompleteSignUp({loading:false, status:true, message: ''})
}, 2000);
}).catch(err => {
setCompleteSignUp({loading:false, status:false, message: 'Opps! try again'})
setTimeout(()=>{
setCompleteSignUp({loading:false, status:false, message: ''})
},4000)
})
}
useEffect(()=>{
let reqData = { // API REQUEST DATA/PAYLOAD
promo: name,
promo_owner: id,
sessionid: '79970A12501'
}
api.verifyPromo(reqData).then(res => {
if(res?.data?.internal_return < 0 || !res?.data?.email || res?.data?.status_message != 'VALID_LINK_FOUND'){
return setRequestStatus({loading:false, data:{}})
}
setRequestStatus({loading:false, data:res?.data})
}).catch(err => {
setRequestStatus({loading:false, data:{}})
})
},[])
return (
<PromoPageLayout>
<div className="w-full">
<div className="mb-5">
<Link to="#">
<img
src={WrenchBoard}
alt="wrenchboard"
className="h-10 mx-auto"
/>
</Link>
</div>
{requestStatus.loading ?
<div className='flex flex-col justify-center items-center'>
<LoadingSpinner height='h-40' size='8' />
<p>Loading...</p>
<p>please do not refresh</p>
</div>
: Object.keys(requestStatus.data).length > 0 ?
<div className="flex place-content-center">
<div className="w-10/12 pb-3">
<div className="p-6 input-area login-area border-2 border-[#4687ba] rounded-2xl">
<div className="input-item mb-5">
<InputCom
labelClass="tracking-wider"
fieldClass="sm:px-6 px-2"
value={requestStatus?.data?.email}
// inputHandler={handleEmail}
placeholder="Your Email"
label="Email"
name="email"
type="email"
iconName="message"
disable={true}
/>
</div>
<div className="input-item mb-5">
<InputCom
labelClass="tracking-wider"
fieldClass="sm:px-6 px-2 tracking-[0.25em] text-2xl"
value={password}
inputHandler={handlePassword}
placeholder="● ● ● ● ● ●"
label="Set Password"
name="password"
type={showPassword ? "text" : "password"}
onClick={togglePasswordVisibility}
passIcon={showPassword ? "password" : "password"}
/>
</div>
{completeSignUp.message && (
<div className="relative p-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]">
{completeSignUp.message}
</div>
)}
<div className="flex justify-center">
<button
name="full"
onClick={handleContinue}
type="button"
disabled={completeSignUp.loading}
className={`btn-login rounded-full text-xl text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center text-[15px]`}
>
{completeSignUp.loading ? (
<div className="signup btn-loader"></div>
) : (
<>Continue</>
)}
</button>
</div>
</div>
{/* 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">
<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"
rel="noreferrer"
href={process.env.REACT_APP_APPLE_APP}
>
{/* <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' />
</a>
</div>
<div className="w-32 lg:w-48">
<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"
rel="noreferrer"
href={process.env.REACT_APP_ANDROID_APP}
>
{/* <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' />
</a>
</div>
</div>
</div>
</div>
</div>
:
<ErrorComponent onClick={() => navigate("/login")} />
}
</div>
</PromoPageLayout>
)
}
const ErrorComponent = ({ onClick }) => (
<div className="input-area">
<div className="my-5">
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
This error occurs because you have already verified this link or the
link has expired. Try login or reset password. If none worked, try to
create the account from the start.
</p>
</div>
<div className="signin-area flex justify-center mb-3.5">
<button
onClick={onClick}
type="button"
className={`rounded-[0.475rem] mb-6 text-[15px] font-semibold text-[#009ef7] hover:text-white flex justify-center bg-[#f1faff] hover:bg-[#009ef7] transition-all duration-300 items-center py-[0.8875rem] px-[1.81rem]`}
>
<span>Return Home</span>
</button>
</div>
</div>
);
@@ -0,0 +1,80 @@
import React, { useContext } from "react";
import { Link } from "react-router-dom";
import { localImgLoad } from "../../lib";
import DarkModeContext from "../Contexts/DarkModeContext";
export default function PromoPageLayout({ children }) {
const bgImg = localImgLoad("images/left-wrenchboard.jpg");
const bgImgNig = localImgLoad("images/wrench-home-back-nigeria.jpg");
const bgImgCom = localImgLoad("images/wrench-promo-back-common.jpg");
const { countryMode } = useContext(DarkModeContext);
return (
<div
className={`min-h-screen overflow-y-auto bg-cover bg-center flex flex-col justify-between items-center`}
style={{
backgroundImage: `url(${countryMode == "NG" ? bgImgCom : bgImgCom})`,
}}
>
<div className={`w-full grid grid-cols-1`}>
{/* <div
className={`auth-bg hidden xl:block bg-blue-50 relative bg-cover bg-no-repeat border-0 after:content-[''] after:absolute after:inset-0`}
style={{backgroundImage: `url(${bgImg})`}}
>
</div> */}
<div className="p-5 sm:p-7 flex place-content-center">
<div className="py-5 w-full sm:w-11/12 max-w-[550px] shadow-md bg-slate-50 dark:bg-dark-white rounded-[0.475rem]">
<div className="w-full flex justify-center items-center">
{children && children}
</div>
</div>
</div>
</div>
<div className='hidden w-full shadow-md bg-slate-50 dark:bg-dark-white'>
<div className="w-full flex flex-col md:flex-row justify-center items-center px-10 py-2">
<div className="flex justify-center items-center">
<div className="flex items-center">
<a
href="https://www.wrenchboard.com/about-us"
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
target="_blank"
rel="noreferrer"
>
About
</a>
<a
href="https://www.wrenchboard.com/service"
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
target="_blank"
rel="noreferrer"
>
Services
</a>
<a
href="https://www.wrenchboard.com/contact"
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
target="_blank"
rel="noreferrer"
>
Contact Us
</a>
</div>
</div>
<p className="text-black text-[15px] px-2 font-medium flex items-center gap-1">
<span className="dark:text-white">
&copy; {new Date().getFullYear()} -
</span>
<Link to="/" className="text-[#009ef7] ml-1">
WrenchBoard
</Link>{" "}
</p>
</div>
</div>
</div>
);
}
+15 -10
View File
@@ -5,6 +5,9 @@ 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);
@@ -347,36 +350,38 @@ 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-28 lg:w-32">
<div className="w-32 lg:w-48">
<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"
href={process.env.REACT_APP_APPLE_APP}
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>
</div> */}
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
</a>
</div>
<div className="w-28 lg:w-32">
<div className="w-32 lg:w-48">
<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"
href={process.env.REACT_APP_ANDROID_APP}
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>
</div> */}
<img src={GoogleDownload} className='w-full h-auto' alt='IOS Download' />
</a>
</div>
</div>
@@ -42,10 +42,10 @@ export default function ActivitiesTab({ className }) {
<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">
<tbody>
<tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">
<tr className="text-base text-thin-light-gray whitespace-nowrap border-b default-border-b dark:border-[#5356fb29] ottom ">
<td className="py-4 pr-12">List</td>
<td className="py-4 text-start px-2">Product Name</td>
<td className="py-4 text-start px-2">Price</td>
<td className="py-4 text-start px-2">Reward</td>
<td className="py-4 text-start px-2">Quantity</td>
<td className="py-4 text-start px-2">From</td>
<td className="py-4 text-start px-2 pr-12">To</td>
+3 -10
View File
@@ -28,21 +28,14 @@ export default function VerifyYou() {
</span>
</div>
<div className="input-area">
<div className="mb-5">
<div className="mb-5">
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
<b>Verify Email.</b> Help us secure your WrenchBoard account
by verifying your email registration address. Verification
will let you access all of WrenchBoard's features.
Please <span className="font-semibold tracking-wide">verify your email</span> to secure your account.
</p>
</div>
<div className="mb-5">
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
If you do not receive the confirmation message within a few
minutes of signing up, please check your Junk E-mail folder
just in case the confirmation email got delivered there
instead of your inbox. If so, select the confirmation
message and click Not Junk, which will allow future messages
to get through.
If you don't see the confirmation email, check your <span className='font-semibold tracking-wide'>Junk</span> or <span className='font-semibold tracking-wide'>Spam</span> folder and mark it as "Not Junk"
</p>
</div>
</div>
+8 -2
View File
@@ -26,9 +26,11 @@ export default function BlogItem(props) {
const queryParams = new URLSearchParams(location?.search);
const blog_id = queryParams.get("blog_id");
// console.log('MUMU', 'meta_value', blogdata, blogdata.data.image_url)
useEffect(()=>{
if(!blog_id){
navigate('/',{replace:true})
return navigate('/',{replace:true})
}
apiCall.getSingleBlogData({blog_id}).then(res => {
setBlogdata({loading: false, data:res.data})
@@ -87,7 +89,11 @@ export default function BlogItem(props) {
<div className="slider-btns flex space-x-4">
</div>
</div> */}
<div dangerouslySetInnerHTML={{__html: blogdata.data?.blogdata?.[0]?.post_content}}>
{/* console.log('MUMU', 'meta_value', blogdata, blogdata.data.image_url) */}
<div className='w-full mb-8'>
<img src={`${blogdata.data.image_url}/${blogdata.data?.blogdata?.[0]?.meta_value}`} className='w-full h-auto' alt='Blog Image' />
</div>
<div dangerouslySetInnerHTML={{__html: blogdata.data?.blogdata?.[0]?.post_content}} className='prose leading-relaxed'>
</div>
</div>
:
+1 -1
View File
@@ -175,7 +175,7 @@ export default function AvailableJobsCard({
<div className="block sm:flex flex-wrap gap-4">
<p className="text-sm text-thin-light-gray flex flext-start gap-1 items-center">
{datas?.offer_depend_uid && <i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>}
Price: <span className="text-purple">{thePrice}</span>
Reward: <span className="text-purple">{thePrice}</span>
</p>
<p className="text-sm text-thin-light-gray">
Duration:{" "}
+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>
@@ -85,6 +85,7 @@ export default function SocketIOContextProvider({children}) {
}
console.log('data', data)
});
// dispatch(tableReload({ type: "HOMEBANNERS" })); // RELOADS HOME BANNERS
}, [socket]);
+245 -59
View File
@@ -1,10 +1,19 @@
import React from "react";
import React, { Suspense, lazy, useState } from "react";
import { Link } from "react-router-dom";
import VideoElement from '../../components/VideoCom/VideoElement'
import OfferJobPopout from '../../components/jobPopout/OfferJobPopout'
import { PriceFormatter } from "../Helpers/PriceFormatter";
import CountDown from '../Helpers/CountDown'
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 > 2 ? 2 : offersList?.length
const AccountDashboard = ({ className, bannerList }) => {
// getting the upper three banners for the home layout
const getUpperBanner = bannerList?.filter((value, idx) => idx <= 2);
const getLowerBanner = bannerList?.filter((value, idx) => idx > 2);
const getUpperBanner = bannerList?.filter((value, idx) => idx <= 2 - offersListLength);
const getLowerBanner = bannerList?.filter((value, idx) => !getUpperBanner?.map(item => item?.title)?.includes(value.title));
let getImage = ({ banner_location, banner }) => {
if (banner_location == "LOCAL") {
@@ -14,56 +23,115 @@ const AccountDashboard = ({ className, bannerList }) => {
}
};
console.log(getLowerBanner);
return (
<div
className={`w-full min-h-[450px] flex flex-col justify-between items-center gap-4 rounded-2xl overflow-hidden ${
className || ""
}`}
>
<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">
{getUpperBanner?.map((props, idx) => {
let image = getImage(props);
<>
<div
className={`w-full min-h-[450px] flex flex-col justify-between items-center gap-4 rounded-2xl overflow-hidden ${
className || ""
}`}
>
let { short_title, short_description, short_button_text, link_path } =
props;
{/* 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) => {
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>
)
}
})}
</>
return (
<div key={idx}>
<TopBanner
btn={short_button_text}
image={image}
title={short_title}
desc={short_description}
link_path={link_path}
/>
</div>
);
})}
{getUpperBanner?.map((props, idx) => {
let image = getImage(props);
let { short_title, short_description, short_button_text, link_path, card_type, blog_id } =
props;
return (
<div key={idx}>
<TopBanner
btn={short_button_text}
image={image}
title={short_title}
desc={short_description}
link_path={card_type=='BLOG' ? `${link_path}?blog_id=${blog_id}` : link_path}
/>
</div>
);
})}
</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>
)
}
})}
</> */}
{getLowerBanner?.map((props, idx) => {
let image = getImage(props);
let { short_title, short_description, short_button_text, link_path, card_type, blog_id } =
props;
return (
<div key={idx}>
<LowerBanner
btn={short_button_text}
image={image}
title={short_title}
desc={short_description}
link_path={link_path}
card_type={card_type}
blog_id={blog_id}
/>
</div>
);
})}
</div>
</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);
let { short_title, short_description, short_button_text, link_path, card_type, blog_id } =
props;
return (
<div key={idx}>
<LowerBanner
btn={short_button_text}
image={image}
title={short_title}
desc={short_description}
link_path={link_path}
card_type={card_type}
blog_id={blog_id}
/>
</div>
);
})}
</div>
</div>
{/* Offer Job Popout */}
{offerPopout.show && (
<OfferJobPopout
details={offerPopout.data}
onClose={() => {
setOfferPopout({ show: false, data: {} });
}}
situation={offerPopout.show}
/>
)}
{/* End of Offer Job Popout */}
</>
);
};
@@ -71,25 +139,25 @@ export default AccountDashboard;
const TopBanner = ({ image, title = "", desc = "", btn, link_path, key }) => {
return (
<div className="flex flex-col shadow-md rounded-xl dark:border-[#5356fb29]" key={key}>
<Link to={link_path} className="h-[12rem] rounded-t-xl">
<div className="flex flex-col shadow-md rounded-xl dark:border-[#5356fb29] overflow-hidden" key={key}>
<Link to={link_path} className="h-[12rem] bg-white">
<img
src={image}
alt="banner-img"
loading="lazy"
className="w-full h-full rounded-t-xl object-cover"
className="w-auto mx-auto h-full"
/>
</Link>
<div className="h-[7rem] rounded-b-xl bg-white dark:bg-dark-white">
<div className="rounded-b-xl bg-white dark:bg-dark-white">
<div className="border-b border-slate-300 px-2 py-1 h-[5.4rem] flex flex-col gap-2 dark:text-white">
<Link to={link_path} className="font-bold text-lg">
<Link to={link_path} className="font-bold text-lg line-clamp-1">
{title}
</Link>
<Link to={link_path} className="text-sm">
{desc}
</Link>
</div>
<div className="flex justify-between w-full px-2 items-center pt-[0.2rem]">
<div className="flex justify-between w-full p-1 items-center">
<Link to={link_path} className="text-slate-300 font-semibold text-sm">
{btn}
</Link>
@@ -104,6 +172,124 @@ const TopBanner = ({ image, title = "", desc = "", btn, link_path, key }) => {
);
};
const NewOfferCard = ({ 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="h-[12rem] bg-transparent">
{/* thumbnail image/video */}
{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`,
}}
>
{/* <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>
}
</div>
<div className="rounded-b-xl bg-transparent dark:bg-dark-transparent">
<div className="border-b border-slate-300 px-2 py-1 h-[5.4rem] 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 justify-center items-center space-x-2">
<button
type="button"
onClick={() =>
setOfferPopout({ show: true, data: { ...datas, image } })
}
className="btn-shine w-2/3 h-[40px] text-white rounded-full text-sm bg-pink flex justify-center items-center"
>
Start Now
</button>
</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>
</div>
);
};
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
@@ -113,7 +299,7 @@ const LowerBanner = ({ image, title = "", desc = "", btn, link_path, card_type,
className="flex flex-col bg-white shadow-md h-full rounded-xl dark:border-[#5356fb29] dark:bg-dark-white"
>
<div className="w-full xxs:flex justify-between items-center border-b border-slate-300 p-2">
<div className="min-h-[150px] sm:min-h-[130px] flex justify-between items-center">
<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">
<Link to={newLinkPath} className="text-lg font-bold">
{title}
@@ -132,7 +318,7 @@ const LowerBanner = ({ image, title = "", desc = "", btn, link_path, card_type,
/>
</Link>
</div>
<div className="flex justify-between w-full px-2 items-center">
<div className="flex justify-between w-full p-1 items-center">
<Link to={newLinkPath} className="text-slate-300 font-semibold text-sm">
{btn}
</Link>
@@ -181,7 +367,7 @@ const BannerSection = ({ banners, variant }) => {
variant === "top"
? "rounded-b-xl bg-white"
: "border-b border-slate-300"
} h-[7rem]`}
}`}
>
<div className="border-b border-slate-300 px-2 py-1 h-[5.4rem] flex flex-col gap-2">
<Link to={link_path} className="font-bold text-lg">
@@ -191,7 +377,7 @@ const BannerSection = ({ banners, variant }) => {
{short_description}
</Link>
</div>
<div className="flex justify-between w-full px-2 items-center">
<div className="flex justify-between w-full p-1 items-center">
<Link to={link_path} className="text-slate-300 font-semibold">
{short_button_text}
</Link>
@@ -5,7 +5,6 @@ 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, nextDueTask }) {
export default function HomeDashboard({ className, bannerList }) {
const { userDetails } = useSelector((state) => state?.userDetails);
let loginDate = userDetails?.last_login.split(" ")[0];
@@ -5,7 +5,6 @@ import { useSelector } from "react-redux";
export default function JobOwnerDashboard({
className,
bannerList,
nextDueTask,
}) {
const { userDetails } = useSelector((state) => state?.userDetails);
@@ -5,7 +5,6 @@ import { useSelector } from "react-redux";
export default function WorkerDashboard({
className,
bannerList,
nextDueTask,
}) {
const { userDetails } = useSelector((state) => state?.userDetails);
+19 -8
View File
@@ -20,6 +20,9 @@ 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,
@@ -65,35 +68,43 @@ 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;
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(() => {
@@ -189,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>
}
>
@@ -202,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"
}`}
@@ -224,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>
@@ -74,7 +74,7 @@ export default function FamilyPending({ familyData }) {
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray flex items-start gap-1">
Price:{" "}
Reward:{" "}
<span className="text-purple">
{thePrice}
</span>
@@ -97,7 +97,7 @@ export default function FamilyNewTasks({
</h1>
<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 flex flex-start gap-1">
Price:{" "}
Reward:{" "}
<span className="text-purple">
{thePrice}
</span>
@@ -83,7 +83,7 @@ export default function FamilyPending({
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray flex items-start gap-1">
Price:{" "}
Reward:{" "}
<span className="text-purple">
{thePrice}
</span>
@@ -87,7 +87,7 @@ export default function FamilyTasks({
</h1>
<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 flex flex-start gap-1">
Price:{" "}
Reward:{" "}
<span className="text-purple">
{thePrice}
</span>
@@ -1,17 +1,16 @@
import React, { useEffect, useState } from "react";
import ModalCom from "../../../Helpers/ModalCom";
import InputCom from "../../../Helpers/Inputs/InputCom";
import { Form, Formik } from "formik";
import React, { useEffect, useState } from "react";
import * as Yup from "yup";
import InputCom from "../../../Helpers/Inputs/InputCom";
import ModalCom from "../../../Helpers/ModalCom";
import { AmountTo2DP } from "../../../Helpers/PriceFormatter";
import usersService from "../../../../services/UsersService";
import LoadingSpinner from "../../../Spinners/LoadingSpinner";
import { PriceFormatter } from "../../../Helpers/PriceFormatter";
import { tableReload } from "../../../../store/TableReloads";
import { useDispatch, useSelector } from "react-redux";
import { apiConst } from "../../../../lib/apiConst";
import usersService from "../../../../services/UsersService";
import { tableReload } from "../../../../store/TableReloads";
import { SocketValues } from "../../../Contexts/SocketIOContext";
import { AmountTo2DP } from "../../../Helpers/PriceFormatter";
import LoadingSpinner from "../../../Spinners/LoadingSpinner";
const validationSchema = Yup.object().shape({
// amount: Yup.string()
@@ -31,10 +30,9 @@ const validationSchema = Yup.object().shape({
});
function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
const { userDetails } = useSelector((state) => state?.userDetails); // Gets User Detail
const {userDetails} = useSelector((state) => state?.userDetails); // Gets User Detail
const { parentAssignJobToKid } = SocketValues() // socket emit event from FULL account
const { parentAssignJobToKid } = SocketValues(); // socket emit event from FULL account
const dispatch = useDispatch();
@@ -60,7 +58,6 @@ function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
};
// FUNCTION TO PERFORM FAMILY TRANSFER
const handleAddFund = (values) => {
setRequestStatus({ loading: true, status: false, message: "" });
let senderBal = startTransfer?.data?.origing_current_balance || ""; // SENDER'S ACCOUNT BALANCE
@@ -143,12 +140,12 @@ function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
//SENDS MESSAGE TO SOCKET TO UPDATE CHILD ACCOUNT
// message, room
let socketMsg = {
"audience": "MEMBER",
"action": "REFRESH_WALLET",
"family_uid": reqData.family_uid,
}
let socketRoom = `FAMILY-${userDetails.uid}`
parentAssignJobToKid(socketMsg, socketRoom) //SENDS MESSAGE TO SOCKET TO UPDATE CHILD ACCOUNT
audience: "MEMBER",
action: "REFRESH_WALLET",
family_uid: reqData.family_uid,
};
let socketRoom = `FAMILY-${userDetails.uid}`;
parentAssignJobToKid(socketMsg, socketRoom); //SENDS MESSAGE TO SOCKET TO UPDATE CHILD ACCOUNT
setTimeout(() => {
setRequestStatus({ loading: false, status: false, message: "" });
@@ -189,14 +186,8 @@ function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
<ModalCom action={action} situation={situation}>
<div className="relative logout-modal-wrapper lg:w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="modal-header-con">
<h1 className="modal-title">
Add Fund
</h1>
<button
type="button"
className="modal-close-btn"
onClick={action}
>
<h1 className="modal-title">Add Fund</h1>
<button type="button" className="modal-close-btn" onClick={action}>
<svg
width="36"
height="36"
@@ -94,7 +94,7 @@ export default function InputCom({
placeholder={placeholder}
value={value}
onChange={inputHandler}
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
type={type}
id={name}
+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' &&
+6 -8
View File
@@ -22,7 +22,6 @@ export default function FullAccountDash(props) {
className="mb-4"
data={userDetails}
bannerList={props.bannerList}
nextDueTask={props.nextDueTask}
/>
);
case "FAMILY_PARENT_DASH":
@@ -31,7 +30,6 @@ export default function FullAccountDash(props) {
className="mb-4"
data={userDetails}
bannerList={props.bannerList}
nextDueTask={props.nextDueTask}
/>
);
case "WORKER_HOME_DASH":
@@ -40,7 +38,6 @@ export default function FullAccountDash(props) {
className="mb-4"
data={userDetails}
bannerList={props.bannerList}
nextDueTask={props.nextDueTask}
/>
);
case "JOBOWNER_HOME_DASH":
@@ -49,7 +46,6 @@ export default function FullAccountDash(props) {
className="mb-4"
data={userDetails}
bannerList={props.bannerList}
nextDueTask={props.nextDueTask}
/>
);
default:
@@ -62,16 +58,18 @@ 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} />
<AccountDashboard className="mb-4" bannerList={props.bannerList} offersList={props.offersList} imageServer={props.imageServer} />
)}
{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">
@@ -84,7 +82,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 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 || ""
}`}
>
+48 -49
View File
@@ -5,68 +5,65 @@ 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([]); // STATE TO HOLD ACTIVE/CURRENT TASKS
// const [MyActiveJobList, setMyActiveJobList] = useState({loading:true, data:[]}); // 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(() => {
const fetchData = async () => {
await Promise.all([getHomeDate(), getMyOffersList(), getMyActiveJobList()]);
};
if(userDetails?.account_type == 'FULL'){
fetchData();
}
}, []);
// useEffect(() => {
// if(userDetails?.account_type == 'FULL'){
// getMyActiveJobList();
// }
// }, []);
return (
<Layout>
{Object.keys(commonHeadBanner).length < 1 ?
<LoadingSpinner height='h-48' size='16' />
:
<div className="w-full">
{userDetails && userDetails?.account_type == "FAMILY" ? (
<FamilyDash
@@ -78,11 +75,12 @@ export default function Home(props) {
/>
) : userDetails && userDetails?.account_type == "FULL" ? (
<FullAccountDash
nextDueTask={nextDueTask}
bannerList={props.bannerList}
dashTypes={props.dashTypes}
offersList={MyOffersList}
MyActiveJobList={MyActiveJobList}
// offersList={MyOffersList}
// MyActiveJobList={MyActiveJobList}
offersList={props.offersList}
imageServer={props.imageServer}
/>
) : (
<div>
@@ -90,6 +88,7 @@ export default function Home(props) {
</div>
)}
</div>
}
</Layout>
);
}
+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>
</>
);
}
+264 -235
View File
@@ -1,254 +1,283 @@
import React, {useEffect, useState} from 'react'
import { PriceFormatter } from "../../Helpers/PriceFormatter";
import React, { useEffect, useState } from "react";
import usersService from "../../../services/UsersService";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
export default function LockJob({
details,
marketPlaceProduct,
ManageInterest,
manageInt,
handleInputChange,
MarketDetail,
marketMsg,
errMsg,
textValue,
}) {
const apiCall = new usersService();
export default function LockJob({details, marketPlaceProduct, ManageInterest, manageInt, handleInputChange, MarketDetail, marketMsg, errMsg, textValue}) {
const apiCall = new usersService()
const [completedTask, setCompletedTask] = useState({
loading: true,
data: [],
});
const [completedTask, setCompletedTask] = useState({
loading: true,
data: []
})
let thePrice = PriceFormatter(
details?.price * 0.01,
details?.currency_code,
details?.currency
);
let thePrice = PriceFormatter(
details?.price * 0.01,
details?.currency_code,
details?.currency
);
let cleanedText = details?.job_description
?.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&quot;/g, '"')
.replace(/&amp;/g, "&");
let cleanedText = details?.job_description
?.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&quot;/g, '"')
.replace(/&amp;/g, "&");
let dependOn = marketPlaceProduct?.filter(
(item) => item?.job_uid == details?.offer_depend_uid
)[0];
let dependOn = marketPlaceProduct?.filter(item => item?.job_uid == details?.offer_depend_uid)[0]
useEffect(() => {
apiCall
.getVerifyCompletedTask({ offer_depend_uid: details?.offer_depend_uid })
.then((res) => {
console.log("RES", res.data);
setCompletedTask({ loading: false, data: res?.data?.result_list });
})
.catch((err) => {
setCompletedTask({ loading: false, data: [] });
});
}, []);
useEffect(()=>{
apiCall.getVerifyCompletedTask({offer_depend_uid:details?.offer_depend_uid}).then(res => {
console.log('RES', res.data)
setCompletedTask({loading:false, data:res?.data?.result_list})
}).catch(err =>{
setCompletedTask({loading:false, data:[]})
})
},[])
return (
return (
<>
{completedTask.loading ? (
<div className="w-full md:col-span-4 flex justify-center items-center min-h-[500px]">
<LoadingSpinner size="10" />
</div>
) : (
<>
{completedTask.loading ?
<div className='w-full md:col-span-4 flex justify-center items-center min-h-[500px]'>
<LoadingSpinner
size='10'
/>
<div className="px-4 py-2 w-full md:col-span-3 md:border-r-1">
<div className="min-h-[200px]">
<h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide">
{details?.offer_depend_uid && (
<i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>
)}
{details?.title}
</h2>
{/* INPUT SECTION */}
{[
{
name: "Description",
content: details.description,
},
{
name: "",
content: {
text: `Timeline: ${details.timeline_days} day(s) -- `,
bold: `Budget: ${thePrice}`,
},
},
// {
// name: "Delivery Detail",
// content: cleanedText,
// danger: true,
// },
].map(({ name, content, danger }, idx) => (
<div className={`my-1 flex flex-col items-start`} key={idx}>
<label className="py-1 job-label w-full">{name}</label>
<div
className={`w-full p-2 text-slate-900 dark:text-white market-pop rounded-2xl ${
name == "Description"
? "min-h-[100px] max-h-[100px] h-full overflow-y-auto break-words bg-slate-50"
: name == "Delivery Detail"
? " overflow-y-auto h-full min-h-[100px] max-h-[100px] bg-slate-50"
: "h-full flex items-center"
}`}
>
{danger ? (
<p
className={`dark:text-black`}
dangerouslySetInnerHTML={{
__html: danger && content,
}}
/>
) : (
<p className={`w-full text-slate-900 dark:text-black`}>
{name !== "Delivery Detail" ? (
<>
{typeof content !== "object" ? content : null}
{typeof content === "object" && (
<>
{/* <hr className="mb-1" /> */}
<span className="flex w-full mb-1 h-[1px] bg-slate-500"></span>
<span className="flex items-center gap-2 dark:text-white">
{content?.text}
<strong>{thePrice}</strong>
</span>
<span className="flex w-full mt-1 h-[1px] bg-slate-500"></span>
{/* <hr className="mt-1" /> */}
</>
)}
</>
) : (
""
)}
</p>
)}
</div>
</div>
))}
</div>
:
<>
<div className="px-4 py-2 w-full md:col-span-3 md:border-r-1">
<div className="min-h-[200px]">
<h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide">
{details?.offer_depend_uid && <i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>}
{details?.title}
</h2>
{/* INPUT SECTION */}
{[
{
name: "Description",
content: details.description,
},
{
name: "",
content: {
text: `Timeline: ${details.timeline_days} day(s) -- `,
bold: `Budget: ${thePrice}`,
},
},
// {
// name: "Delivery Detail",
// content: cleanedText,
// danger: true,
// },
].map(({ name, content, danger }, idx) => (
<div className={`my-1 flex flex-col items-start`} key={idx}>
<label className="py-1 job-label w-full">
{name}
</label>
<div
className={`w-full p-2 text-slate-900 dark:text-white market-pop rounded-2xl ${
name == "Description"
? "min-h-[100px] max-h-[100px] h-full overflow-y-auto break-words bg-slate-50"
: name == "Delivery Detail" ? " overflow-y-auto h-full min-h-[100px] max-h-[100px] bg-slate-50"
: "h-full flex items-center"
}`}
>
{danger ? (
<p
className={`dark:text-black`}
dangerouslySetInnerHTML={{
__html: danger && content,
}}
/>
) : (
<p className={`w-full text-slate-900 dark:text-black`}>
{name !== "Delivery Detail" ? (
<>
{typeof content !== "object" ? content : null}
{typeof content === "object" && (
<>
{/* <hr className="mb-1" /> */}
<span className='flex w-full mb-1 h-[1px] bg-slate-500'></span>
<span className="flex items-center gap-2 dark:text-white">
{content?.text}
<strong>{thePrice}</strong>
</span>
<span className='flex w-full mt-1 h-[1px] bg-slate-500'></span>
{/* <hr className="mt-1" /> */}
</>
)}
</>
) : (
""
)}
</p>
)}
</div>
</div>
))}
</div>
{/* <hr className='my-3' /> */}
{completedTask.loading ?
<p className='py-3 w-full text-center text-lg'>Loading...</p>
:completedTask?.data?.filter(item => item?.job_uid == details.offer_depend_uid).length > 0 ?
<div className='w-full'>
<label className="job-label w-full flex gap-2 items-center">
If you have any questions about this task:
<span className={`text-sm ${marketMsg.state ? 'text-[#57cd89]' : 'text-red-500'}`}>
{marketMsg.state && "Message Sent!"}
{errMsg.market && "Failed to send"}
</span>
</label>
<div className="w-full flex items-center gap-3">
<div className="w-full">
<textarea
className={`p-1 w-full text-sm text-slate-900 dark:text-white ${
marketMsg.loading && "italic text-[#9CA3AF]"
} bg-transparent outline-none border-2 border-slate-300 rounded-md`}
rows="3"
style={{ resize: "none" }}
placeholder="Enter message here ..."
value={marketMsg.loading ? "Sending..." : textValue}
onChange={handleInputChange}
/>
</div>
<div className="relative flex flex-col">
<button
className="rounded-full flex justify-center items-center w-12 h-11 bg-yellow-500 text-white"
name="market-message"
onClick={MarketDetail}
disabled={marketMsg.loading}
>
{marketMsg.loading ? (
<LoadingSpinner size={5} color="white" />
) : (
// "Send Message"
<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>
:
<div className='w-full'>
<h1 className='text-red-600 text-lg'>This task depends on the task below</h1>
<div className='rounded-2xl bg-red-50'>
<div className='my-1 w-full'>
<h2 className="p-2 w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-black tracking-wide">
{dependOn?.offer_depend_uid && <i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>}
{dependOn?.title}
</h2>
</div>
<div className={`p-2 flex flex-col items-start`}>
<p className="py-1 job-label w-full dark:text-black">Description</p>
<div className={`w-full p-2 text-slate-900 dark:text-black market-pop rounded-2xl bg-white break-words min-h-[100px] max-h-[100px]`}>
{dependOn?.description}
</div>
</div>
</div>
</div>
}
</div>
<div className="py-2 w-full md:col-span-1 h-full flex flex-col rounded-2xl">
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] px-4 rounded-md w-full h-full md:min-h-[420px] flex flex-col justify-between">
<div className="w-full flex flex-col justify-center pb-4 gap-2">
<p className="job-label w-full">
Interested?
</p>
<hr />
{completedTask.loading ?
<p className='py-3 w-full text-center text-lg'>Loading...</p>
:completedTask?.data?.filter(item => item?.job_uid == details.offer_depend_uid).length > 0 ?
{/* <hr className='my-3' /> */}
{completedTask.loading ? (
<p className="py-3 w-full text-center text-lg">Loading...</p>
) : completedTask?.data?.filter(
(item) => item?.job_uid == details.offer_depend_uid
).length > 0 ? (
<div className="w-full">
<label className="job-label w-full flex gap-2 items-center">
If you have any questions about this task:
<span
className={`text-sm ${
marketMsg.state ? "text-[#57cd89]" : "text-red-500"
}`}
>
{marketMsg.state && "Message Sent!"}
{errMsg.market && "Failed to send"}
</span>
</label>
<div className="w-full flex items-center gap-3">
<div className="w-full">
<textarea
className={`p-1 w-full text-sm text-slate-900 dark:text-white ${
marketMsg.loading && "italic text-[#9CA3AF]"
} bg-transparent outline-none border-2 border-slate-300 rounded-md`}
rows="3"
style={{ resize: "none" }}
placeholder="Enter message here ..."
value={marketMsg.loading ? "Sending..." : textValue}
onChange={handleInputChange}
/>
</div>
<div className="relative flex flex-col">
<button
className="btn-gradient text-white px-2 py-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl"
name="market-interest"
onClick={ManageInterest}
className="rounded-full flex justify-center items-center w-12 h-11 bg-yellow-500 text-white"
name="market-message"
onClick={MarketDetail}
disabled={marketMsg.loading}
>
{" "}
<div className="flex md:flex-col justify-center gap-2">
<span>Notify</span>
<span>Owner</span>
</div>
{marketMsg.loading ? (
<LoadingSpinner size={5} color="white" />
) : (
// "Send Message"
<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>
:
<h1 className='text-red-600 text-base font-bold'>This task depends on completion of another task</h1>
}
<>
{manageInt.loading ? (
<p className="text-sm italic">please wait...</p>
) : (
<>
{manageInt?.msg !== "" && (
<p
className={`text-sm italic ${
manageInt?.state ? "text-green-500" : "text-red-500"
}`}
>
{manageInt?.msg}
</p>
)}
</>
)}
</>
</div>
</div>
</div>
) : (
<div className="w-full">
<h1 className="text-red-600 text-lg">
This task depends on the task below
</h1>
<div className="rounded-2xl bg-red-50">
<div className="my-1 w-full">
<h2 className="p-2 w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-black tracking-wide">
{dependOn?.offer_depend_uid && (
<i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>
)}
{dependOn?.title}
</h2>
</div>
<div className={`p-2 flex flex-col items-start`}>
<p className="py-1 job-label w-full dark:text-black">
Description
</p>
<div
className={`w-full p-2 text-slate-900 dark:text-black market-pop rounded-2xl bg-white break-words min-h-[100px] max-h-[100px]`}
>
{dependOn?.description}
</div>
</div>
</div>
</div>
)}
</div>
<div className="text-slate-900">
<p className="flex items-center tracking-wide">
<span className="job-label">Interest: </span> <b className="ml-1">{details.interest_count}</b>
</p>
<hr />
<p className="my-1 flex flex-col">
<span className="job-label">Expire: </span>
<span> {new Date(details.expire).toLocaleString()} </span>
</p>
<div className="py-2 w-full md:col-span-1 h-full flex flex-col rounded-2xl">
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] px-4 rounded-md w-full h-full md:min-h-[420px] flex flex-col justify-between">
<div className="w-full flex flex-col justify-center pb-4 gap-2">
<p className="job-label w-full">Interested?</p>
<hr />
{completedTask.loading ? (
<p className="py-3 w-full text-center text-lg">Loading...</p>
) : completedTask?.data?.filter(
(item) => item?.job_uid == details.offer_depend_uid
).length > 0 ? (
<button
className="btn-gradient text-white px-2 py-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl"
name="market-interest"
onClick={ManageInterest}
>
{" "}
<div className="flex md:flex-col justify-center gap-2">
<span>Notify</span>
<span>Owner</span>
</div>
</div>
</div>
</>
}
</button>
) : (
<h1 className="text-red-600 text-base font-bold">
This task depends on completion of another task
</h1>
)}
<>
{manageInt.loading ? (
<p className="text-sm italic">please wait...</p>
) : (
<>
{manageInt?.msg !== "" && (
<p
className={`text-sm italic ${
manageInt?.state ? "text-green-500" : "text-red-500"
}`}
>
{manageInt?.msg}
</p>
)}
</>
)}
</>
</div>
<div className="text-slate-900">
<p className="flex items-center tracking-wide">
<span className="job-label">Interest: </span>{" "}
<b className="ml-1">{details.interest_count}</b>
</p>
<hr />
<p className="my-1 flex flex-col">
<span className="job-label">Expire: </span>
<span> {new Date(details.expire).toLocaleString()} </span>
</p>
</div>
</div>
</div>
</>
)
)}
</>
);
}
@@ -1,4 +1,5 @@
import { useEffect, useMemo, useState } from "react";
import { useSelector } from "react-redux";
import { toast } from "react-toastify";
import usersService from "../../../services/UsersService";
import ModalCom from "../../Helpers/ModalCom";
@@ -9,6 +10,11 @@ import LockJob from "./LockJob";
const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduct }) => {
let { jobLists } = useSelector((state) => state.jobLists);
const interestCount = jobLists?.interest_list?.filter(item => item.job_uid == details.job_uid);
// console.log('interestList', interest_count)
// console.log('MEMO', jobLists?.interest_list, datas.job_uid)
let {sendJobInterestToOwner} = SocketValues() // function to emit job interest request
const emitOfferInterest = () => {
let message = {
@@ -326,7 +332,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
<div className="text-slate-900">
<p className="flex items-center tracking-wide">
<span className="job-label">Interest: </span> <b className="ml-1">{details.interest_count}</b>
<span className="job-label">Interest: </span> <b className="ml-1">{interestCount.length > 0 ? interestCount[0].interest_count : '0'}</b>
</p>
<hr />
<p className="my-1 flex flex-col">
@@ -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>
)
}
+34 -23
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";
@@ -364,7 +364,7 @@ function ActiveJobs(props) {
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
<span className="font-semibold text-black dark:text-white">
Price:{" "}
Reward:{" "}
</span>
<span className="">{thePrice}</span>
</div>
@@ -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
@@ -68,7 +68,7 @@ export default function MyActiveJobTable({ MyJobList, className }) {
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
Price:{" "}
Reward:{" "}
<span className="text-purple">
{thePrice}
</span>
@@ -68,7 +68,7 @@ export default function MyPastDueTaskTable({ MyJobList, className }) {
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
Price:{" "}
Reward:{" "}
<span className="text-purple">
{thePrice}
</span>
+1 -1
View File
@@ -277,7 +277,7 @@ function myJobTableFeatures(
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray flex items-start gap-1">
Price: <span className="text-purple">{thePrice}</span>
Reward: <span className="text-purple">{thePrice}</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
@@ -69,7 +69,7 @@ export default function MyPendingJobTable({ MyJobList, className }) {
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray flex items-start gap-1">
Price:{" "}
Reward:{" "}
<span className="text-purple">
{thePrice}
</span>
+1 -1
View File
@@ -94,7 +94,7 @@ export default function MyJobTable({ className, ActiveJobList, Account, imageSer
{task?.description}
</span>
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
Price:
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">
@@ -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} />
@@ -65,7 +65,7 @@ export default function MyWaitingJobTable({ MyJobList, className }) {
</h1>
<div>{value.description}</div>
<span className="text-sm text-thin-light-gray flex items-start gap-1">
Price:{" "}
Reward:{" "}
<span className="text-purple">
{thePrice}
</span>
+66 -53
View File
@@ -1,12 +1,7 @@
import { useSelector } from "react-redux";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import WalletItemCard from "./WalletItemCard";
import WalletItemCardFamily from "./WalletItemCardFamily";
import { useEffect, useState } from "react";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import SearchCom from "../Helpers/SearchCom";
import { localImgLoad } from "../../lib";
import background from "../../assets/images/bg-sky-blue.jpg";
import { localImgLoad } from "../../lib";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import FamilyWalletRedeemOptions from "./FamilyWalletRedeemOptions";
/**
@@ -14,29 +9,32 @@ import FamilyWalletRedeemOptions from "./FamilyWalletRedeemOptions";
*/
export default function FamilyWalletBox({ wallet, payment }) {
// const { loading, data } = wallet;
// const { userDetails } = useSelector((state) => state.userDetails);
// const accountType = userDetails?.account_type === "FAMILY";
const [selectedWallet, setSelectedWallet] = useState('')
const [activeWalletBtn, setActiveWalletBtn] = useState('')
const handleChangeWallet = ({target:{name}}) => { // FUNCTION TO SWITCH WALLET IF USER HAS MORE THAN TWO WALLETS
const currentWalletSelected = wallet?.data?.filter((item) => item.code == name);
setSelectedWallet(currentWalletSelected[0])
setActiveWalletBtn(name)
const [selectedWallet, setSelectedWallet] = useState("");
const [activeWalletBtn, setActiveWalletBtn] = useState("");
const handleChangeWallet = ({ target: { name } }) => {
// FUNCTION TO SWITCH WALLET IF USER HAS MORE THAN TWO WALLETS
const currentWalletSelected = wallet?.data?.filter(
(item) => item.code == name
);
setSelectedWallet(currentWalletSelected[0]);
setActiveWalletBtn(name);
// console.log(name, currentWalletSelected)
}
};
const image = selectedWallet?.code
? `${selectedWallet?.code.toLowerCase()}.svg`
: "default.png";
? `${selectedWallet?.code.toLowerCase()}.svg`
: "default.png";
useEffect(()=>{
setSelectedWallet(wallet.data[0])
setActiveWalletBtn(wallet?.data[0]?.code)
},[wallet])
useEffect(() => {
setSelectedWallet(wallet.data[0]);
setActiveWalletBtn(wallet?.data[0]?.code);
}, [wallet]);
return (
<div className="w-full">
@@ -44,31 +42,38 @@ export default function FamilyWalletBox({ wallet, payment }) {
<div className="main-wrapper w-full mb-10">
<div className="w-full mb-10 sm:grid grid-cols-2 gap-4">
<div className="w-full mb-4 sm:mb-0 rounded-2xl bg-white dark:bg-dark-white overflow-hidden">
{wallet?.loading ?
{wallet?.loading ? (
<div className="w-full h-full flex items-center justify-center bg-white">
<LoadingSpinner size="16" color="sky-blue" height='min-h-[240px]' />
<LoadingSpinner
size="16"
color="sky-blue"
height="min-h-[240px]"
/>
</div>
: wallet?.data.length > 0 ?
) : wallet?.data.length > 0 ? (
<>
{wallet?.data?.length > 1 &&
<div className="wal-selection px-5 py-2 text-black dark:text-white flex items-center gap-2">
{wallet?.data?.map(item =>(
<button
className={`py-0.5 px-1 mb-1 rounded-lg border border-orange-500 ${activeWalletBtn == item?.code && 'bg-orange-500'}`}
key={item?.wallet_uid}
name={item?.code}
onClick={handleChangeWallet}
>
{item?.description}
</button>
))}
</div>
}
<div className="p-5 bg-white-opacity min-h-[240px]"
style={{
background: `url(${background}) 0% 0% / cover no-repeat`,
}}
>
{wallet?.data?.length > 1 && (
<div className="wal-selection px-5 py-2 text-black dark:text-white flex items-center gap-2">
{wallet?.data?.map((item) => (
<button
className={`py-0.5 px-1 mb-1 rounded-lg border border-orange-500 ${
activeWalletBtn == item?.code && "bg-orange-500"
}`}
key={item?.wallet_uid}
name={item?.code}
onClick={handleChangeWallet}
>
{item?.description}
</button>
))}
</div>
)}
<div
className="p-5 bg-white-opacity min-h-[240px]"
style={{
background: `url(${background}) 0% 0% / cover no-repeat`,
}}
>
{/* image */}
<div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[100px] max-h-min md:max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
<img
@@ -77,21 +82,30 @@ export default function FamilyWalletBox({ wallet, payment }) {
alt="currency-icon"
/>
</div>
<p className="text-base sm:text-lg text-white opacity-[70%] tracking-wide my-3">Current Balance</p>
<p className="text-base sm:text-lg text-white opacity-[70%] tracking-wide my-3">
Current Balance
</p>
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
{PriceFormatter(selectedWallet?.amount/100, selectedWallet?.code, undefined, "text-[2rem]")}
{Formatter(
selectedWallet?.amount / 100,
selectedWallet?.code,
undefined,
"text-[2rem]"
)}
</p>
</div>
</>
:
) : (
<div className="w-full h-full flex justify-center items-center rounded-2xl bg-white">
<p>No Wallet Record Found</p>
</div>
}
)}
</div>
<div className="p-5 w-full rounded-2xl bg-white dark:bg-dark-white text-black dark:text-white h-full min-h-[240px] max-h-96">
<h1 className="text-xl font-bold text-black dark:text-white">
Recent Activities
</h1>
</div>
<div className="p-5 w-full rounded-2xl bg-white dark:bg-dark-white text-black dark:text-white h-full min-h-[240px] max-h-96">
<h1 className="text-xl font-bold text-black dark:text-white">Recent Activities</h1>
</div>
</div>
</div>
<div className="w-full">
@@ -102,7 +116,6 @@ export default function FamilyWalletBox({ wallet, payment }) {
);
}
// data.length>0 && data.map((item) => (
// <div key={item.wallet_uid} className="w-full h-full mb-10 ">
// {/* <WalletItemCardFamily walletItem={item} payment={payment} countries={countries} /> */}
@@ -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>
@@ -126,8 +126,8 @@ export default function OffersInterestTable({offerInterestList, className}) {
)
:
(
<div className="font-bold text-center text-xl md:text-2xl lg:text-4xl text-dark-gray md:flex items-center justify-between">
<p className="mb-4 p-3">No list avaliable.</p>
<div className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<p className="p-2">No list avaliable.</p>
</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"
+145 -103
View File
@@ -7,6 +7,7 @@ import LoadingSpinner from "../Spinners/LoadingSpinner";
import { Form, Formik } from "formik";
import * as Yup from "yup";
import ReferralTable from "../MyWallet/WalletComponent/ReferralTable";
import TabButton from "../customTabs/TabButton";
const validationSchema = Yup.object().shape({
ref_email: Yup.string()
@@ -105,13 +106,27 @@ function ReferralDisplay() {
sendReferralMsg({...values}); // FUNCTION TO SEND REFERRAL MESSAGE
};
const [selectedTab, setSelectedTab] = useState("Send Referral");
const tabs = [ //STATE FOR SWITCHING BETWEEN TABS
{
id: 1,
title: "Send Referral",
iconName: "history",
},
{
id: 2,
title: "Referral List",
iconName: "history",
},
]
useEffect(() => {
allReferrals();
}, [refHistoryReload]);
return (
<div className="content-wrapper w-full lg:flex xl:space-x-8 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<>
<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 inline-flex gap-3 text-dark-gray dark:text-white items-center">
@@ -119,111 +134,138 @@ function ReferralDisplay() {
</h1>
</div>
</div>
<div className="referral w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="mb-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Send Referral
</h2>
<Formik
initialValues={initialValues}
validationSchema={validationSchema}
onSubmit={handleSubmit}
>
{(props) => (
<Form className="referral-info">
<div className="block md:mb-6 md:flex gap-10">
{/* Firstname */}
<div className="field w-full mb-6 md:mb-0">
<InputCom
fieldClass="px-6"
label="Firstname"
type="text"
name="ref_firstname"
placeholder="Firstname"
value={props.values.ref_firstname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.ref_firstname &&
props.touched.ref_firstname && (
<p className="text-sm text-red-500">
{props.errors.ref_firstname}
</p>
)}
</div>
{/* Lastname */}
<div className="field w-full mb-6 md:mb-0">
<InputCom
fieldClass="px-6"
label="Lastname"
type="text"
name="ref_lastname"
placeholder="Lastname"
value={props.values.ref_lastname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.ref_lastname &&
props.touched.ref_lastname && (
<p className="text-sm text-red-500">
{props.errors.ref_lastname}
</p>
)}
</div>
</div>
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
label="Email"
type="text"
name="ref_email"
placeholder="Email"
value={props.values.ref_email}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.ref_email && props.touched.ref_email && (
<p className="text-sm text-red-500">
{props.errors.ref_email}
</p>
)}
</div>
<hr />
{error.message != "" && (
<p className="text-base text-red-500 py-2">{error.message}</p>
)}
<div className="referral-btn flex justify-end items-center py-4 border-b-4">
{error.loading ? (
<LoadingSpinner size="6" color="sky-blue" />
) : (
<button
type="submit"
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Send Message
</button>
)}
</div>
</Form>
)}
</Formik>
</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'>
{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]">
<>
{selectedTab == 'Send Referral' &&
<div className="referral w-full p-4">
<h2 className="mb-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Send Referral
</h2>
<Formik
initialValues={initialValues}
validationSchema={validationSchema}
onSubmit={handleSubmit}
>
{(props) => (
<Form className="referral-info">
<div className="block md:mb-6 md:flex gap-10">
{/* Firstname */}
<div className="field w-full mb-6 md:mb-0">
<InputCom
fieldClass="px-6"
label="Firstname"
type="text"
name="ref_firstname"
placeholder="Firstname"
value={props.values.ref_firstname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.ref_firstname &&
props.touched.ref_firstname && (
<p className="text-sm text-red-500">
{props.errors.ref_firstname}
</p>
)}
</div>
<div className="w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="mb-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Referral List
</h2>
{referralList.loading ? (
<LoadingSpinner size="32" color="sky-blue" />
) : (
<ReferralTable history={referralList} />
)}
{/* Lastname */}
<div className="field w-full mb-6 md:mb-0">
<InputCom
fieldClass="px-6"
label="Lastname"
type="text"
name="ref_lastname"
placeholder="Lastname"
value={props.values.ref_lastname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.ref_lastname &&
props.touched.ref_lastname && (
<p className="text-sm text-red-500">
{props.errors.ref_lastname}
</p>
)}
</div>
</div>
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
label="Email"
type="text"
name="ref_email"
placeholder="Email"
value={props.values.ref_email}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.ref_email && props.touched.ref_email && (
<p className="text-sm text-red-500">
{props.errors.ref_email}
</p>
)}
</div>
<hr />
{error.message != "" && (
<p className="text-base text-red-500 py-2">{error.message}</p>
)}
<div className="referral-btn flex justify-end items-center py-4">
{error.loading ? (
<LoadingSpinner size="6" color="sky-blue" />
) : (
<button
type="submit"
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Send Message
</button>
)}
</div>
</Form>
)}
</Formik>
</div>
}
{selectedTab == 'Referral List' &&
<>
<div className="w-full p-4">
<h2 className="mb-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Referral List
</h2>
{referralList.loading ? (
<LoadingSpinner size="22" color="sky-blue" />
) : (
<ReferralTable history={referralList} />
)}
</div>
</>
}
</>
</div>
</div>
</div>
</>
);
}
+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
@@ -119,7 +119,7 @@ function DeleteJobPopout({ details, onClose, situation }) {
{details.title}
</p>
<p className="text-lg tracking-wide text-dark-gray dark:text-white flex items-start gap-1">
<span className="job-label">Price: </span>{details.thePrice}
<span className="job-label">Reward: </span>{details.thePrice}
</p>
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
<span className="job-label">Duration: </span>{details.timeline_days} day(s)
+2 -2
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")
@@ -273,7 +273,7 @@ const EditJobPopOut = ({
<div className="field w-full">
<InputCom
fieldClass="px-6 text-right"
label="Price"
label="Reward"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
@@ -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")
@@ -274,7 +274,7 @@ const EditJobPopoutNew = ({
<div className="field w-full mb-[0.5rem] sm:mb-0">
<InputCom
fieldClass="px-6 text-right"
label="Price"
label="Reward"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
@@ -186,7 +186,7 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
</div>
<div className="my-2 md:flex">
<Detail label="Price" value={details.thePrice} />
<Detail label="Reward" value={details.thePrice} />
</div>
<div className="my-2 md:flex">
+1 -1
View File
@@ -263,7 +263,7 @@ function JobListPopout({
const DetailsComponent = () => {
const detailsArray = [
{ label: "Description", value: details.description },
{ label: "Price", value: details.thePrice },
{ label: "Reward", value: details.thePrice },
{ label: "Timeline", value: `${details.timeline_days} day(s)` },
{ label: "Created", value: new Date(details?.created).toDateString() },
];
@@ -246,7 +246,7 @@ function NewJobListPopout({
const DetailsComponent = () => {
const detailsArray = [
{ label: "Description", value: details.description },
{ label: "Price", value: details.thePrice },
{ label: "Reward", value: details.thePrice },
{ label: "Timeline", value: `${details.timeline_days} day(s)` },
{ label: "Created", value: new Date(details?.created).toDateString() },
];
@@ -344,11 +344,11 @@ function NewJobListPopout({
{selectedTab == 'family' ?
'Assign to family'
: selectedTab == 'public' ?
'Offer this job to public'
'Place in Market'
: selectedTab == 'individual' ?
'Offer this job to individual'
'Assign to individual'
: selectedTab == 'group' ?
'Offer this job to your Group'
'Preferred List'
:
null
}
+73 -46
View File
@@ -8,6 +8,7 @@ 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();
@@ -21,6 +22,12 @@ 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 = {
@@ -71,6 +78,7 @@ function OfferJobPopout({ details, onClose, situation }) {
setTimeout(() => {
onClose();
dispatch(tableReload({ type: "MYTASKTABLE" }));
dispatch(tableReload({ type: "HOMEBANNERS" }));
navigate("/mytask", { replace: true });
setRequestStatus({
loading: false,
@@ -133,56 +141,74 @@ function OfferJobPopout({ details, onClose, situation }) {
</svg>
</button>
</div>
<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>
<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">
{/* INPUT SECTION */}
<div className="my-2 md:flex">
<Detail
label="Date"
value={
(details.offer_added && details.offer_added?.split(" ")[0]) ||
"default"
}
/>
<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>
<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="Price" 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:w-1/4 h-full">
<div className="my-3 md:flex md:justify-center">
<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>
{requestStatus.loading && requestStatus.trigger == "offer" ? (
<LoadingSpinner size={8} color="sky-blue" />
) : (
@@ -190,9 +216,9 @@ function OfferJobPopout({ details, onClose, situation }) {
name="accept"
onClick={handleOffer}
disabled={requestStatus.loading}
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
className="px-2 h-28 flex justify-center items-center btn-gradient text-2xl rounded-xl text-white"
>
Accept Offer
Start Now
</button>
)}
</div>
@@ -205,9 +231,10 @@ function OfferJobPopout({ details, onClose, situation }) {
name="reject"
onClick={handleOffer}
disabled={requestStatus.loading}
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
className="group relative px-2 h-11 flex justify-center items-center text-base text-black dark:text-white"
>
Reject Offer
<div className='absolute bottom-1 w-full h-[1px] bg-black hidden group-hover:block'></div>
</button>
)}
</div>
+6 -12
View File
@@ -3,13 +3,13 @@ import { useNavigate } from "react-router-dom";
import { toast } from "react-toastify";
import usersService from "../../services/UsersService";
import ModalCom from "../Helpers/ModalCom";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import Detail from "./popoutcomponent/Detail";
import {PriceFormatter} from '../Helpers/PriceFormatter'
import { useDispatch } from "react-redux";
import { tableReload } from "../../store/TableReloads";
import { NewDateTimeFormatter } from "../../lib/NewDateTimeFormatter";
import { tableReload } from "../../store/TableReloads";
const showSuccessToast = (message) => {
toast.success(message, {
@@ -73,7 +73,7 @@ function PendingJobsPopout({ details, onClose, situation }) {
setRequestMessage({ status: true, message: res.data.status });
dispatch(tableReload({ type: "PENDINGTABLE" }));
setTimeout(() => {
onClose()
onClose();
setPendingJobLoader({ extend: false, offer: false });
setRequestMessage({ status: false, message: "" });
}, 4000);
@@ -140,14 +140,8 @@ function PendingJobsPopout({ details, onClose, situation }) {
<ModalCom action={onClose} situation={situation}>
<div className="logout-modal-wrapper w-[90%] md:w-[768px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="modal-header-con">
<h1 className="modal-title">
Manage Pending Item
</h1>
<button
type="button"
className="modal-close-btn"
onClick={onClose}
>
<h1 className="modal-title">Manage Pending Item</h1>
<button type="button" className="modal-close-btn" onClick={onClose}>
<svg
width="36"
height="36"
@@ -214,7 +208,7 @@ function PendingJobsPopout({ details, onClose, situation }) {
<div className="my-2 md:flex">
<Detail
label="Price"
label="Reward"
// value={`${details.price * 0.01} ${details.currency}`}
value={PriceFormatter(
details.price * 0.01,
@@ -48,7 +48,7 @@ export default function AssignToFamily({
</div>
<div className="mt-3 mb-1 flex justify-end items-center">
<button
className={`px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white`}
className={`uppercase px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white`}
type="submit"
name='family'
>
@@ -48,14 +48,14 @@ export default function AssignToGroup({
</div>
<div className="mt-3 mb-1 flex justify-end items-center">
<button
className={`px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white`}
className={`uppercase px-4 h-11 flex justify-center items-center btn-gradient text-sm rounded-full text-white`}
type="submit"
name='group'
>
{loader?.jobFields ?
<LoadingSpinner size={5} />
:
'Send Order to Group'
'Send Task to Group'
}
</button>
</div>
@@ -53,7 +53,7 @@ export default function AssignToIndividual({
</div>
<div className="mt-3 mb-1 flex justify-end items-center">
<button
className={`px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white`}
className={`uppercase px-4 h-11 flex justify-center items-center btn-gradient text-sm rounded-full text-white`}
type="submit"
name='individual'
>
@@ -102,14 +102,14 @@ export default function AssignToPublic({
</div>
<div className="mt-3 mb-1 flex justify-end items-center">
<button
className={`px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white`}
className={`uppercase px-4 h-11 flex justify-center items-center btn-gradient text-sm rounded-full text-white`}
type="submit"
name='public'
>
{loader?.jobFields ?
<LoadingSpinner size={5} />
:
'Show Task to Public'
'Place Task to the Market'
}
</button>
</div>
+1 -1
View File
@@ -53,7 +53,7 @@
.job-action {
background-color: #4687ba;
border-radius: 15px;
padding: 3px;
padding: 10px;
}
.msg_box {
+4 -1
View File
@@ -278,5 +278,8 @@ export const apiConst = {
PAY_MODE_CCARD: 1,
PAY_MODE_BONUS: 9,
APPROVED_BALANCE: 5,
DISAPROVE_BALANCE: 3
DISAPROVE_BALANCE: 3,
WRENCHBOARD_VERIFY_PROMO: 55056,
WRENCHBOARD_LOGIN_PROMO: 55057,
};
+40 -38
View File
@@ -27,7 +27,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
const navigate = useNavigate();
const { jobListTable, marketTableList, walletTable, familyBannersListTable } = useSelector(
const { jobListTable, marketTableList, walletTable, familyBannersListTable, homeBanners } = useSelector(
(state) => state.tableReload
);
@@ -111,8 +111,26 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}
}, []);
//FUNCTION TO GET COMMON HEAD DATA
useEffect(() => {
const getNotifications = () => {
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
dispatch(updateNotifications({ loading: true }));
apiCall
@@ -168,7 +186,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
dispatch(updateNotifications({ loading: false, data: null }));
});
};
getNotifications();
// delay verify requests by 10000ms
const delay15secs = setTimeout(notifications, 15000)
return ()=> clearTimeout(delay15secs)
}, []);
useEffect(() => {
@@ -230,41 +250,23 @@ 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
.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]);
// 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
+42 -2
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", ``);
@@ -208,7 +208,7 @@ class usersService {
// }
getHeroJBanners() {
var postData = {
uuid: localStorage.getItem("uid"),
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
page: 0,
@@ -1493,6 +1493,46 @@ class usersService {
return this.postAuxEnd("/verifycompleted", postData);
}
// API FUNCTION TO VERIFY PROMO LINK
verifyPromo(reqData) {
var postData = {
action: apiConst.WRENCHBOARD_VERIFY_PROMO,
...reqData
};
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);
}
/*
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
+4
View File
@@ -14,6 +14,7 @@ const initialState = {
familyOfferList: false,
parentFamilyTaskList: false,
offerInterestListReload: false,
homeBanners: false,
};
export const tableReloadSlice = createSlice({
@@ -61,6 +62,9 @@ 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;
}
+14 -4
View File
@@ -1,13 +1,23 @@
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 = {
bannerList: commonHeadBanner?.result_list,
dashTypes: commonHeadBanner?.home_dash_type,
};
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])
return (
<>
+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}
/>
}
</>
);
}
+10
View File
@@ -0,0 +1,10 @@
import React from 'react'
import Promo from '../components/AuthPages/Promo/Promo'
export default function PromoPage() {
return (
<>
<Promo />
</>
)
}