Compare commits
96 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 40b5e92047 | |||
| bc867ee8aa | |||
| 7c430d03bd | |||
| 9125990d70 | |||
| e64728e127 | |||
| d82b454caf | |||
| db423a3f1e | |||
| 4376938217 | |||
| 0411ab82f0 | |||
| c7d5d5533c | |||
| 3f7c673087 | |||
| da389c937e | |||
| c71d901556 | |||
| 804f76100a | |||
| 64f6e55fb6 | |||
| 16119dc332 | |||
| ae08f392ca | |||
| b646f020a5 | |||
| 31b411dcab | |||
| 48d66d263e | |||
| 2a6900f6a9 | |||
| 8b3e1e8923 | |||
| c87657eaef | |||
| 9cccd72512 | |||
| 146e8b383e | |||
| 7bb78772f7 | |||
| 094ba4fde8 | |||
| d31005c1ce | |||
| 3992ab696c | |||
| f1ed5f3a95 | |||
| 65b4c59129 | |||
| d620728651 | |||
| 4499f2d356 | |||
| fa00555a6f | |||
| 00fcb275f1 | |||
| c987ba63ff | |||
| 89797cdb3f | |||
| c719c15b2b | |||
| f3b1c229ea | |||
| 0335edf1dc | |||
| f7db65d527 | |||
| 27dc4090fb | |||
| 7f631190dc | |||
| 6815eea66c | |||
| c8e2ae9efb | |||
| 455248f9db | |||
| fee3376a88 | |||
| 956abc8411 | |||
| 64f3625990 | |||
| 9ec8855ed6 | |||
| 06450808ed | |||
| 7eecd34a5e | |||
| ab3693fc0b | |||
| e1879222b3 | |||
| 22250da988 | |||
| 7e8704d633 | |||
| 99d9a468f6 | |||
| 2ca1c668f5 | |||
| 0bb9528690 | |||
| 78a9c4bf5f | |||
| 0440b36f24 | |||
| de56fb601a | |||
| f286960bed | |||
| a8a090c671 | |||
| 24e2a905d2 | |||
| 19c2500263 | |||
| 909c74b734 | |||
| 0ea988fcea | |||
| 8be4ee52f1 | |||
| db5eb85794 | |||
| fb6a2767bc | |||
| c48ae540cc | |||
| c51693deb5 | |||
| b28d02b2f5 | |||
| 74b395d99e | |||
| 21a2754fc9 | |||
| 19282ad15a | |||
| f48b72b149 | |||
| 72d4af20aa | |||
| e6f5746692 | |||
| d0e7f58d5f | |||
| f4e21cb73e | |||
| 6ad8ed34f5 | |||
| b4bbe03bdd | |||
| 2c54aa36f8 | |||
| 00c83b357f | |||
| 0b7ec73409 | |||
| f58e8834fb | |||
| 1a829789d4 | |||
| 84dccfca50 | |||
| 49e3fc5810 | |||
| e4b6391ed2 | |||
| 3abbdd32eb | |||
| e4a5c2682e | |||
| 21abc93a04 | |||
| d51bbdbc29 |
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 |
@@ -68,6 +68,8 @@ import FamilyWalletPage from "./views/FamilyWalletPage";
|
|||||||
import FamilyActivitiesPage from "./views/FamilyActivitiesPage";
|
import FamilyActivitiesPage from "./views/FamilyActivitiesPage";
|
||||||
import FamGamesPage from "./views/FamGamesPage";
|
import FamGamesPage from "./views/FamGamesPage";
|
||||||
import FamilyRoutesPage from "./views/FamilyRoutesPage";
|
import FamilyRoutesPage from "./views/FamilyRoutesPage";
|
||||||
|
import PromoPage from "./views/PromoPage";
|
||||||
|
import LearnMorePage from "./views/LearnMorePage";
|
||||||
|
|
||||||
export default function Routers() {
|
export default function Routers() {
|
||||||
return (
|
return (
|
||||||
@@ -93,6 +95,7 @@ export default function Routers() {
|
|||||||
<Route exact path="/outmessage" element={<VerifyYouPagesTwo />} />
|
<Route exact path="/outmessage" element={<VerifyYouPagesTwo />} />
|
||||||
<Route exact path="/eoffer" element={<LoginPageTwo />} />
|
<Route exact path="/eoffer" element={<LoginPageTwo />} />
|
||||||
<Route exact path="/invite" 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="/sell" element={<SellPage />} />
|
||||||
<Route exact path="/saved" element={<SavedPage />} />
|
<Route exact path="/saved" element={<SavedPage />} />
|
||||||
<Route exact path="/history" element={<HistoryPage />} />
|
<Route exact path="/history" element={<HistoryPage />} />
|
||||||
|
<Route exact path="/learnmore" element={<LearnMorePage />} />
|
||||||
{/*<Route exact path="/upload-product" element={<UploadProductPage />} />*/}
|
{/*<Route exact path="/upload-product" element={<UploadProductPage />} />*/}
|
||||||
<Route exact path="/my-uploads" element={<UploadProductPage />} />
|
<Route exact path="/my-uploads" element={<UploadProductPage />} />
|
||||||
<Route exact path="/profile" element={<AuthProfilePage />} />
|
<Route exact path="/profile" element={<AuthProfilePage />} />
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 125 KiB |
@@ -162,7 +162,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
<div className="field w-full mb-[5px] xl:mb-0">
|
<div className="field w-full mb-[5px] xl:mb-0">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6 text-right flex"
|
fieldClass="px-6 text-right flex"
|
||||||
label="Price"
|
label="Reward"
|
||||||
labelClass=""
|
labelClass=""
|
||||||
type="number"
|
type="number"
|
||||||
name="price"
|
name="price"
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const validationSchema = Yup.object().shape({
|
|||||||
.required("Price is required"),
|
.required("Price is required"),
|
||||||
title: Yup.string()
|
title: Yup.string()
|
||||||
.min(5, "Minimum 5 characters")
|
.min(5, "Minimum 5 characters")
|
||||||
.max(149, "Maximum 149 characters")
|
.max(80, "Maximum 80 characters")
|
||||||
.required("Title is required"),
|
.required("Title is required"),
|
||||||
description: Yup.string()
|
description: Yup.string()
|
||||||
.min(5, "Minimum 5 characters")
|
.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">
|
<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">
|
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||||
<tbody>
|
<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 pr-12">List</td>
|
||||||
<td className="py-4 text-start px-2">Product Name</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">Price</td>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default function ForgotPassword() {
|
|||||||
setResetLoading(true);
|
setResetLoading(true);
|
||||||
try {
|
try {
|
||||||
const res = await userApi.StartResetPassword(reqData);
|
const res = await userApi.StartResetPassword(reqData);
|
||||||
if (res.status === 200) {
|
if (res.status === 200 && res?.data?.internal_return >= 0) {
|
||||||
setMsgSuccess(true);
|
setMsgSuccess(true);
|
||||||
setMail("");
|
setMail("");
|
||||||
setValue(false);
|
setValue(false);
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ import { updateUserDetails } from "../../../store/UserDetails";
|
|||||||
|
|
||||||
import ReCAPTCHA from "react-google-recaptcha";
|
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() {
|
export default function Login() {
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
@@ -526,40 +529,43 @@ export default function Login() {
|
|||||||
{/* APP DOWNLOAD STORE */}
|
{/* APP DOWNLOAD STORE */}
|
||||||
<div className="w-full mt-4">
|
<div className="w-full mt-4">
|
||||||
<div className="w-full flex justify-center items-center gap-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
|
<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"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
href={process.env.REACT_APP_APPLE_APP}
|
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">
|
<div className="flex flex-col">
|
||||||
<span className="text-[11px]">Available on the</span>
|
<span className="text-[11px]">Available on the</span>
|
||||||
<span className="text-[12px] lg:text-base">
|
<span className="text-[12px] lg:text-base">
|
||||||
App Store
|
App Store
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div> */}
|
||||||
|
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-28 lg:w-32">
|
<div className="w-32 lg:w-48">
|
||||||
<a
|
<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"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
href={process.env.REACT_APP_ANDROID_APP}
|
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">
|
<div className="flex flex-col">
|
||||||
<span className="text-[11px]">Available on the</span>
|
<span className="text-[11px]">Available on the</span>
|
||||||
<span className="text-[12px] lg:text-base">
|
<span className="text-[12px] lg:text-base">
|
||||||
Google Play
|
Google Play
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div> */}
|
||||||
|
<img src={GoogleDownload} className='w-full h-auto' alt='IOS Download' />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{loginType == "full" && (
|
{loginType == "full" && (
|
||||||
<>
|
<>
|
||||||
<div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]">
|
<div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]">
|
||||||
|
|||||||
@@ -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">
|
||||||
|
© {new Date().getFullYear()} -
|
||||||
|
</span>
|
||||||
|
<Link to="/" className="text-[#009ef7] ml-1">
|
||||||
|
WrenchBoard
|
||||||
|
</Link>{" "}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -5,6 +5,9 @@ import usersService from "../../../services/UsersService";
|
|||||||
import InputCom from "../../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import AuthLayout from "../AuthLayout2";
|
import AuthLayout from "../AuthLayout2";
|
||||||
|
|
||||||
|
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
|
||||||
|
import IOSDownload from '../../../assets/images/download/apple.jpg'
|
||||||
|
|
||||||
export default function SignUp() {
|
export default function SignUp() {
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
@@ -347,36 +350,38 @@ export default function SignUp() {
|
|||||||
{/* APP DOWNLOAD STORE */}
|
{/* APP DOWNLOAD STORE */}
|
||||||
<div className="w-full mt-4">
|
<div className="w-full mt-4">
|
||||||
<div className="w-full flex justify-center items-center gap-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
|
<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"
|
target="_blank"
|
||||||
href={process.env.REACT_APP_APPLE_APP}
|
|
||||||
rel="noreferrer"
|
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">
|
<div className="flex flex-col">
|
||||||
<span className="text-[11px]">Available on the</span>
|
<span className="text-[11px]">Available on the</span>
|
||||||
<span className="text-[12px] lg:text-base">
|
<span className="text-[12px] lg:text-base">
|
||||||
App Store
|
App Store
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div> */}
|
||||||
|
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-28 lg:w-32">
|
<div className="w-32 lg:w-48">
|
||||||
<a
|
<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"
|
target="_blank"
|
||||||
href={process.env.REACT_APP_ANDROID_APP}
|
|
||||||
rel="noreferrer"
|
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">
|
<div className="flex flex-col">
|
||||||
<span className="text-[11px]">Available on the</span>
|
<span className="text-[11px]">Available on the</span>
|
||||||
<span className="text-[12px] lg:text-base">
|
<span className="text-[12px] lg:text-base">
|
||||||
Google Play
|
Google Play
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div> */}
|
||||||
|
<img src={GoogleDownload} className='w-full h-auto' alt='IOS Download' />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ export default function ActivitiesTab({ className }) {
|
|||||||
<div className="relative w-full overflow-x-auto sm:rounded-lg">
|
<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">
|
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||||
<tbody>
|
<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 pr-12">List</td>
|
||||||
<td className="py-4 text-start px-2">Product Name</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">Quantity</td>
|
||||||
<td className="py-4 text-start px-2">From</td>
|
<td className="py-4 text-start px-2">From</td>
|
||||||
<td className="py-4 text-start px-2 pr-12">To</td>
|
<td className="py-4 text-start px-2 pr-12">To</td>
|
||||||
|
|||||||
@@ -28,21 +28,14 @@ export default function VerifyYou() {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-area">
|
<div className="input-area">
|
||||||
<div className="mb-5">
|
<div className="mb-5">
|
||||||
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
|
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
|
||||||
<b>Verify Email.</b> Help us secure your WrenchBoard account
|
Please <span className="font-semibold tracking-wide">verify your email</span> to secure your account.
|
||||||
by verifying your email registration address. Verification
|
|
||||||
will let you access all of WrenchBoard's features.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-5">
|
<div className="mb-5">
|
||||||
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
|
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
|
||||||
If you do not receive the confirmation message within a few
|
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"
|
||||||
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.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,9 +26,11 @@ export default function BlogItem(props) {
|
|||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const blog_id = queryParams.get("blog_id");
|
const blog_id = queryParams.get("blog_id");
|
||||||
|
|
||||||
|
// console.log('MUMU', 'meta_value', blogdata, blogdata.data.image_url)
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(!blog_id){
|
if(!blog_id){
|
||||||
navigate('/',{replace:true})
|
return navigate('/',{replace:true})
|
||||||
}
|
}
|
||||||
apiCall.getSingleBlogData({blog_id}).then(res => {
|
apiCall.getSingleBlogData({blog_id}).then(res => {
|
||||||
setBlogdata({loading: false, data:res.data})
|
setBlogdata({loading: false, data:res.data})
|
||||||
@@ -87,7 +89,11 @@ export default function BlogItem(props) {
|
|||||||
<div className="slider-btns flex space-x-4">
|
<div className="slider-btns flex space-x-4">
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ export default function AvailableJobsCard({
|
|||||||
<div className="block sm:flex flex-wrap gap-4">
|
<div className="block sm:flex flex-wrap gap-4">
|
||||||
<p className="text-sm text-thin-light-gray flex flext-start gap-1 items-center">
|
<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>}
|
{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>
|
||||||
<p className="text-sm text-thin-light-gray">
|
<p className="text-sm text-thin-light-gray">
|
||||||
Duration:{" "}
|
Duration:{" "}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default function OfferCard({
|
|||||||
let image = `${image_server}${localStorage.getItem("session_token")}/job/${datas.job_uid}`
|
let image = `${image_server}${localStorage.getItem("session_token")}/job/${datas.job_uid}`
|
||||||
|
|
||||||
return (
|
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="content">
|
||||||
<div className="w-full h-40">
|
<div className="w-full h-40">
|
||||||
{/* thumbnail image/video */}
|
{/* thumbnail image/video */}
|
||||||
@@ -46,24 +46,24 @@ export default function OfferCard({
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div className="w-full p-2 rounded-lg border border-[#E3E4FE] dark:border-[#a7a9b533] ">
|
<div className="w-full p-2 rounded-lg border border-[#E3E4FE] dark:border-[#a7a9b533] ">
|
||||||
<div className="grid grid-cols-1 gap-2">
|
{/* <div className="grid grid-cols-1 gap-2">
|
||||||
{/* <div className="flex flex-col justify-between items-center border-r-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">
|
<p className="text-sm text-thin-light-gray dark:text-white tracking-wide">
|
||||||
Task Code
|
Task Code
|
||||||
</p>
|
</p>
|
||||||
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
||||||
{datas.contract}
|
{datas.contract}
|
||||||
</p>
|
</p>
|
||||||
</div> */}
|
</div>
|
||||||
<div className="flex flex-col justify-between items-center">
|
<div className="flex flex-col justify-between items-center">
|
||||||
<p className="text-sm text-red-500 tracking-wide">Expires</p>
|
<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">
|
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
||||||
<CountDown lastDate={datas.expire} />
|
<CountDown lastDate={datas.expire} />
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
|
|
||||||
<hr className="my-2" />
|
{/* <hr className="my-2" /> */}
|
||||||
|
|
||||||
<div className="grid grid-cols-2 gap-2">
|
<div className="grid grid-cols-2 gap-2">
|
||||||
<div className="flex flex-col justify-between items-center border-r-2">
|
<div className="flex flex-col justify-between items-center border-r-2">
|
||||||
@@ -74,13 +74,19 @@ export default function OfferCard({
|
|||||||
{thePrice}
|
{thePrice}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</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">
|
<p className="text-sm text-thin-light-gray dark:text-white tracking-wide">
|
||||||
Timeline
|
Timeline
|
||||||
</p>
|
</p>
|
||||||
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
||||||
{`${datas.timeline_days} day(s)`}
|
{`${datas.timeline_days} day(s)`}
|
||||||
</p>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export default function SocketIOContextProvider({children}) {
|
|||||||
}
|
}
|
||||||
console.log('data', data)
|
console.log('data', data)
|
||||||
});
|
});
|
||||||
|
// dispatch(tableReload({ type: "HOMEBANNERS" })); // RELOADS HOME BANNERS
|
||||||
|
|
||||||
}, [socket]);
|
}, [socket]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
import React from "react";
|
import React, { Suspense, lazy, useState } from "react";
|
||||||
import { Link } from "react-router-dom";
|
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
|
// getting the upper three banners for the home layout
|
||||||
const getUpperBanner = bannerList?.filter((value, idx) => idx <= 2);
|
const getUpperBanner = bannerList?.filter((value, idx) => idx <= 2 - offersListLength);
|
||||||
const getLowerBanner = bannerList?.filter((value, idx) => idx > 2);
|
const getLowerBanner = bannerList?.filter((value, idx) => !getUpperBanner?.map(item => item?.title)?.includes(value.title));
|
||||||
|
|
||||||
let getImage = ({ banner_location, banner }) => {
|
let getImage = ({ banner_location, banner }) => {
|
||||||
if (banner_location == "LOCAL") {
|
if (banner_location == "LOCAL") {
|
||||||
@@ -14,56 +23,115 @@ const AccountDashboard = ({ className, bannerList }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(getLowerBanner);
|
|
||||||
return (
|
return (
|
||||||
<div
|
<>
|
||||||
className={`w-full min-h-[450px] flex flex-col justify-between items-center gap-4 rounded-2xl overflow-hidden ${
|
<div
|
||||||
className || ""
|
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);
|
|
||||||
|
|
||||||
let { short_title, short_description, short_button_text, link_path } =
|
{/* for normal banner section */}
|
||||||
props;
|
<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
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
let image = `${imageServer}${localStorage.getItem("session_token")}/job/${item.job_uid}`
|
||||||
<div key={idx}>
|
if(index < offersListLength){
|
||||||
<TopBanner
|
return (
|
||||||
btn={short_button_text}
|
<div key={item.offer_uid}>
|
||||||
image={image}
|
<NewOfferCard datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
|
||||||
title={short_title}
|
</div>
|
||||||
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>
|
||||||
<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 } =
|
{/* Offer Job Popout */}
|
||||||
props;
|
{offerPopout.show && (
|
||||||
|
<OfferJobPopout
|
||||||
return (
|
details={offerPopout.data}
|
||||||
<div key={idx}>
|
onClose={() => {
|
||||||
<LowerBanner
|
setOfferPopout({ show: false, data: {} });
|
||||||
btn={short_button_text}
|
}}
|
||||||
image={image}
|
situation={offerPopout.show}
|
||||||
title={short_title}
|
/>
|
||||||
desc={short_description}
|
)}
|
||||||
link_path={link_path}
|
{/* End of Offer Job Popout */}
|
||||||
card_type={card_type}
|
</>
|
||||||
blog_id={blog_id}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -71,25 +139,25 @@ export default AccountDashboard;
|
|||||||
|
|
||||||
const TopBanner = ({ image, title = "", desc = "", btn, link_path, key }) => {
|
const TopBanner = ({ image, title = "", desc = "", btn, link_path, key }) => {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col shadow-md rounded-xl dark:border-[#5356fb29]" key={key}>
|
<div className="flex flex-col shadow-md rounded-xl dark:border-[#5356fb29] overflow-hidden" key={key}>
|
||||||
<Link to={link_path} className="h-[12rem] rounded-t-xl">
|
<Link to={link_path} className="h-[12rem] bg-white">
|
||||||
<img
|
<img
|
||||||
src={image}
|
src={image}
|
||||||
alt="banner-img"
|
alt="banner-img"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
className="w-full h-full rounded-t-xl object-cover"
|
className="w-auto mx-auto h-full"
|
||||||
/>
|
/>
|
||||||
</Link>
|
</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">
|
<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}
|
{title}
|
||||||
</Link>
|
</Link>
|
||||||
<Link to={link_path} className="text-sm">
|
<Link to={link_path} className="text-sm">
|
||||||
{desc}
|
{desc}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</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">
|
<Link to={link_path} className="text-slate-300 font-semibold text-sm">
|
||||||
{btn}
|
{btn}
|
||||||
</Link>
|
</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 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
|
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"
|
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="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">
|
<div className="px-2 flex flex-col gap-2 dark:text-white">
|
||||||
<Link to={newLinkPath} className="text-lg font-bold">
|
<Link to={newLinkPath} className="text-lg font-bold">
|
||||||
{title}
|
{title}
|
||||||
@@ -132,7 +318,7 @@ const LowerBanner = ({ image, title = "", desc = "", btn, link_path, card_type,
|
|||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</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">
|
<Link to={newLinkPath} className="text-slate-300 font-semibold text-sm">
|
||||||
{btn}
|
{btn}
|
||||||
</Link>
|
</Link>
|
||||||
@@ -181,7 +367,7 @@ const BannerSection = ({ banners, variant }) => {
|
|||||||
variant === "top"
|
variant === "top"
|
||||||
? "rounded-b-xl bg-white"
|
? "rounded-b-xl bg-white"
|
||||||
: "border-b border-slate-300"
|
: "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">
|
<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">
|
<Link to={link_path} className="font-bold text-lg">
|
||||||
@@ -191,7 +377,7 @@ const BannerSection = ({ banners, variant }) => {
|
|||||||
{short_description}
|
{short_description}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</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">
|
<Link to={link_path} className="text-slate-300 font-semibold">
|
||||||
{short_button_text}
|
{short_button_text}
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { useSelector } from "react-redux";
|
|||||||
export default function FamilyParentDashboard({
|
export default function FamilyParentDashboard({
|
||||||
className,
|
className,
|
||||||
bannerList,
|
bannerList,
|
||||||
nextDueTask,
|
|
||||||
}) {
|
}) {
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from "react";
|
|||||||
// import HomeSliders from "./HomeSliders";
|
// import HomeSliders from "./HomeSliders";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
export default function HomeDashboard({ className, bannerList, nextDueTask }) {
|
export default function HomeDashboard({ className, bannerList }) {
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
let loginDate = userDetails?.last_login.split(" ")[0];
|
let loginDate = userDetails?.last_login.split(" ")[0];
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { useSelector } from "react-redux";
|
|||||||
export default function JobOwnerDashboard({
|
export default function JobOwnerDashboard({
|
||||||
className,
|
className,
|
||||||
bannerList,
|
bannerList,
|
||||||
nextDueTask,
|
|
||||||
}) {
|
}) {
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { useSelector } from "react-redux";
|
|||||||
export default function WorkerDashboard({
|
export default function WorkerDashboard({
|
||||||
className,
|
className,
|
||||||
bannerList,
|
bannerList,
|
||||||
nextDueTask,
|
|
||||||
}) {
|
}) {
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ export default function FamilyTableNew() {
|
|||||||
|
|
||||||
let { pathname } = useLocation();
|
let { pathname } = useLocation();
|
||||||
|
|
||||||
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
|
const preSelectedTab = queryParams.get("tab");
|
||||||
|
|
||||||
// Initial state for family details
|
// Initial state for family details
|
||||||
const initialDetailState = {
|
const initialDetailState = {
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -65,35 +68,43 @@ export default function FamilyTableNew() {
|
|||||||
|
|
||||||
// Function to handle tab changes
|
// Function to handle tab changes
|
||||||
const tabHandler = (value) => {
|
const tabHandler = (value) => {
|
||||||
setTab(value);
|
setTab(value.toLowerCase());
|
||||||
};
|
};
|
||||||
|
|
||||||
// Object that maps tab names to their corresponding components
|
// Object that maps tab names to their corresponding components
|
||||||
const tabComponents = {
|
const tabComponents = {
|
||||||
Tasks: (
|
tasks: (
|
||||||
<FamilyTasks
|
<FamilyTasks
|
||||||
familyData={familyTasks}
|
familyData={familyTasks}
|
||||||
action={familyAssignPopUpHandler}
|
action={familyAssignPopUpHandler}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
Waiting: (
|
waiting: (
|
||||||
<FamilyWaitlist
|
<FamilyWaitlist
|
||||||
familyData={familyWaitList}
|
familyData={familyWaitList}
|
||||||
setUpdatePage={setUpdatePage}
|
setUpdatePage={setUpdatePage}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
Pending: (
|
pending: (
|
||||||
<FamilyPending
|
<FamilyPending
|
||||||
familyData={familyPending}
|
familyData={familyPending}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultTabComponent = tabComponents.Tasks;
|
const defaultTabComponent = tabComponents.tasks;
|
||||||
|
|
||||||
// Selected tab component based on the current 'tab'
|
// Selected tab component based on the current 'tab'
|
||||||
const selectedTabComponent = tabComponents[tab] || defaultTabComponent;
|
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
|
// Effect to manage active family task details
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -189,7 +200,7 @@ export default function FamilyTableNew() {
|
|||||||
<Suspense
|
<Suspense
|
||||||
fallback={
|
fallback={
|
||||||
<div className="h-full min-h-[609px] w-full overflow-hidden flex justify-center items-center">
|
<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>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -202,7 +213,7 @@ export default function FamilyTableNew() {
|
|||||||
<li
|
<li
|
||||||
onClick={() => tabHandler(name)}
|
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] ${
|
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-purple border-r"
|
||||||
: "text-thin-light-gray"
|
: "text-thin-light-gray"
|
||||||
}`}
|
}`}
|
||||||
@@ -224,7 +235,7 @@ export default function FamilyTableNew() {
|
|||||||
<div className="flex-[0.9] h-full">
|
<div className="flex-[0.9] h-full">
|
||||||
<div className="h-full relative overflow-y-auto">
|
<div className="h-full relative overflow-y-auto">
|
||||||
<Suspense
|
<Suspense
|
||||||
fallback={<LoadingSpinner size="16" color="sky-blue" />}
|
fallback={<LoadingSpinner size="16" color="sky-blue" height='h-[30rem]' />}
|
||||||
>
|
>
|
||||||
{selectedTabComponent}
|
{selectedTabComponent}
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export default function FamilyPending({ familyData }) {
|
|||||||
</h1>
|
</h1>
|
||||||
<div>{value.description}</div>
|
<div>{value.description}</div>
|
||||||
<span className="text-sm text-thin-light-gray flex items-start gap-1">
|
<span className="text-sm text-thin-light-gray flex items-start gap-1">
|
||||||
Price:{" "}
|
Reward:{" "}
|
||||||
<span className="text-purple">
|
<span className="text-purple">
|
||||||
{thePrice}
|
{thePrice}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export default function FamilyNewTasks({
|
|||||||
</h1>
|
</h1>
|
||||||
<div className="flex flex-col sm:flex-row items-start gap-1 md:gap-4 md:items-center">
|
<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">
|
<span className="text-sm text-thin-light-gray flex flex-start gap-1">
|
||||||
Price:{" "}
|
Reward:{" "}
|
||||||
<span className="text-purple">
|
<span className="text-purple">
|
||||||
{thePrice}
|
{thePrice}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export default function FamilyPending({
|
|||||||
</h1>
|
</h1>
|
||||||
<div>{value.description}</div>
|
<div>{value.description}</div>
|
||||||
<span className="text-sm text-thin-light-gray flex items-start gap-1">
|
<span className="text-sm text-thin-light-gray flex items-start gap-1">
|
||||||
Price:{" "}
|
Reward:{" "}
|
||||||
<span className="text-purple">
|
<span className="text-purple">
|
||||||
{thePrice}
|
{thePrice}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export default function FamilyTasks({
|
|||||||
</h1>
|
</h1>
|
||||||
<div className="flex flex-col sm:flex-row items-start gap-1 md:gap-4 md:items-center">
|
<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">
|
<span className="text-sm text-thin-light-gray flex flex-start gap-1">
|
||||||
Price:{" "}
|
Reward:{" "}
|
||||||
<span className="text-purple">
|
<span className="text-purple">
|
||||||
{thePrice}
|
{thePrice}
|
||||||
</span>
|
</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 { Form, Formik } from "formik";
|
||||||
|
import React, { useEffect, useState } from "react";
|
||||||
import * as Yup from "yup";
|
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 { useDispatch, useSelector } from "react-redux";
|
||||||
import { apiConst } from "../../../../lib/apiConst";
|
import { apiConst } from "../../../../lib/apiConst";
|
||||||
|
import usersService from "../../../../services/UsersService";
|
||||||
|
import { tableReload } from "../../../../store/TableReloads";
|
||||||
import { SocketValues } from "../../../Contexts/SocketIOContext";
|
import { SocketValues } from "../../../Contexts/SocketIOContext";
|
||||||
|
import { AmountTo2DP } from "../../../Helpers/PriceFormatter";
|
||||||
|
import LoadingSpinner from "../../../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
// amount: Yup.string()
|
// amount: Yup.string()
|
||||||
@@ -31,10 +30,9 @@ const validationSchema = Yup.object().shape({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
|
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();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
@@ -60,7 +58,6 @@ function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
|
|||||||
};
|
};
|
||||||
// FUNCTION TO PERFORM FAMILY TRANSFER
|
// FUNCTION TO PERFORM FAMILY TRANSFER
|
||||||
const handleAddFund = (values) => {
|
const handleAddFund = (values) => {
|
||||||
|
|
||||||
setRequestStatus({ loading: true, status: false, message: "" });
|
setRequestStatus({ loading: true, status: false, message: "" });
|
||||||
|
|
||||||
let senderBal = startTransfer?.data?.origing_current_balance || ""; // SENDER'S ACCOUNT BALANCE
|
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
|
//SENDS MESSAGE TO SOCKET TO UPDATE CHILD ACCOUNT
|
||||||
// message, room
|
// message, room
|
||||||
let socketMsg = {
|
let socketMsg = {
|
||||||
"audience": "MEMBER",
|
audience: "MEMBER",
|
||||||
"action": "REFRESH_WALLET",
|
action: "REFRESH_WALLET",
|
||||||
"family_uid": reqData.family_uid,
|
family_uid: reqData.family_uid,
|
||||||
}
|
};
|
||||||
let socketRoom = `FAMILY-${userDetails.uid}`
|
let socketRoom = `FAMILY-${userDetails.uid}`;
|
||||||
parentAssignJobToKid(socketMsg, socketRoom) //SENDS MESSAGE TO SOCKET TO UPDATE CHILD ACCOUNT
|
parentAssignJobToKid(socketMsg, socketRoom); //SENDS MESSAGE TO SOCKET TO UPDATE CHILD ACCOUNT
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
@@ -189,14 +186,8 @@ function FamilyAddFundPopout({ action, situation, wallet, familyData }) {
|
|||||||
<ModalCom action={action} situation={situation}>
|
<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="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">
|
<div className="modal-header-con">
|
||||||
<h1 className="modal-title">
|
<h1 className="modal-title">Add Fund</h1>
|
||||||
Add Fund
|
<button type="button" className="modal-close-btn" onClick={action}>
|
||||||
</h1>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="modal-close-btn"
|
|
||||||
onClick={action}
|
|
||||||
>
|
|
||||||
<svg
|
<svg
|
||||||
width="36"
|
width="36"
|
||||||
height="36"
|
height="36"
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export default function InputCom({
|
|||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
value={value}
|
value={value}
|
||||||
onChange={inputHandler}
|
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}`}
|
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
|
||||||
type={type}
|
type={type}
|
||||||
id={name}
|
id={name}
|
||||||
|
|||||||
@@ -76,3 +76,22 @@ export const AmountTo2DP = (
|
|||||||
// return formattedNumber;
|
// return formattedNumber;
|
||||||
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></>;
|
||||||
|
};
|
||||||
@@ -7,7 +7,8 @@ import PaginatedList from '../../components/Pagination/PaginatedList';
|
|||||||
|
|
||||||
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
||||||
|
|
||||||
import { AmountTo2DP } from '../Helpers/PriceFormatter';
|
import { currencySymbol } from '../Helpers/PriceFormatter';
|
||||||
|
import {NewDateTimeFormatter} from '../../lib/NewDateTimeFormatter'
|
||||||
|
|
||||||
function JobsCompleted() {
|
function JobsCompleted() {
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ function JobsCompleted() {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
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 ?
|
{jobHistory?.loading ?
|
||||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||||
: jobHistory?.data?.length ?
|
: jobHistory?.data?.length ?
|
||||||
@@ -71,12 +72,11 @@ function JobsCompleted() {
|
|||||||
<div className='flex flex-col'>
|
<div className='flex flex-col'>
|
||||||
<h1 className='text-lg font-bold line-clamp-1'>{item?.title}</h1>
|
<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'>{item?.description}</p>
|
||||||
|
<p className='text-sm line-clamp-2'>{NewDateTimeFormatter(item?.delivery_date)}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-4 text-right">{AmountTo2DP(item?.price*0.01)} {item?.currency}</td>
|
<td className="p-4 flex text-right justify-end items-center">{currencySymbol(item?.currency_code, item?.price*0.01)}</td>
|
||||||
{/* <td className="p-4">{date}</td>
|
|
||||||
<td className="p-4">{item?.contract}</td> */}
|
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import PaginatedList from '../../components/Pagination/PaginatedList';
|
|||||||
|
|
||||||
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
||||||
|
|
||||||
import { AmountTo2DP } from '../Helpers/PriceFormatter';
|
import { currencySymbol } from '../Helpers/PriceFormatter';
|
||||||
|
|
||||||
|
|
||||||
export const RewardsTable = memo(() => {
|
export const RewardsTable = memo(() => {
|
||||||
@@ -47,7 +47,7 @@ export const RewardsTable = memo(() => {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
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 ?
|
{familyRewardHistory.loading ?
|
||||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||||
: familyRewardHistory.data.length ?
|
: familyRewardHistory.data.length ?
|
||||||
@@ -55,9 +55,9 @@ export const RewardsTable = memo(() => {
|
|||||||
<thead className='w-full'>
|
<thead className='w-full'>
|
||||||
<tr className='text-slate-600 dark:text-white'>
|
<tr className='text-slate-600 dark:text-white'>
|
||||||
<th className="p-4"></th>
|
<th className="p-4"></th>
|
||||||
<th className="p-4 text-right">Amount</th>
|
<th className="p-4 text-center">Amount</th>
|
||||||
<th className="p-4">Date</th>
|
<th className="p-4 text-center">Date</th>
|
||||||
<th className="p-4">Confirmation</th>
|
<th className="p-4 text-center">Confirmation</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -65,18 +65,18 @@ export const RewardsTable = memo(() => {
|
|||||||
let date = new Date(item.added).toLocaleDateString()
|
let date = new Date(item.added).toLocaleDateString()
|
||||||
return (
|
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'>
|
<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">
|
<td className="p-4 min-w-[300px]">
|
||||||
<div className='flex items-center gap-2'>
|
<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' />
|
<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>
|
<h1 className='text-lg font-bold'>Reward to {item.rec_firstname} {item.rec_lastname}</h1>
|
||||||
<p className='text-sm'>{item.description}</p>
|
<p className='text-sm'>{item.description}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-4 text-right">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
|
<td className="p-4 text-right flex-nowrap">{currencySymbol(item.currency, item.amount*0.01)}</td>
|
||||||
<td className="p-4">{date}</td>
|
<td className="p-4 text-center">{date}</td>
|
||||||
<td className="p-4">{item.confirmation}</td>
|
<td className="p-4 text-center">{item.confirmation}</td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ export default function History() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[1px] bg-[#E3E4FE] dark:bg-[#a7a9b533] mr-10"></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 */}
|
{/* PURCHASE SECTION */}
|
||||||
{selectedTab == 'purchases' &&
|
{selectedTab == 'purchases' &&
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ export default function FullAccountDash(props) {
|
|||||||
className="mb-4"
|
className="mb-4"
|
||||||
data={userDetails}
|
data={userDetails}
|
||||||
bannerList={props.bannerList}
|
bannerList={props.bannerList}
|
||||||
nextDueTask={props.nextDueTask}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case "FAMILY_PARENT_DASH":
|
case "FAMILY_PARENT_DASH":
|
||||||
@@ -31,7 +30,6 @@ export default function FullAccountDash(props) {
|
|||||||
className="mb-4"
|
className="mb-4"
|
||||||
data={userDetails}
|
data={userDetails}
|
||||||
bannerList={props.bannerList}
|
bannerList={props.bannerList}
|
||||||
nextDueTask={props.nextDueTask}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case "WORKER_HOME_DASH":
|
case "WORKER_HOME_DASH":
|
||||||
@@ -40,7 +38,6 @@ export default function FullAccountDash(props) {
|
|||||||
className="mb-4"
|
className="mb-4"
|
||||||
data={userDetails}
|
data={userDetails}
|
||||||
bannerList={props.bannerList}
|
bannerList={props.bannerList}
|
||||||
nextDueTask={props.nextDueTask}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case "JOBOWNER_HOME_DASH":
|
case "JOBOWNER_HOME_DASH":
|
||||||
@@ -49,7 +46,6 @@ export default function FullAccountDash(props) {
|
|||||||
className="mb-4"
|
className="mb-4"
|
||||||
data={userDetails}
|
data={userDetails}
|
||||||
bannerList={props.bannerList}
|
bannerList={props.bannerList}
|
||||||
nextDueTask={props.nextDueTask}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
@@ -62,16 +58,18 @@ export default function FullAccountDash(props) {
|
|||||||
<div className="home-page-wrapper">
|
<div className="home-page-wrapper">
|
||||||
{renderDashboard()}
|
{renderDashboard()}
|
||||||
{process.env.REACT_APP_SHOW_ACCOUNT_DASH == "1" && (
|
{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 ? (
|
props.offersList?.data?.result_list?.length ? (
|
||||||
<MyOffersTable
|
<MyOffersTable
|
||||||
MyActiveOffersList={props.offersList?.data}
|
MyActiveOffersList={props.offersList?.data}
|
||||||
className="mb-10"
|
className="mb-10"
|
||||||
/>
|
/>
|
||||||
) : props.MyActiveJobList?.data?.length ? (
|
)
|
||||||
|
:
|
||||||
|
props.MyActiveJobList?.data?.length ? (
|
||||||
<>
|
<>
|
||||||
<div className="w-full mb-5 flex justify-between items-center gap-1">
|
<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">
|
<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}
|
imageServer={props.offersList?.data?.session_image_server}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null} */}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export default function HomeActivities({ className }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<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 || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -5,68 +5,65 @@ import usersService from "../../services/UsersService";
|
|||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import FamilyDash from "./FamilyDash";
|
import FamilyDash from "./FamilyDash";
|
||||||
import FullAccountDash from "./FullAccountDash";
|
import FullAccountDash from "./FullAccountDash";
|
||||||
|
import LoadingSpinner from '../../components/Spinners/LoadingSpinner'
|
||||||
|
|
||||||
export default function Home(props) {
|
export default function Home(props) {
|
||||||
// console.log("PROPS IN HOME->", props);
|
// console.log("PROPS IN HOME->", props);
|
||||||
const userApi = new usersService();
|
const userApi = new usersService();
|
||||||
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
||||||
|
|
||||||
let [nextDueTask, setNextDueTask] = useState({});
|
|
||||||
const [MyOffersList, setMyOffersList] = useState({loading: true, data: []});
|
|
||||||
|
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
const [MyActiveJobList, setMyActiveJobList] = useState({loading:true, data:[]}); // STATE TO HOLD ACTIVE/CURRENT TASKS
|
// const [MyActiveJobList, setMyActiveJobList] = useState({loading:true, data:[]}); // STATE TO HOLD ACTIVE/CURRENT TASKS
|
||||||
// const [MyActiveJobList, setMyActiveJobList] = useState([]); // STATE TO HOLD ACTIVE/CURRENT TASKS
|
|
||||||
|
|
||||||
const getMyActiveJobList = async () => { // FUNCTION TO POPULATE ACTIVE/CURRENT TASK LIST
|
// const getMyActiveJobList = async () => { // FUNCTION TO POPULATE ACTIVE/CURRENT TASK LIST
|
||||||
try {
|
// try {
|
||||||
const res = await userApi.getMyActiveTaskList();
|
// const res = await userApi.getMyActiveTaskList();
|
||||||
setMyActiveJobList({loading:false, data:res?.data?.result_list});
|
// setMyActiveJobList({loading:false, data:res?.data?.result_list});
|
||||||
// setMyActiveJobList(res?.data?.result_list);
|
// // setMyActiveJobList(res?.data?.result_list);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
setMyActiveJobList({loading:false, data:[]});
|
// setMyActiveJobList({loading:false, data:[]});
|
||||||
// setMyActiveJobList([]);
|
// // setMyActiveJobList([]);
|
||||||
console.log("Error getting tasks");
|
// console.log("Error getting tasks");
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
|
|
||||||
// FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
|
// FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
|
||||||
const getHomeDate = () => {
|
// const getHomeDate = () => {
|
||||||
userApi
|
// userApi
|
||||||
.getHomeDate()
|
// .getHomeDate()
|
||||||
.then((res) => {
|
// .then((res) => {
|
||||||
if (res.status != 200 || res.internal_return < 0) {
|
// if (res.status != 200 || res.internal_return < 0) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
setNextDueTask(res.data);
|
// setNextDueTask(res.data);
|
||||||
})
|
// })
|
||||||
.catch((error) => {
|
// .catch((error) => {
|
||||||
console.log(error);
|
// console.log(error);
|
||||||
});
|
// });
|
||||||
};
|
// };
|
||||||
|
|
||||||
const getMyOffersList = async () => {
|
// const getMyOffersList = async () => {
|
||||||
try {
|
// try {
|
||||||
const res = await userApi.getOffersList();
|
// const res = await userApi.getOffersList();
|
||||||
setMyOffersList({loading:false, data:res.data});
|
// setMyOffersList({loading:false, data:res.data});
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
setMyOffersList({loading:false, data:[]});
|
// setMyOffersList({loading:false, data:[]});
|
||||||
console.log("Error getting offers", error);
|
// console.log("Error getting offers", error);
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
const fetchData = async () => {
|
// if(userDetails?.account_type == 'FULL'){
|
||||||
await Promise.all([getHomeDate(), getMyOffersList(), getMyActiveJobList()]);
|
// getMyActiveJobList();
|
||||||
};
|
// }
|
||||||
if(userDetails?.account_type == 'FULL'){
|
// }, []);
|
||||||
fetchData();
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
|
{Object.keys(commonHeadBanner).length < 1 ?
|
||||||
|
<LoadingSpinner height='h-48' size='16' />
|
||||||
|
:
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
||||||
<FamilyDash
|
<FamilyDash
|
||||||
@@ -78,11 +75,12 @@ export default function Home(props) {
|
|||||||
/>
|
/>
|
||||||
) : userDetails && userDetails?.account_type == "FULL" ? (
|
) : userDetails && userDetails?.account_type == "FULL" ? (
|
||||||
<FullAccountDash
|
<FullAccountDash
|
||||||
nextDueTask={nextDueTask}
|
|
||||||
bannerList={props.bannerList}
|
bannerList={props.bannerList}
|
||||||
dashTypes={props.dashTypes}
|
dashTypes={props.dashTypes}
|
||||||
offersList={MyOffersList}
|
// offersList={MyOffersList}
|
||||||
MyActiveJobList={MyActiveJobList}
|
// MyActiveJobList={MyActiveJobList}
|
||||||
|
offersList={props.offersList}
|
||||||
|
imageServer={props.imageServer}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
@@ -90,6 +88,7 @@ export default function Home(props) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,254 +1,283 @@
|
|||||||
import React, {useEffect, useState} from 'react'
|
import React, { useEffect, useState } from "react";
|
||||||
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
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 [completedTask, setCompletedTask] = useState({
|
||||||
const apiCall = new usersService()
|
loading: true,
|
||||||
|
data: [],
|
||||||
|
});
|
||||||
|
|
||||||
const [completedTask, setCompletedTask] = useState({
|
let thePrice = PriceFormatter(
|
||||||
loading: true,
|
details?.price * 0.01,
|
||||||
data: []
|
details?.currency_code,
|
||||||
})
|
details?.currency
|
||||||
|
);
|
||||||
|
|
||||||
let thePrice = PriceFormatter(
|
let cleanedText = details?.job_description
|
||||||
details?.price * 0.01,
|
?.replace(/</g, "<")
|
||||||
details?.currency_code,
|
.replace(/>/g, ">")
|
||||||
details?.currency
|
.replace(/"/g, '"')
|
||||||
);
|
.replace(/&/g, "&");
|
||||||
|
|
||||||
let cleanedText = details?.job_description
|
let dependOn = marketPlaceProduct?.filter(
|
||||||
?.replace(/</g, "<")
|
(item) => item?.job_uid == details?.offer_depend_uid
|
||||||
.replace(/>/g, ">")
|
)[0];
|
||||||
.replace(/"/g, '"')
|
|
||||||
.replace(/&/g, "&");
|
|
||||||
|
|
||||||
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(()=>{
|
return (
|
||||||
apiCall.getVerifyCompletedTask({offer_depend_uid:details?.offer_depend_uid}).then(res => {
|
<>
|
||||||
console.log('RES', res.data)
|
{completedTask.loading ? (
|
||||||
setCompletedTask({loading:false, data:res?.data?.result_list})
|
<div className="w-full md:col-span-4 flex justify-center items-center min-h-[500px]">
|
||||||
}).catch(err =>{
|
<LoadingSpinner size="10" />
|
||||||
setCompletedTask({loading:false, data:[]})
|
</div>
|
||||||
})
|
) : (
|
||||||
},[])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
<>
|
||||||
{completedTask.loading ?
|
<div className="px-4 py-2 w-full md:col-span-3 md:border-r-1">
|
||||||
<div className='w-full md:col-span-4 flex justify-center items-center min-h-[500px]'>
|
<div className="min-h-[200px]">
|
||||||
<LoadingSpinner
|
<h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide">
|
||||||
size='10'
|
{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>
|
||||||
:
|
{/* <hr className='my-3' /> */}
|
||||||
<>
|
{completedTask.loading ? (
|
||||||
<div className="px-4 py-2 w-full md:col-span-3 md:border-r-1">
|
<p className="py-3 w-full text-center text-lg">Loading...</p>
|
||||||
<div className="min-h-[200px]">
|
) : completedTask?.data?.filter(
|
||||||
<h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide">
|
(item) => item?.job_uid == details.offer_depend_uid
|
||||||
{details?.offer_depend_uid && <i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>}
|
).length > 0 ? (
|
||||||
{details?.title}
|
<div className="w-full">
|
||||||
</h2>
|
<label className="job-label w-full flex gap-2 items-center">
|
||||||
|
If you have any questions about this task:
|
||||||
{/* INPUT SECTION */}
|
<span
|
||||||
{[
|
className={`text-sm ${
|
||||||
{
|
marketMsg.state ? "text-[#57cd89]" : "text-red-500"
|
||||||
name: "Description",
|
}`}
|
||||||
content: details.description,
|
>
|
||||||
},
|
{marketMsg.state && "Message Sent!"}
|
||||||
{
|
{errMsg.market && "Failed to send"}
|
||||||
name: "",
|
</span>
|
||||||
content: {
|
</label>
|
||||||
text: `Timeline: ${details.timeline_days} day(s) -- `,
|
<div className="w-full flex items-center gap-3">
|
||||||
bold: `Budget: ${thePrice}`,
|
<div className="w-full">
|
||||||
},
|
<textarea
|
||||||
},
|
className={`p-1 w-full text-sm text-slate-900 dark:text-white ${
|
||||||
// {
|
marketMsg.loading && "italic text-[#9CA3AF]"
|
||||||
// name: "Delivery Detail",
|
} bg-transparent outline-none border-2 border-slate-300 rounded-md`}
|
||||||
// content: cleanedText,
|
rows="3"
|
||||||
// danger: true,
|
style={{ resize: "none" }}
|
||||||
// },
|
placeholder="Enter message here ..."
|
||||||
].map(({ name, content, danger }, idx) => (
|
value={marketMsg.loading ? "Sending..." : textValue}
|
||||||
<div className={`my-1 flex flex-col items-start`} key={idx}>
|
onChange={handleInputChange}
|
||||||
<label className="py-1 job-label w-full">
|
/>
|
||||||
{name}
|
</div>
|
||||||
</label>
|
<div className="relative flex flex-col">
|
||||||
<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 ?
|
|
||||||
<button
|
<button
|
||||||
className="btn-gradient text-white px-2 py-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl"
|
className="rounded-full flex justify-center items-center w-12 h-11 bg-yellow-500 text-white"
|
||||||
name="market-interest"
|
name="market-message"
|
||||||
onClick={ManageInterest}
|
onClick={MarketDetail}
|
||||||
|
disabled={marketMsg.loading}
|
||||||
>
|
>
|
||||||
{" "}
|
{marketMsg.loading ? (
|
||||||
<div className="flex md:flex-col justify-center gap-2">
|
<LoadingSpinner size={5} color="white" />
|
||||||
<span>Notify</span>
|
) : (
|
||||||
<span>Owner</span>
|
// "Send Message"
|
||||||
</div>
|
<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>
|
</button>
|
||||||
:
|
</div>
|
||||||
<h1 className='text-red-600 text-base font-bold'>This task depends on completion of another task</h1>
|
</div>
|
||||||
}
|
</div>
|
||||||
<>
|
) : (
|
||||||
{manageInt.loading ? (
|
<div className="w-full">
|
||||||
<p className="text-sm italic">please wait...</p>
|
<h1 className="text-red-600 text-lg">
|
||||||
) : (
|
This task depends on the task below
|
||||||
<>
|
</h1>
|
||||||
{manageInt?.msg !== "" && (
|
<div className="rounded-2xl bg-red-50">
|
||||||
<p
|
<div className="my-1 w-full">
|
||||||
className={`text-sm italic ${
|
<h2 className="p-2 w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-black tracking-wide">
|
||||||
manageInt?.state ? "text-green-500" : "text-red-500"
|
{dependOn?.offer_depend_uid && (
|
||||||
}`}
|
<i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>
|
||||||
>
|
)}
|
||||||
{manageInt?.msg}
|
{dependOn?.title}
|
||||||
</p>
|
</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>
|
||||||
|
|
||||||
<div className="text-slate-900">
|
<div className="py-2 w-full md:col-span-1 h-full flex flex-col rounded-2xl">
|
||||||
<p className="flex items-center tracking-wide">
|
<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">
|
||||||
<span className="job-label">Interest: </span> <b className="ml-1">{details.interest_count}</b>
|
<div className="w-full flex flex-col justify-center pb-4 gap-2">
|
||||||
</p>
|
<p className="job-label w-full">Interested?</p>
|
||||||
<hr />
|
<hr />
|
||||||
<p className="my-1 flex flex-col">
|
{completedTask.loading ? (
|
||||||
<span className="job-label">Expire: </span>
|
<p className="py-3 w-full text-center text-lg">Loading...</p>
|
||||||
<span> {new Date(details.expire).toLocaleString()} </span>
|
) : completedTask?.data?.filter(
|
||||||
</p>
|
(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>
|
||||||
</div>
|
) : (
|
||||||
</>
|
<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 { useEffect, useMemo, useState } from "react";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import ModalCom from "../../Helpers/ModalCom";
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
@@ -9,6 +10,11 @@ import LockJob from "./LockJob";
|
|||||||
|
|
||||||
const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduct }) => {
|
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
|
let {sendJobInterestToOwner} = SocketValues() // function to emit job interest request
|
||||||
const emitOfferInterest = () => {
|
const emitOfferInterest = () => {
|
||||||
let message = {
|
let message = {
|
||||||
@@ -326,7 +332,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
|
|||||||
|
|
||||||
<div className="text-slate-900">
|
<div className="text-slate-900">
|
||||||
<p className="flex items-center tracking-wide">
|
<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>
|
</p>
|
||||||
<hr />
|
<hr />
|
||||||
<p className="my-1 flex flex-col">
|
<p className="my-1 flex flex-col">
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ export default function ActiveJobMessage({ activeJobMesList }) {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col justify-between'>
|
<div className="w-full h-full max-h-[343px] overflow-y-auto">
|
||||||
<div className="w-full h-full min-h-[250px] max-h-[300px] overflow-y-auto">
|
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className='border-b-2'>
|
<thead className='border-b-2'>
|
||||||
<tr className='text-slate-600'>
|
<tr className='text-slate-600'>
|
||||||
@@ -71,9 +70,10 @@ export default function ActiveJobMessage({ activeJobMesList }) {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* PAGINATION BUTTON */}
|
// <div className='flex flex-col justify-between'>
|
||||||
{/* <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} /> */}
|
// PAGINATION BUTTON
|
||||||
{/* END OF 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} />
|
||||||
</div>
|
// END OF PAGINATION BUTTON
|
||||||
|
// </div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import IndexJobActions from "./JobActions/IndexJobActions";
|
|||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
import { SocketValues } from "../Contexts/SocketIOContext";
|
import { SocketValues } from "../Contexts/SocketIOContext";
|
||||||
import TabButton from "../customTabs/TabButton";
|
import ManageJobTab from "../customTabs/ManageJobTab";
|
||||||
import AttachFile from "../attachmentCom/AttachFile";
|
import AttachFile from "../attachmentCom/AttachFile";
|
||||||
|
|
||||||
import JobDetailPopout from "./JobDetailPopout";
|
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">
|
<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">
|
<span className="font-semibold text-black dark:text-white">
|
||||||
Price:{" "}
|
Reward:{" "}
|
||||||
</span>
|
</span>
|
||||||
<span className="">{thePrice}</span>
|
<span className="">{thePrice}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -390,8 +390,8 @@ function ActiveJobs(props) {
|
|||||||
{/* end of job details */}
|
{/* end of job details */}
|
||||||
</div>
|
</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="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 lg:w-1/2 mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
|
<div className="w-full mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
|
||||||
<div className="">
|
<div className="">
|
||||||
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
Actions
|
Actions
|
||||||
@@ -408,7 +408,7 @@ function ActiveJobs(props) {
|
|||||||
{/* switch button */}
|
{/* switch button */}
|
||||||
<div className="grid grid-cols-2">
|
<div className="grid grid-cols-2">
|
||||||
{tabs.map((item) => (
|
{tabs.map((item) => (
|
||||||
<TabButton
|
<ManageJobTab
|
||||||
key={item}
|
key={item}
|
||||||
item={item}
|
item={item}
|
||||||
selectedTab={selectedTab}
|
selectedTab={selectedTab}
|
||||||
@@ -545,14 +545,16 @@ function ActiveJobs(props) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* MESSAGE SECTION */}
|
{/* MESSAGE SECTION */}
|
||||||
<div className="w-full lg:w-1/2">
|
<div className="w-full flex flex-col">
|
||||||
<div className="mb-4">
|
{props.details &&
|
||||||
<AttachFile
|
<div className="mb-4">
|
||||||
data={props.details}
|
<AttachFile
|
||||||
showOnData={true}
|
data={props.details}
|
||||||
fontSize={'text-lg'}
|
showOnData={true}
|
||||||
/>
|
fontSize={'text-lg'}
|
||||||
</div>
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<div className="flex justify-between items-center gap-5">
|
<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">
|
<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>
|
<span>Message</span>
|
||||||
@@ -671,37 +673,46 @@ const PopModal = ({
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
|
<div className="job-action-modal-body w-full px-10 py-2 gap-4">
|
||||||
<div className="w-full flex flex-col items-center">
|
<div className="w-full">
|
||||||
{activeJobMesList.loading ? (
|
{activeJobMesList.loading ? (
|
||||||
<LoadingSpinner size="16" color="sky-blue" />
|
<LoadingSpinner size="16" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
<div className="message-table h-[500px] overflow-y-auto">
|
<div className="message-table h-[500px] overflow-y-auto">
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<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">
|
<tr className="text-slate-600">
|
||||||
<th className="p-2"></th>
|
<th className="p-0"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead> */}
|
||||||
{activeJobMesList?.data?.length ? (
|
{activeJobMesList?.data?.length ? (
|
||||||
<tbody>
|
<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">
|
<tr key={index} className="text-slate-500">
|
||||||
<td>
|
<td>
|
||||||
<div className="msg_box">
|
<div className={`msg_box ${item.who}`}>
|
||||||
<div className="msg_header">
|
<div className="msg_header">
|
||||||
{item.msg_date} {item.msg_firstname}
|
{item.msg_date} {item.msg_firstname}
|
||||||
</div>
|
</div>
|
||||||
<span
|
{/* <span
|
||||||
className="p-2"
|
className="p-2"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: item.message,
|
__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>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
)
|
||||||
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
) : activeJobMesList.error ? (
|
) : activeJobMesList.error ? (
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -6,8 +6,14 @@ import LoadingSpinner from '../../Spinners/LoadingSpinner'
|
|||||||
|
|
||||||
import usersService from '../../../services/UsersService'
|
import usersService from '../../../services/UsersService'
|
||||||
|
|
||||||
|
import {NewDateTimeFormatter }from '../../../lib/NewDateTimeFormatter'
|
||||||
|
|
||||||
function CurrentTaskAction({jobDetails}) {
|
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 apiCall = new usersService()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
@@ -65,7 +71,7 @@ function CurrentTaskAction({jobDetails}) {
|
|||||||
<div className="h-full w-full text-sm text-left text-gray-500">
|
<div className="h-full w-full text-sm text-left text-gray-500">
|
||||||
{jobDetails.job_type == 'MEDIA' ?
|
{jobDetails.job_type == 'MEDIA' ?
|
||||||
<div className="h-full flex justify-center items-center">
|
<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
|
I have completed this task
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,7 +84,7 @@ function CurrentTaskAction({jobDetails}) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex justify-center items-center">
|
<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
|
Send for Review
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -120,36 +126,57 @@ function CurrentTaskAction({jobDetails}) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
|
<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="w-full flex flex-col min-h-[150px] gap-8 items-center">
|
||||||
<div className="mb-10 flex justify-center items-center gap-2">
|
{!canSendForReview ?
|
||||||
<input
|
<>
|
||||||
type='checkbox'
|
<h1
|
||||||
checked={checked}
|
// className='font-bold text-base tracking-wide text-dark-gray dark:text-white'
|
||||||
onChange={()=>{setChecked(prev => !prev)}}
|
className='font-bold text-xl tracking-wide text-red-500 text-center'
|
||||||
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]'}`}
|
|
||||||
>
|
>
|
||||||
{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>
|
||||||
</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>
|
||||||
</div>
|
</div>
|
||||||
{/* cancel btn */}
|
{/* cancel btn */}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ function PastDueJobAction({jobDetails}) {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={popUpHandler}
|
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
|
Cancel or Extend Timeline
|
||||||
</button>
|
</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 (
|
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>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex space-x-2 items-center w-full task_action_panel">
|
<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
|
You have missed the allocated time
|
||||||
</div>
|
</div>
|
||||||
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex justify-center items-center">
|
<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
|
Request Extension
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,6 +138,124 @@ function PastDueTaskAction() {
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,21 @@ export default function JobDetailPopout({action, situation, jobDetail}) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-body-wrapper">
|
<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>
|
||||||
<div className="modal-footer-wrapper justify-end">
|
<div className="modal-footer-wrapper justify-end">
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export default function MyActiveJobTable({ MyJobList, className }) {
|
|||||||
</h1>
|
</h1>
|
||||||
<div>{value.description}</div>
|
<div>{value.description}</div>
|
||||||
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
|
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
|
||||||
Price:{" "}
|
Reward:{" "}
|
||||||
<span className="text-purple">
|
<span className="text-purple">
|
||||||
{thePrice}
|
{thePrice}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export default function MyPastDueTaskTable({ MyJobList, className }) {
|
|||||||
</h1>
|
</h1>
|
||||||
<div>{value.description}</div>
|
<div>{value.description}</div>
|
||||||
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
|
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
|
||||||
Price:{" "}
|
Reward:{" "}
|
||||||
<span className="text-purple">
|
<span className="text-purple">
|
||||||
{thePrice}
|
{thePrice}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ function myJobTableFeatures(
|
|||||||
</h1>
|
</h1>
|
||||||
<div>{value.description}</div>
|
<div>{value.description}</div>
|
||||||
<span className="text-sm text-thin-light-gray flex items-start gap-1">
|
<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>
|
||||||
<span className="text-sm text-thin-light-gray">
|
<span className="text-sm text-thin-light-gray">
|
||||||
Duration:{" "}
|
Duration:{" "}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export default function MyPendingJobTable({ MyJobList, className }) {
|
|||||||
</h1>
|
</h1>
|
||||||
<div>{value.description}</div>
|
<div>{value.description}</div>
|
||||||
<span className="text-sm text-thin-light-gray flex items-start gap-1">
|
<span className="text-sm text-thin-light-gray flex items-start gap-1">
|
||||||
Price:{" "}
|
Reward:{" "}
|
||||||
<span className="text-purple">
|
<span className="text-purple">
|
||||||
{thePrice}
|
{thePrice}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export default function MyJobTable({ className, ActiveJobList, Account, imageSer
|
|||||||
{task?.description}
|
{task?.description}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
|
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
|
||||||
Price:
|
Reward:
|
||||||
<span className="text-purple ml-1">{thePrice}</span>
|
<span className="text-purple ml-1">{thePrice}</span>
|
||||||
</span>
|
</span>
|
||||||
<div className="flex flex-col sm:flex-row items-start gap-1 md:gap-4 md:items-center">
|
<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>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import CommonHead from "../UserHeader/CommonHead";
|
|||||||
// import TopSellerTopBuyerSliderSection from "../Home/TopSellerTopBuyerSliderSection";
|
// import TopSellerTopBuyerSliderSection from "../Home/TopSellerTopBuyerSliderSection";
|
||||||
import MyOffersTable from "./MyOffersTable";
|
import MyOffersTable from "./MyOffersTable";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate, Link } from "react-router-dom";
|
||||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||||
|
|
||||||
export default function MyTasks({
|
export default function MyTasks({
|
||||||
@@ -37,7 +37,7 @@ export default function MyTasks({
|
|||||||
<div className="notification-page w-full mb-10">
|
<div className="notification-page w-full mb-10">
|
||||||
<div className="notification-wrapper w-full">
|
<div className="notification-wrapper w-full">
|
||||||
{/* heading */}
|
{/* 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">
|
{/* <div className="w-full mb-5 sm:mb-0 flex justify-between items-center gap-1">
|
||||||
{userDetails.account_type == 'FAMILY' &&
|
{userDetails.account_type == 'FAMILY' &&
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
<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>
|
</div>
|
||||||
|
|
||||||
<MyJobTable ActiveJobList={ActiveJobList} Account={userDetails} imageServer={MyActiveOffersList.session_image_server} />
|
<MyJobTable ActiveJobList={ActiveJobList} Account={userDetails} imageServer={MyActiveOffersList.session_image_server} />
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export default function MyWaitingJobTable({ MyJobList, className }) {
|
|||||||
</h1>
|
</h1>
|
||||||
<div>{value.description}</div>
|
<div>{value.description}</div>
|
||||||
<span className="text-sm text-thin-light-gray flex items-start gap-1">
|
<span className="text-sm text-thin-light-gray flex items-start gap-1">
|
||||||
Price:{" "}
|
Reward:{" "}
|
||||||
<span className="text-purple">
|
<span className="text-purple">
|
||||||
{thePrice}
|
{thePrice}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -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 { 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 background from "../../assets/images/bg-sky-blue.jpg";
|
||||||
|
import { localImgLoad } from "../../lib";
|
||||||
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import FamilyWalletRedeemOptions from "./FamilyWalletRedeemOptions";
|
import FamilyWalletRedeemOptions from "./FamilyWalletRedeemOptions";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,25 +13,28 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
|||||||
// const { userDetails } = useSelector((state) => state.userDetails);
|
// const { userDetails } = useSelector((state) => state.userDetails);
|
||||||
// const accountType = userDetails?.account_type === "FAMILY";
|
// const accountType = userDetails?.account_type === "FAMILY";
|
||||||
|
|
||||||
const [selectedWallet, setSelectedWallet] = useState('')
|
const [selectedWallet, setSelectedWallet] = useState("");
|
||||||
|
|
||||||
const [activeWalletBtn, setActiveWalletBtn] = useState('')
|
const [activeWalletBtn, setActiveWalletBtn] = useState("");
|
||||||
|
|
||||||
const handleChangeWallet = ({target:{name}}) => { // FUNCTION TO SWITCH WALLET IF USER HAS MORE THAN TWO WALLETS
|
const handleChangeWallet = ({ target: { name } }) => {
|
||||||
const currentWalletSelected = wallet?.data?.filter((item) => item.code == name);
|
// FUNCTION TO SWITCH WALLET IF USER HAS MORE THAN TWO WALLETS
|
||||||
setSelectedWallet(currentWalletSelected[0])
|
const currentWalletSelected = wallet?.data?.filter(
|
||||||
setActiveWalletBtn(name)
|
(item) => item.code == name
|
||||||
|
);
|
||||||
|
setSelectedWallet(currentWalletSelected[0]);
|
||||||
|
setActiveWalletBtn(name);
|
||||||
// console.log(name, currentWalletSelected)
|
// console.log(name, currentWalletSelected)
|
||||||
}
|
};
|
||||||
|
|
||||||
const image = selectedWallet?.code
|
const image = selectedWallet?.code
|
||||||
? `${selectedWallet?.code.toLowerCase()}.svg`
|
? `${selectedWallet?.code.toLowerCase()}.svg`
|
||||||
: "default.png";
|
: "default.png";
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(() => {
|
||||||
setSelectedWallet(wallet.data[0])
|
setSelectedWallet(wallet.data[0]);
|
||||||
setActiveWalletBtn(wallet?.data[0]?.code)
|
setActiveWalletBtn(wallet?.data[0]?.code);
|
||||||
},[wallet])
|
}, [wallet]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
@@ -44,31 +42,38 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
|||||||
<div className="main-wrapper w-full mb-10">
|
<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-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">
|
<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">
|
<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>
|
</div>
|
||||||
: wallet?.data.length > 0 ?
|
) : wallet?.data.length > 0 ? (
|
||||||
<>
|
<>
|
||||||
{wallet?.data?.length > 1 &&
|
{wallet?.data?.length > 1 && (
|
||||||
<div className="wal-selection px-5 py-2 text-black dark:text-white flex items-center gap-2">
|
<div className="wal-selection px-5 py-2 text-black dark:text-white flex items-center gap-2">
|
||||||
{wallet?.data?.map(item =>(
|
{wallet?.data?.map((item) => (
|
||||||
<button
|
<button
|
||||||
className={`py-0.5 px-1 mb-1 rounded-lg border border-orange-500 ${activeWalletBtn == item?.code && 'bg-orange-500'}`}
|
className={`py-0.5 px-1 mb-1 rounded-lg border border-orange-500 ${
|
||||||
key={item?.wallet_uid}
|
activeWalletBtn == item?.code && "bg-orange-500"
|
||||||
name={item?.code}
|
}`}
|
||||||
onClick={handleChangeWallet}
|
key={item?.wallet_uid}
|
||||||
>
|
name={item?.code}
|
||||||
{item?.description}
|
onClick={handleChangeWallet}
|
||||||
</button>
|
>
|
||||||
))}
|
{item?.description}
|
||||||
</div>
|
</button>
|
||||||
}
|
))}
|
||||||
<div className="p-5 bg-white-opacity min-h-[240px]"
|
</div>
|
||||||
style={{
|
)}
|
||||||
background: `url(${background}) 0% 0% / cover no-repeat`,
|
<div
|
||||||
}}
|
className="p-5 bg-white-opacity min-h-[240px]"
|
||||||
>
|
style={{
|
||||||
|
background: `url(${background}) 0% 0% / cover no-repeat`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{/* image */}
|
{/* 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">
|
<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
|
<img
|
||||||
@@ -77,21 +82,30 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
|||||||
alt="currency-icon"
|
alt="currency-icon"
|
||||||
/>
|
/>
|
||||||
</div>
|
</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">
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
:
|
) : (
|
||||||
<div className="w-full h-full flex justify-center items-center rounded-2xl bg-white">
|
<div className="w-full h-full flex justify-center items-center rounded-2xl bg-white">
|
||||||
<p>No Wallet Record Found</p>
|
<p>No Wallet Record Found</p>
|
||||||
</div>
|
</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>
|
||||||
<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>
|
</div>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
@@ -102,7 +116,6 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// data.length>0 && data.map((item) => (
|
// data.length>0 && data.map((item) => (
|
||||||
// <div key={item.wallet_uid} className="w-full h-full mb-10 ">
|
// <div key={item.wallet_uid} className="w-full h-full mb-10 ">
|
||||||
// {/* <WalletItemCardFamily walletItem={item} payment={payment} countries={countries} /> */}
|
// {/* <WalletItemCardFamily walletItem={item} payment={payment} countries={countries} /> */}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import React, {useState} from 'react'
|
|||||||
import PaginatedList from '../../Pagination/PaginatedList';
|
import PaginatedList from '../../Pagination/PaginatedList';
|
||||||
import { handlePagingFunc } from '../../Pagination/HandlePagination';
|
import { handlePagingFunc } from '../../Pagination/HandlePagination';
|
||||||
|
|
||||||
|
import { currencySymbol } from '../../Helpers/PriceFormatter';
|
||||||
|
|
||||||
function PurchasesTable({purchase}) {
|
function PurchasesTable({purchase}) {
|
||||||
|
|
||||||
const [currentPage, setCurrentPage] = useState(0);
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
@@ -15,7 +17,7 @@ function PurchasesTable({purchase}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
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 ?
|
{purchase.data.length ?
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className='w-full'>
|
<thead className='w-full'>
|
||||||
@@ -31,8 +33,8 @@ function PurchasesTable({purchase}) {
|
|||||||
<td className="p-4">{item.added_date}<br />
|
<td className="p-4">{item.added_date}<br />
|
||||||
<b>{item.confirmation} </b>
|
<b>{item.confirmation} </b>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-4 text-right">{item.amount}</td>
|
<td className="p-4 text-right">{currencySymbol(item.currency, item.amount)}</td>
|
||||||
<td className="p-4 text-right">{item.fee}</td>
|
<td className="p-4 text-right">{currencySymbol(item.currency, item.fee)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import React, { useState } from "react";
|
|||||||
import PaginatedList from "../../Pagination/PaginatedList";
|
import PaginatedList from "../../Pagination/PaginatedList";
|
||||||
import { handlePagingFunc } from "../../Pagination/HandlePagination";
|
import { handlePagingFunc } from "../../Pagination/HandlePagination";
|
||||||
|
|
||||||
|
import { currencySymbol } from '../../Helpers/PriceFormatter';
|
||||||
|
|
||||||
function RecentActivityTable({ payment }) {
|
function RecentActivityTable({ payment }) {
|
||||||
const [currentPage, setCurrentPage] = useState(0);
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
const indexOfFirstItem = Number(currentPage);
|
const indexOfFirstItem = Number(currentPage);
|
||||||
@@ -18,7 +20,7 @@ function RecentActivityTable({ payment }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
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 ?
|
{payment?.data?.length > 0 ?
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className="w-full">
|
<thead className="w-full">
|
||||||
@@ -38,9 +40,9 @@ function RecentActivityTable({ payment }) {
|
|||||||
dangerouslySetInnerHTML={{ __html: item.recipient }}
|
dangerouslySetInnerHTML={{ __html: item.recipient }}
|
||||||
></td>
|
></td>
|
||||||
<td className="p-4 text-right">
|
<td className="p-4 text-right">
|
||||||
{item.amount}
|
{currencySymbol(item.currency, item.amount)}
|
||||||
<br />
|
<br />
|
||||||
{item.fee}
|
{currencySymbol(item.currency, item.fee)}
|
||||||
</td>
|
</td>
|
||||||
<td className="p-4">{item.status}</td>
|
<td className="p-4">{item.status}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -74,17 +74,21 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
|
{walletItem.escrow > 0 ?
|
||||||
HOLDINGS :{" "}
|
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
|
||||||
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
|
HOLDINGS :{" "}
|
||||||
{PriceFormatter(
|
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
|
||||||
walletItem.escrow * 0.01,
|
{PriceFormatter(
|
||||||
walletItem.code,
|
walletItem.escrow * 0.01,
|
||||||
undefined,
|
walletItem.code,
|
||||||
"text-[1.5rem]"
|
undefined,
|
||||||
)}
|
"text-[1.5rem]"
|
||||||
</span>
|
)}
|
||||||
</p>
|
</span>
|
||||||
|
</p>
|
||||||
|
:
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
<div className="w-full h-[1px] bg-white"></div>
|
<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">
|
<div className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||||
<p className="mb-4 p-3">No list avaliable.</p>
|
<p className="p-2">No list avaliable.</p>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</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">
|
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
|
||||||
<Link to="/yourpage" className="notifications">
|
<Link to="/yourpage" className="notifications">
|
||||||
<div className="name">
|
<div className="name">
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ export default function MediaHeader({ logoutModalHandler, sidebarHandler, backpa
|
|||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</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">
|
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
|
||||||
<Link to="/yourpage" className="notifications">
|
<Link to="/yourpage" className="notifications">
|
||||||
<div className="name">
|
<div className="name">
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export default function MobileSidebar({
|
|||||||
{/* Using mini component reduces the bulk amount of html */}
|
{/* Using mini component reduces the bulk amount of html */}
|
||||||
<ListItem
|
<ListItem
|
||||||
title={
|
title={
|
||||||
userDetails?.account_type == "FULL" ? "Dashboard" : "Home"
|
userDetails?.account_type == "FULL" ? "Home" : "Home"
|
||||||
}
|
}
|
||||||
route="/"
|
route="/"
|
||||||
sidebar={sidebar}
|
sidebar={sidebar}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ export default function Sidebar({
|
|||||||
<ul className="flex flex-col space-y-6">
|
<ul className="flex flex-col space-y-6">
|
||||||
{/* Using mini component reduces the bulk amount of html */}
|
{/* Using mini component reduces the bulk amount of html */}
|
||||||
<ListItem
|
<ListItem
|
||||||
title={userDetails?.account_type == "FULL" ? "Dashboard" : "Home"}
|
title={userDetails?.account_type == "FULL" ? "Home" : "Home"}
|
||||||
route="/"
|
route="/"
|
||||||
sidebar={sidebar}
|
sidebar={sidebar}
|
||||||
iconName="new-dashboard"
|
iconName="new-dashboard"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import LoadingSpinner from "../Spinners/LoadingSpinner";
|
|||||||
import { Form, Formik } from "formik";
|
import { Form, Formik } from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import ReferralTable from "../MyWallet/WalletComponent/ReferralTable";
|
import ReferralTable from "../MyWallet/WalletComponent/ReferralTable";
|
||||||
|
import TabButton from "../customTabs/TabButton";
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
ref_email: Yup.string()
|
ref_email: Yup.string()
|
||||||
@@ -105,13 +106,27 @@ function ReferralDisplay() {
|
|||||||
sendReferralMsg({...values}); // FUNCTION TO SEND REFERRAL MESSAGE
|
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(() => {
|
useEffect(() => {
|
||||||
allReferrals();
|
allReferrals();
|
||||||
}, [refHistoryReload]);
|
}, [refHistoryReload]);
|
||||||
|
|
||||||
return (
|
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="sm:flex justify-between items-center mb-6">
|
||||||
<div className="mb-5 sm:mb-0">
|
<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">
|
<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>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div className="referral w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow">
|
<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">
|
||||||
<h2 className="mb-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
<div className="content-tab-items lg:w-[230px] w-full mr-2">
|
||||||
Send Referral
|
<div className='overflow-hidden mb-5 lg:mb-0 py-2 lg:py-8'>
|
||||||
</h2>
|
{tabs.map((item) => (
|
||||||
<Formik
|
<div key={item.id} className='w-full'>
|
||||||
initialValues={initialValues}
|
<TabButton
|
||||||
validationSchema={validationSchema}
|
key={item.id}
|
||||||
onSubmit={handleSubmit}
|
item={item.title}
|
||||||
>
|
iconName={item.iconName}
|
||||||
{(props) => (
|
selectedTab={selectedTab}
|
||||||
<Form className="referral-info">
|
setSelectedTab={setSelectedTab}
|
||||||
<div className="block md:mb-6 md:flex gap-10">
|
/>
|
||||||
{/* Firstname */}
|
</div>
|
||||||
<div className="field w-full mb-6 md:mb-0">
|
))}
|
||||||
<InputCom
|
</div>
|
||||||
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>
|
||||||
|
<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">
|
{/* Lastname */}
|
||||||
<h2 className="mb-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
<div className="field w-full mb-6 md:mb-0">
|
||||||
Referral List
|
<InputCom
|
||||||
</h2>
|
fieldClass="px-6"
|
||||||
{referralList.loading ? (
|
label="Lastname"
|
||||||
<LoadingSpinner size="32" color="sky-blue" />
|
type="text"
|
||||||
) : (
|
name="ref_lastname"
|
||||||
<ReferralTable history={referralList} />
|
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>
|
</div>
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ import ProductCardStyleTwo from "../../Cards/ProductCardStyleTwo";
|
|||||||
import DataIteration from "../../Helpers/DataIteration";
|
import DataIteration from "../../Helpers/DataIteration";
|
||||||
import SearchCom from "../../Helpers/SearchCom";
|
import SearchCom from "../../Helpers/SearchCom";
|
||||||
import ResourceBlogCard from "../../Cards/ResourceBlogCard";
|
import ResourceBlogCard from "../../Cards/ResourceBlogCard";
|
||||||
|
import NewPaginatedList from '../../../components/Pagination/NewPaginatedList'
|
||||||
|
|
||||||
export default function BlogTab({ className, blogdata }) {
|
export default function BlogTab({ className, blogdata }) {
|
||||||
console.log("Blog data here>> ", blogdata);
|
// console.log("Blog data here>> ", blogdata);
|
||||||
// debugger;
|
// debugger;
|
||||||
return (
|
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">
|
<div className="sm:w-1/2 w-full sm:pr-20 pr-0 mb-5 sm:mb-0">
|
||||||
<SearchCom placeholder='Search Blog Items...' />
|
<SearchCom placeholder='Search Blog Items...' />
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<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]">
|
<div className="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-[30px]">
|
||||||
<DataIteration
|
<DataIteration
|
||||||
datas={blogdata?.blogdata}
|
datas={blogdata?.blogdata}
|
||||||
@@ -57,7 +34,42 @@ export default function BlogTab({ className, blogdata }) {
|
|||||||
)}
|
)}
|
||||||
</DataIteration>
|
</DataIteration>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import Icons from "../../Helpers/Icons";
|
import Icons from "../../Helpers/Icons";
|
||||||
import PasswordSvg from "../PasswordSvg";
|
// import PasswordSvg from "../PasswordSvg";
|
||||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
@@ -113,14 +113,19 @@ export default function ChangePasswordTab() {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="changePasswordTab w-full">
|
<div className="changePasswordTab w-full">
|
||||||
<div className="w-full flex xxl:flex-row flex-col-reverse space-x-5 xxl:items-start">
|
<div className="w-full">
|
||||||
<div className="flex-1 mb-10">
|
<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">
|
<div className="input-field mb-6">
|
||||||
<label
|
<label
|
||||||
className="input-label text-dark-gray dark:text-white text-xl font-bold block mb-2.5"
|
className="input-label text-dark-gray dark:text-white text-xl font-bold block mb-2.5"
|
||||||
htmlFor="old_password"
|
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>
|
</label>
|
||||||
<div className="input-wrapper border border-light-purple dark:border-[#5356fb29] w-full rounded-[50px] h-[58px] overflow-hidden relative ">
|
<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">
|
<div className="absolute left-6 bottom-[17px] z-10">
|
||||||
@@ -202,7 +207,7 @@ export default function ChangePasswordTab() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-light-red text-18 tracking-wide border-b dark:border-[#5356fb29] border-light-red"
|
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 */}
|
{/* End of error or success display */}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[440px] sm:flex hidden justify-end">
|
{/* <div className="w-[440px] sm:flex hidden justify-end">
|
||||||
<PasswordSvg />
|
<PasswordSvg />
|
||||||
</div>
|
</div> */}
|
||||||
</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">
|
<h1 className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||||
No Cards Found
|
No Recipient on this account yet.
|
||||||
</h1>
|
</h1>
|
||||||
)}
|
)}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import PersonalInfoTab from "./PersonalInfoTab";
|
|||||||
import PrivacyPolicyTab from "./PrivacyPolicyTab";
|
import PrivacyPolicyTab from "./PrivacyPolicyTab";
|
||||||
import RecentActivitiesTab from "./RecentActivitiesTab";
|
import RecentActivitiesTab from "./RecentActivitiesTab";
|
||||||
import TermsConditionTab from "./TermsConditionTab";
|
import TermsConditionTab from "./TermsConditionTab";
|
||||||
|
import Preferences from './Preferences'
|
||||||
|
|
||||||
export {
|
export {
|
||||||
ChangePasswordTab,
|
ChangePasswordTab,
|
||||||
@@ -18,4 +19,5 @@ export {
|
|||||||
PrivacyPolicyTab,
|
PrivacyPolicyTab,
|
||||||
RecentActivitiesTab,
|
RecentActivitiesTab,
|
||||||
TermsConditionTab,
|
TermsConditionTab,
|
||||||
|
Preferences
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
PrivacyPolicyTab,
|
PrivacyPolicyTab,
|
||||||
RecentActivitiesTab,
|
RecentActivitiesTab,
|
||||||
TermsConditionTab,
|
TermsConditionTab,
|
||||||
|
Preferences,
|
||||||
} from "./Tabs";
|
} from "./Tabs";
|
||||||
import RecipientAccountTab from "./Tabs/RecipientAccountTab";
|
import RecipientAccountTab from "./Tabs/RecipientAccountTab";
|
||||||
|
|
||||||
@@ -91,8 +92,8 @@ export default function Settings({ faq }) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 5,
|
id: 5,
|
||||||
name: "login_activity",
|
name: "preferences",
|
||||||
title: "Login Activity",
|
title: "Preferences",
|
||||||
iconName: "login-activity",
|
iconName: "login-activity",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -166,7 +167,7 @@ export default function Settings({ faq }) {
|
|||||||
<NotificationSettingTab />
|
<NotificationSettingTab />
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
login_activity: <LoginActivityTab />,
|
preferences: <Preferences />,
|
||||||
recent_activities: <RecentActivitiesTab />,
|
recent_activities: <RecentActivitiesTab />,
|
||||||
password: <ChangePasswordTab />,
|
password: <ChangePasswordTab />,
|
||||||
faq: <FaqTab datas={faq} />,
|
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>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ export default function TabButton({ item='', iconName='', selectedTab='', setSel
|
|||||||
<Icons name={iconName} />
|
<Icons name={iconName} />
|
||||||
</div>
|
</div>
|
||||||
<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>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ function DeleteJobPopout({ details, onClose, situation }) {
|
|||||||
{details.title}
|
{details.title}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-lg tracking-wide text-dark-gray dark:text-white flex items-start gap-1">
|
<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>
|
||||||
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
|
<p className="text-lg tracking-wide text-dark-gray dark:text-white">
|
||||||
<span className="job-label">Duration: </span>{details.timeline_days} day(s)
|
<span className="job-label">Duration: </span>{details.timeline_days} day(s)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const validationSchema = Yup.object().shape({
|
|||||||
.required("Price is required"),
|
.required("Price is required"),
|
||||||
title: Yup.string()
|
title: Yup.string()
|
||||||
.min(5, "Minimum 5 characters")
|
.min(5, "Minimum 5 characters")
|
||||||
.max(149, "Maximum 149 characters")
|
.max(80, "Maximum 80 characters")
|
||||||
.required("Title is required"),
|
.required("Title is required"),
|
||||||
description: Yup.string()
|
description: Yup.string()
|
||||||
.min(5, "Minimum 5 characters")
|
.min(5, "Minimum 5 characters")
|
||||||
@@ -273,7 +273,7 @@ const EditJobPopOut = ({
|
|||||||
<div className="field w-full">
|
<div className="field w-full">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6 text-right"
|
fieldClass="px-6 text-right"
|
||||||
label="Price"
|
label="Reward"
|
||||||
labelClass="tracking-wide"
|
labelClass="tracking-wide"
|
||||||
inputBg="bg-slate-100"
|
inputBg="bg-slate-100"
|
||||||
inputClass="input-curve lg border border-light-purple"
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const validationSchema = Yup.object().shape({
|
|||||||
.required("Price is required"),
|
.required("Price is required"),
|
||||||
title: Yup.string()
|
title: Yup.string()
|
||||||
.min(5, "Minimum 5 characters")
|
.min(5, "Minimum 5 characters")
|
||||||
.max(149, "Maximum 149 characters")
|
.max(80, "Maximum 80 characters")
|
||||||
.required("Title is required"),
|
.required("Title is required"),
|
||||||
description: Yup.string()
|
description: Yup.string()
|
||||||
.min(5, "Minimum 5 characters")
|
.min(5, "Minimum 5 characters")
|
||||||
@@ -274,7 +274,7 @@ const EditJobPopoutNew = ({
|
|||||||
<div className="field w-full mb-[0.5rem] sm:mb-0">
|
<div className="field w-full mb-[0.5rem] sm:mb-0">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6 text-right"
|
fieldClass="px-6 text-right"
|
||||||
label="Price"
|
label="Reward"
|
||||||
labelClass="tracking-wide"
|
labelClass="tracking-wide"
|
||||||
inputBg="bg-slate-100"
|
inputBg="bg-slate-100"
|
||||||
inputClass="input-curve lg border border-light-purple"
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ function FamilyOfferJobPopout({ details, onClose, situation }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="my-2 md:flex">
|
<div className="my-2 md:flex">
|
||||||
<Detail label="Price" value={details.thePrice} />
|
<Detail label="Reward" value={details.thePrice} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="my-2 md:flex">
|
<div className="my-2 md:flex">
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ function JobListPopout({
|
|||||||
const DetailsComponent = () => {
|
const DetailsComponent = () => {
|
||||||
const detailsArray = [
|
const detailsArray = [
|
||||||
{ label: "Description", value: details.description },
|
{ label: "Description", value: details.description },
|
||||||
{ label: "Price", value: details.thePrice },
|
{ label: "Reward", value: details.thePrice },
|
||||||
{ label: "Timeline", value: `${details.timeline_days} day(s)` },
|
{ label: "Timeline", value: `${details.timeline_days} day(s)` },
|
||||||
{ label: "Created", value: new Date(details?.created).toDateString() },
|
{ label: "Created", value: new Date(details?.created).toDateString() },
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ function NewJobListPopout({
|
|||||||
const DetailsComponent = () => {
|
const DetailsComponent = () => {
|
||||||
const detailsArray = [
|
const detailsArray = [
|
||||||
{ label: "Description", value: details.description },
|
{ label: "Description", value: details.description },
|
||||||
{ label: "Price", value: details.thePrice },
|
{ label: "Reward", value: details.thePrice },
|
||||||
{ label: "Timeline", value: `${details.timeline_days} day(s)` },
|
{ label: "Timeline", value: `${details.timeline_days} day(s)` },
|
||||||
{ label: "Created", value: new Date(details?.created).toDateString() },
|
{ label: "Created", value: new Date(details?.created).toDateString() },
|
||||||
];
|
];
|
||||||
@@ -344,11 +344,11 @@ function NewJobListPopout({
|
|||||||
{selectedTab == 'family' ?
|
{selectedTab == 'family' ?
|
||||||
'Assign to family'
|
'Assign to family'
|
||||||
: selectedTab == 'public' ?
|
: selectedTab == 'public' ?
|
||||||
'Offer this job to public'
|
'Place in Market'
|
||||||
: selectedTab == 'individual' ?
|
: selectedTab == 'individual' ?
|
||||||
'Offer this job to individual'
|
'Assign to individual'
|
||||||
: selectedTab == 'group' ?
|
: selectedTab == 'group' ?
|
||||||
'Offer this job to your Group'
|
'Preferred List'
|
||||||
:
|
:
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import LoadingSpinner from "../Spinners/LoadingSpinner";
|
|||||||
|
|
||||||
import { tableReload } from "../../store/TableReloads";
|
import { tableReload } from "../../store/TableReloads";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
|
|
||||||
function OfferJobPopout({ details, onClose, situation }) {
|
function OfferJobPopout({ details, onClose, situation }) {
|
||||||
const apiUrl = new usersService();
|
const apiUrl = new usersService();
|
||||||
@@ -21,6 +22,12 @@ function OfferJobPopout({ details, onClose, situation }) {
|
|||||||
trigger: "",
|
trigger: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let thePrice = PriceFormatter(
|
||||||
|
details?.price * 0.01,
|
||||||
|
details?.currency_code,
|
||||||
|
details?.currency
|
||||||
|
);
|
||||||
|
|
||||||
//FUNCTION TO HANDLE AN OFFER
|
//FUNCTION TO HANDLE AN OFFER
|
||||||
const handleOffer = ({ target: { name } }) => {
|
const handleOffer = ({ target: { name } }) => {
|
||||||
const reqData = {
|
const reqData = {
|
||||||
@@ -71,6 +78,7 @@ function OfferJobPopout({ details, onClose, situation }) {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
onClose();
|
onClose();
|
||||||
dispatch(tableReload({ type: "MYTASKTABLE" }));
|
dispatch(tableReload({ type: "MYTASKTABLE" }));
|
||||||
|
dispatch(tableReload({ type: "HOMEBANNERS" }));
|
||||||
navigate("/mytask", { replace: true });
|
navigate("/mytask", { replace: true });
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -133,56 +141,74 @@ function OfferJobPopout({ details, onClose, situation }) {
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="md:flex bg-white dark:bg-dark-white rounded-lg">
|
<div className="grid md:grid-cols-4 bg-white dark:bg-dark-white rounded-lg">
|
||||||
<div className="p-4 w-full md:w-3/4 md:border-r-2">
|
<div className="md:col-span-3 md:border-r-2">
|
||||||
<p className="text-lg my-5 font-semibold text-slate-900 dark:text-white tracking-wide">
|
|
||||||
{details.title}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{/* INPUT SECTION */}
|
{/* INPUT SECTION */}
|
||||||
<div className="my-2 md:flex">
|
<div className='bg-[#FFFDEE] p-4 w-full'>
|
||||||
<Detail
|
<div className='grid md:grid-cols-2'>
|
||||||
label="Date"
|
<div className="my-2 md:flex">
|
||||||
value={
|
<label className='job-label w-full md:w-[150px] md:text-right'>Date :</label>
|
||||||
(details.offer_added && details.offer_added?.split(" ")[0]) ||
|
<p className={`p-1 w-full md:w-3/4 text-sm text-slate-900 dark:text-white`}>
|
||||||
"default"
|
{
|
||||||
}
|
(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>
|
||||||
|
|
||||||
<div className="my-2 md:flex">
|
<div className='p-4 w-full'>
|
||||||
<Detail label="Description" value={details.description} />
|
<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>
|
||||||
|
|
||||||
<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>
|
</div>
|
||||||
|
|
||||||
{/* ACTION SECTION */}
|
{/* ACTION SECTION */}
|
||||||
<div className="p-4 w-full md:w-1/4 h-full">
|
<div className="p-4 w-full md:col-span-1 h-full flex flex-col justify-between">
|
||||||
<div className="my-3 md:flex md:justify-center">
|
<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" ? (
|
{requestStatus.loading && requestStatus.trigger == "offer" ? (
|
||||||
<LoadingSpinner size={8} color="sky-blue" />
|
<LoadingSpinner size={8} color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
@@ -190,9 +216,9 @@ function OfferJobPopout({ details, onClose, situation }) {
|
|||||||
name="accept"
|
name="accept"
|
||||||
onClick={handleOffer}
|
onClick={handleOffer}
|
||||||
disabled={requestStatus.loading}
|
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>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -205,9 +231,10 @@ function OfferJobPopout({ details, onClose, situation }) {
|
|||||||
name="reject"
|
name="reject"
|
||||||
onClick={handleOffer}
|
onClick={handleOffer}
|
||||||
disabled={requestStatus.loading}
|
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
|
Reject Offer
|
||||||
|
<div className='absolute bottom-1 w-full h-[1px] bg-black hidden group-hover:block'></div>
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import ModalCom from "../Helpers/ModalCom";
|
import ModalCom from "../Helpers/ModalCom";
|
||||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import Detail from "./popoutcomponent/Detail";
|
import Detail from "./popoutcomponent/Detail";
|
||||||
|
import {PriceFormatter} from '../Helpers/PriceFormatter'
|
||||||
|
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { tableReload } from "../../store/TableReloads";
|
|
||||||
import { NewDateTimeFormatter } from "../../lib/NewDateTimeFormatter";
|
import { NewDateTimeFormatter } from "../../lib/NewDateTimeFormatter";
|
||||||
|
import { tableReload } from "../../store/TableReloads";
|
||||||
|
|
||||||
const showSuccessToast = (message) => {
|
const showSuccessToast = (message) => {
|
||||||
toast.success(message, {
|
toast.success(message, {
|
||||||
@@ -73,7 +73,7 @@ function PendingJobsPopout({ details, onClose, situation }) {
|
|||||||
setRequestMessage({ status: true, message: res.data.status });
|
setRequestMessage({ status: true, message: res.data.status });
|
||||||
dispatch(tableReload({ type: "PENDINGTABLE" }));
|
dispatch(tableReload({ type: "PENDINGTABLE" }));
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
onClose()
|
onClose();
|
||||||
setPendingJobLoader({ extend: false, offer: false });
|
setPendingJobLoader({ extend: false, offer: false });
|
||||||
setRequestMessage({ status: false, message: "" });
|
setRequestMessage({ status: false, message: "" });
|
||||||
}, 4000);
|
}, 4000);
|
||||||
@@ -140,14 +140,8 @@ function PendingJobsPopout({ details, onClose, situation }) {
|
|||||||
<ModalCom action={onClose} situation={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="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">
|
<div className="modal-header-con">
|
||||||
<h1 className="modal-title">
|
<h1 className="modal-title">Manage Pending Item</h1>
|
||||||
Manage Pending Item
|
<button type="button" className="modal-close-btn" onClick={onClose}>
|
||||||
</h1>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="modal-close-btn"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
<svg
|
<svg
|
||||||
width="36"
|
width="36"
|
||||||
height="36"
|
height="36"
|
||||||
@@ -214,7 +208,7 @@ function PendingJobsPopout({ details, onClose, situation }) {
|
|||||||
|
|
||||||
<div className="my-2 md:flex">
|
<div className="my-2 md:flex">
|
||||||
<Detail
|
<Detail
|
||||||
label="Price"
|
label="Reward"
|
||||||
// value={`${details.price * 0.01} ${details.currency}`}
|
// value={`${details.price * 0.01} ${details.currency}`}
|
||||||
value={PriceFormatter(
|
value={PriceFormatter(
|
||||||
details.price * 0.01,
|
details.price * 0.01,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export default function AssignToFamily({
|
|||||||
</div>
|
</div>
|
||||||
<div className="mt-3 mb-1 flex justify-end items-center">
|
<div className="mt-3 mb-1 flex justify-end items-center">
|
||||||
<button
|
<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"
|
type="submit"
|
||||||
name='family'
|
name='family'
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -48,14 +48,14 @@ export default function AssignToGroup({
|
|||||||
</div>
|
</div>
|
||||||
<div className="mt-3 mb-1 flex justify-end items-center">
|
<div className="mt-3 mb-1 flex justify-end items-center">
|
||||||
<button
|
<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"
|
type="submit"
|
||||||
name='group'
|
name='group'
|
||||||
>
|
>
|
||||||
{loader?.jobFields ?
|
{loader?.jobFields ?
|
||||||
<LoadingSpinner size={5} />
|
<LoadingSpinner size={5} />
|
||||||
:
|
:
|
||||||
'Send Order to Group'
|
'Send Task to Group'
|
||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export default function AssignToIndividual({
|
|||||||
</div>
|
</div>
|
||||||
<div className="mt-3 mb-1 flex justify-end items-center">
|
<div className="mt-3 mb-1 flex justify-end items-center">
|
||||||
<button
|
<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"
|
type="submit"
|
||||||
name='individual'
|
name='individual'
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -102,14 +102,14 @@ export default function AssignToPublic({
|
|||||||
</div>
|
</div>
|
||||||
<div className="mt-3 mb-1 flex justify-end items-center">
|
<div className="mt-3 mb-1 flex justify-end items-center">
|
||||||
<button
|
<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"
|
type="submit"
|
||||||
name='public'
|
name='public'
|
||||||
>
|
>
|
||||||
{loader?.jobFields ?
|
{loader?.jobFields ?
|
||||||
<LoadingSpinner size={5} />
|
<LoadingSpinner size={5} />
|
||||||
:
|
:
|
||||||
'Show Task to Public'
|
'Place Task to the Market'
|
||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@
|
|||||||
.job-action {
|
.job-action {
|
||||||
background-color: #4687ba;
|
background-color: #4687ba;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
padding: 3px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.msg_box {
|
.msg_box {
|
||||||
|
|||||||
+4
-1
@@ -278,5 +278,8 @@ export const apiConst = {
|
|||||||
PAY_MODE_CCARD: 1,
|
PAY_MODE_CCARD: 1,
|
||||||
PAY_MODE_BONUS: 9,
|
PAY_MODE_BONUS: 9,
|
||||||
APPROVED_BALANCE: 5,
|
APPROVED_BALANCE: 5,
|
||||||
DISAPROVE_BALANCE: 3
|
DISAPROVE_BALANCE: 3,
|
||||||
|
|
||||||
|
WRENCHBOARD_VERIFY_PROMO: 55056,
|
||||||
|
WRENCHBOARD_LOGIN_PROMO: 55057,
|
||||||
};
|
};
|
||||||
@@ -27,7 +27,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
|
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const { jobListTable, marketTableList, walletTable, familyBannersListTable } = useSelector(
|
const { jobListTable, marketTableList, walletTable, familyBannersListTable, homeBanners } = useSelector(
|
||||||
(state) => state.tableReload
|
(state) => state.tableReload
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -111,8 +111,26 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
//FUNCTION TO GET COMMON HEAD DATA
|
||||||
useEffect(() => {
|
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
|
// function to load user notification
|
||||||
dispatch(updateNotifications({ loading: true }));
|
dispatch(updateNotifications({ loading: true }));
|
||||||
apiCall
|
apiCall
|
||||||
@@ -168,7 +186,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
dispatch(updateNotifications({ loading: false, data: null }));
|
dispatch(updateNotifications({ loading: false, data: null }));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
getNotifications();
|
// delay verify requests by 10000ms
|
||||||
|
const delay15secs = setTimeout(notifications, 15000)
|
||||||
|
return ()=> clearTimeout(delay15secs)
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -230,41 +250,23 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
}, [apiCall, dispatch, marketTableList, isLogin.status]);
|
}, [apiCall, dispatch, marketTableList, isLogin.status]);
|
||||||
|
|
||||||
//FUNCTION TO GET COMMON HEAD DATA
|
//FUNCTION TO GET COMMON HEAD DATA
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
// if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
apiCall
|
// apiCall
|
||||||
.getHeroJBanners()
|
// .getRecentActivitiedData()
|
||||||
.then((res) => {
|
// .then((res) => {
|
||||||
if (res.data?.internal_return < 0) {
|
// // debugger;
|
||||||
return;
|
// if (res?.data?.internal_return < 0) {
|
||||||
}
|
// return;
|
||||||
dispatch(commonHeadBanner(res.data));
|
// }
|
||||||
})
|
// dispatch(recentActivitiesData(res.data));
|
||||||
.catch((error) => {
|
// })
|
||||||
console.log("ERROR ", error);
|
// .catch((error) => {
|
||||||
});
|
// console.log("ERROR ", error);
|
||||||
}, [isLogin.status]);
|
// });
|
||||||
|
// }, [isLogin.status]);
|
||||||
//FUNCTION TO GET COMMON HEAD DATA
|
|
||||||
useEffect(() => {
|
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
|
||||||
return
|
|
||||||
}
|
|
||||||
apiCall
|
|
||||||
.getRecentActivitiedData()
|
|
||||||
.then((res) => {
|
|
||||||
// debugger;
|
|
||||||
if (res?.data?.internal_return < 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
dispatch(recentActivitiesData(res.data));
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.log("ERROR ", error);
|
|
||||||
});
|
|
||||||
}, [isLogin.status]);
|
|
||||||
|
|
||||||
|
|
||||||
//FUNCTION TO GET FAMILY BANNERS
|
//FUNCTION TO GET FAMILY BANNERS
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class usersService {
|
|||||||
member_id: localStorage.getItem("member_id"),
|
member_id: localStorage.getItem("member_id"),
|
||||||
sessionid: localStorage.getItem("session_token"),
|
sessionid: localStorage.getItem("session_token"),
|
||||||
};
|
};
|
||||||
return this.postAuxEnd("/getwallets", postData);
|
return this.postAuxEnd("/wallets", postData);
|
||||||
}
|
}
|
||||||
getApiGate() {
|
getApiGate() {
|
||||||
// localStorage.setItem("session_token", ``);
|
// localStorage.setItem("session_token", ``);
|
||||||
@@ -208,7 +208,7 @@ class usersService {
|
|||||||
// }
|
// }
|
||||||
getHeroJBanners() {
|
getHeroJBanners() {
|
||||||
var postData = {
|
var postData = {
|
||||||
uuid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
member_id: localStorage.getItem("member_id"),
|
member_id: localStorage.getItem("member_id"),
|
||||||
sessionid: localStorage.getItem("session_token"),
|
sessionid: localStorage.getItem("session_token"),
|
||||||
page: 0,
|
page: 0,
|
||||||
@@ -1493,6 +1493,46 @@ class usersService {
|
|||||||
return this.postAuxEnd("/verifycompleted", postData);
|
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(username)
|
||||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const initialState = {
|
|||||||
familyOfferList: false,
|
familyOfferList: false,
|
||||||
parentFamilyTaskList: false,
|
parentFamilyTaskList: false,
|
||||||
offerInterestListReload: false,
|
offerInterestListReload: false,
|
||||||
|
homeBanners: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tableReloadSlice = createSlice({
|
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
|
case "OFFERINTERESTLISTRELOAD": // to reload offer interest list of owner when a worker sends interest in a job
|
||||||
state.offerInterestListReload = !state.offerInterestListReload;
|
state.offerInterestListReload = !state.offerInterestListReload;
|
||||||
return;
|
return;
|
||||||
|
case "HOMEBANNERS": // to reload offer interest list of owner when a worker sends interest in a job
|
||||||
|
state.homeBanners = !state.homeBanners;
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-4
@@ -1,13 +1,23 @@
|
|||||||
|
import {useState, useEffect} from 'react'
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import Home from "../components/Home";
|
import Home from "../components/Home";
|
||||||
|
|
||||||
export default function HomePages() {
|
export default function HomePages() {
|
||||||
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
||||||
|
|
||||||
const bannerOptions = {
|
const [bannerOptions, setBannerOptions] = useState({})
|
||||||
bannerList: commonHeadBanner?.result_list,
|
|
||||||
dashTypes: commonHeadBanner?.home_dash_type,
|
|
||||||
};
|
|
||||||
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import React from "react";
|
||||||
|
import LearnMore from "../components/LearnMore/LearnMore";
|
||||||
|
|
||||||
|
export default function LearnMorePage() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<LearnMore />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -4,8 +4,13 @@ import MyTasks from "../components/MyTasks";
|
|||||||
import usersService from "../services/UsersService";
|
import usersService from "../services/UsersService";
|
||||||
|
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
import RecentlyPastDue from "../components/MyTasks/RecentlyPastDue";
|
||||||
|
|
||||||
export default function MyTaskPage() {
|
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);
|
const { myTaskTable } = useSelector((state) => state.tableReload);
|
||||||
|
|
||||||
let { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
let { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
||||||
@@ -16,7 +21,8 @@ export default function MyTaskPage() {
|
|||||||
data: [],
|
data: [],
|
||||||
});
|
});
|
||||||
const [MyActiveOffersList, setMyActiveOffersList] = useState([]);
|
const [MyActiveOffersList, setMyActiveOffersList] = useState([]);
|
||||||
const api = new usersService();
|
|
||||||
|
const [recentPastDue, setRecentPastDue] = useState({loading: true, data: {}});
|
||||||
|
|
||||||
const getMyActiveJobList = async () => {
|
const getMyActiveJobList = async () => {
|
||||||
setMyActiveJobList({ loading: true, status: false, data: [] });
|
setMyActiveJobList({ loading: true, status: false, data: [] });
|
||||||
@@ -32,6 +38,7 @@ export default function MyTaskPage() {
|
|||||||
console.log("Error getting tasks");
|
console.log("Error getting tasks");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getMyActiveOffersList = async () => {
|
const getMyActiveOffersList = async () => {
|
||||||
// setMyActiveOffersList({loading: true, status:false, data:[]});
|
// setMyActiveOffersList({loading: true, status:false, data:[]});
|
||||||
try {
|
try {
|
||||||
@@ -42,6 +49,21 @@ export default function MyTaskPage() {
|
|||||||
console.log("Error getting offers");
|
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(() => {
|
useEffect(() => {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
await Promise.all([getMyActiveJobList(), getMyActiveOffersList()]);
|
await Promise.all([getMyActiveJobList(), getMyActiveOffersList()]);
|
||||||
@@ -52,10 +74,20 @@ export default function MyTaskPage() {
|
|||||||
|
|
||||||
//debugger;
|
//debugger;
|
||||||
return (
|
return (
|
||||||
<MyTasks
|
<>
|
||||||
ActiveJobList={MyActiveJobList}
|
{tab == 'pastdue' ?
|
||||||
MyActiveOffersList={MyActiveOffersList}
|
<RecentlyPastDue
|
||||||
commonHeadData={commonHeadBanner?.result_list}
|
recentPastDue={recentPastDue}
|
||||||
/>
|
imageServer={recentPastDue?.data?.session_image_server}
|
||||||
|
commonHeadData={commonHeadBanner?.result_list}
|
||||||
|
/>
|
||||||
|
:
|
||||||
|
<MyTasks
|
||||||
|
ActiveJobList={MyActiveJobList}
|
||||||
|
MyActiveOffersList={MyActiveOffersList}
|
||||||
|
commonHeadData={commonHeadBanner?.result_list}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import Promo from '../components/AuthPages/Promo/Promo'
|
||||||
|
|
||||||
|
export default function PromoPage() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Promo />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user