Compare commits
71 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5088561e13 | |||
| 6dd870bb05 | |||
| e5c511bd8f | |||
| ead1be773f | |||
| 2d6c189f57 | |||
| 841dfee7e6 | |||
| 8ac8808348 | |||
| f57f443b1e | |||
| 0f770474af | |||
| 8668c39c6f | |||
| 840abb4dcc | |||
| 9da4ed2282 | |||
| 713c333e96 | |||
| 3b27db4ffe | |||
| 8db2316a30 | |||
| a1072c58c0 | |||
| 5b9c564f96 | |||
| c14d8b0659 | |||
| 43f59e8e84 | |||
| ca53101b55 | |||
| f3b8190418 | |||
| 6a37da92f0 | |||
| 3d382695cd | |||
| 9b0ff4a1e6 | |||
| 7231d97492 | |||
| f880afabb0 | |||
| e9d9dd2395 | |||
| a9c273aa17 | |||
| dddd314412 | |||
| 43f0039d29 | |||
| c9a475b525 | |||
| 74b2a554f1 | |||
| d2a406563a | |||
| d509fb024c | |||
| 4acae3401d | |||
| 05a1dc3663 | |||
| 63eb8b9729 | |||
| a474d42d85 | |||
| dcb820590d | |||
| 614c376c92 | |||
| b589277678 | |||
| 00a70f3574 | |||
| 7859cffd49 | |||
| 3a574d1fd0 | |||
| 7c6a2316a8 | |||
| ef99a8f1f7 | |||
| ba0aac126c | |||
| 05453661ee | |||
| aee1b9e3bb | |||
| 9a0dc0d01a | |||
| a467626fae | |||
| 47932d7301 | |||
| de4de35611 | |||
| b3c2785a4b | |||
| 2719b8426d | |||
| fed2358a45 | |||
| ff129480a5 | |||
| 8cf0c8da89 | |||
| 6aaf682d38 | |||
| 9f77a01bb2 | |||
| 9d79e1c709 | |||
| 78ac5d5b24 | |||
| 75657350a3 | |||
| 171f99d997 | |||
| 25c7cd75c7 | |||
| fd68800b00 | |||
| 33f1515d2c | |||
| 2cc30d6c47 | |||
| cfadb42811 | |||
| 1bb2eb3203 | |||
| cd68861dfa |
@@ -72,7 +72,8 @@ REACT_APP_APPLE_SOCIAL_LOGIN=0
|
|||||||
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
|
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
|
||||||
|
|
||||||
#File Handling
|
#File Handling
|
||||||
REACT_APP_MAX_FILE_SIZE=1000000
|
REACT_APP_MAX_FILE_SIZE=1048576
|
||||||
|
REACT_APP_MAX_VIDEO_FILE_SIZE=31457280
|
||||||
REACT_APP_TOTAL_NUM_FILE=4
|
REACT_APP_TOTAL_NUM_FILE=4
|
||||||
|
|
||||||
#Auth Text(s)
|
#Auth Text(s)
|
||||||
@@ -124,4 +125,7 @@ REACT_APP_MEDIA_LINK='https://dev-media.wrenchboard.com'
|
|||||||
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
||||||
|
|
||||||
# REACT APP CUSTOMTIMER
|
# REACT APP CUSTOMTIMER
|
||||||
REACT_APP_CUSTOMTIMER=90
|
REACT_APP_CUSTOMTIMER=90
|
||||||
|
|
||||||
|
#SHOW OR HIDE MY PAGE LINK ROUTE
|
||||||
|
REACT_APP_SHOW_USER_PAGE=1
|
||||||
+7
-2
@@ -43,7 +43,9 @@ REACT_APP_GOOGLE_CLIENT_SECRET=aozK_2G8UjaCmLgPPkv9abIm
|
|||||||
REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
|
REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
|
||||||
REACT_APP_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/
|
REACT_APP_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/
|
||||||
|
|
||||||
REACT_APP_MAX_FILE_SIZE=1000000
|
#File Handling
|
||||||
|
REACT_APP_MAX_FILE_SIZE=1048576
|
||||||
|
REACT_APP_MAX_VIDEO_FILE_SIZE=31457280
|
||||||
REACT_APP_TOTAL_NUM_FILE=4
|
REACT_APP_TOTAL_NUM_FILE=4
|
||||||
|
|
||||||
REACT_APP_LOGOUT_TEXT="Sign Out"
|
REACT_APP_LOGOUT_TEXT="Sign Out"
|
||||||
@@ -92,4 +94,7 @@ REACT_APP_MEDIA_LINK='https://dev-media.wrenchboard.com'
|
|||||||
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
||||||
|
|
||||||
# REACT APP CUSTOMTIMER
|
# REACT APP CUSTOMTIMER
|
||||||
REACT_APP_CUSTOMTIMER=90
|
REACT_APP_CUSTOMTIMER=90
|
||||||
|
|
||||||
|
#SHOW OR HIDE MY PAGE LINK ROUTE
|
||||||
|
REACT_APP_SHOW_USER_PAGE=1
|
||||||
+7
-2
@@ -50,7 +50,9 @@ REACT_APP_FACEBOOK_REDIRECT_URL="https://users.wrenchboard.com/login/auth/flogin
|
|||||||
|
|
||||||
DISABLE_ESLINT_PLUGIN=true
|
DISABLE_ESLINT_PLUGIN=true
|
||||||
|
|
||||||
REACT_APP_MAX_FILE_SIZE=1000000
|
#File Handling
|
||||||
|
REACT_APP_MAX_FILE_SIZE=1048576
|
||||||
|
REACT_APP_MAX_VIDEO_FILE_SIZE=31457280
|
||||||
REACT_APP_TOTAL_NUM_FILE=4
|
REACT_APP_TOTAL_NUM_FILE=4
|
||||||
|
|
||||||
REACT_APP_LOGOUT_TEXT="Sign Out"
|
REACT_APP_LOGOUT_TEXT="Sign Out"
|
||||||
@@ -98,4 +100,7 @@ REACT_APP_MEDIA_LINK='https://media.wrenchboard.com'
|
|||||||
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
||||||
|
|
||||||
# REACT APP CUSTOMTIMER
|
# REACT APP CUSTOMTIMER
|
||||||
REACT_APP_CUSTOMTIMER=90
|
REACT_APP_CUSTOMTIMER=90
|
||||||
|
|
||||||
|
#SHOW OR HIDE MY PAGE LINK ROUTE
|
||||||
|
REACT_APP_SHOW_USER_PAGE=0
|
||||||
+7
-6
@@ -67,6 +67,7 @@ import MyPastDueTasksPage from "./views/MyPastDueTasksPage";
|
|||||||
import FamilyWalletPage from "./views/FamilyWalletPage";
|
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";
|
||||||
|
|
||||||
export default function Routers() {
|
export default function Routers() {
|
||||||
return (
|
return (
|
||||||
@@ -147,11 +148,7 @@ export default function Routers() {
|
|||||||
<Route exact path="/ai-lab" element={<FamAIQuestionPage />} />
|
<Route exact path="/ai-lab" element={<FamAIQuestionPage />} />
|
||||||
<Route exact path="/fam-games" element={<FamGamesPage />} />
|
<Route exact path="/fam-games" element={<FamGamesPage />} />
|
||||||
<Route exact path="/work-in-progress" element={<FamWorkInProgressPage />} />
|
<Route exact path="/work-in-progress" element={<FamWorkInProgressPage />} />
|
||||||
<Route
|
|
||||||
exact
|
|
||||||
path="/familysettings"
|
|
||||||
element={<FamilySettingsPage />}
|
|
||||||
/>
|
|
||||||
<Route exact path="/pastdue" element={<MyPastDueTasksPage />} />
|
<Route exact path="/pastdue" element={<MyPastDueTasksPage />} />
|
||||||
<Route exact path="/notification" element={<Notification />} />
|
<Route exact path="/notification" element={<Notification />} />
|
||||||
<Route exact path="/mytask" element={<MyTaskPage />} />
|
<Route exact path="/mytask" element={<MyTaskPage />} />
|
||||||
@@ -170,8 +167,12 @@ export default function Routers() {
|
|||||||
path="/my-review-jobs"
|
path="/my-review-jobs"
|
||||||
element={<MyReviewDueJobsPage />}
|
element={<MyReviewDueJobsPage />}
|
||||||
/>
|
/>
|
||||||
<Route exact path="/acc-family" element={<FamilyAccPage />} />
|
|
||||||
|
{/* <Route exact path='/acc-family' element={<FamilyAccPage />} />
|
||||||
<Route exact path="/acc-family/activities" element={<FamilyActivitiesPage />} />
|
<Route exact path="/acc-family/activities" element={<FamilyActivitiesPage />} />
|
||||||
|
<Route exact path="/acc-family/familysettings" element={<FamilySettingsPage />} /> */}
|
||||||
|
<Route path='/acc-family/*' element={<FamilyRoutesPage />} />
|
||||||
|
|
||||||
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
||||||
<Route exact path="/start-job" element={<StartJob />} />
|
<Route exact path="/start-job" element={<StartJob />} />
|
||||||
<Route exact path="/yourpage" element={<YourPages />} />
|
<Route exact path="/yourpage" element={<YourPages />} />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import linkedInLogo from "../../../assets/images/Linkedin.png";
|
|||||||
import appleLogo from "../../../assets/images/apple-black.svg";
|
import appleLogo from "../../../assets/images/apple-black.svg";
|
||||||
import facebookLogo from "../../../assets/images/facebook.svg";
|
import facebookLogo from "../../../assets/images/facebook.svg";
|
||||||
import googleLogo from "../../../assets/images/google-logo.svg";
|
import googleLogo from "../../../assets/images/google-logo.svg";
|
||||||
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text_new.png";
|
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
||||||
import usersService from "../../../services/UsersService";
|
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";
|
||||||
@@ -145,6 +145,7 @@ export default function Login() {
|
|||||||
localStorage.setItem("member_id", `${res.data.member_id}`);
|
localStorage.setItem("member_id", `${res.data.member_id}`);
|
||||||
localStorage.setItem("uid", `${res.data.uid}`);
|
localStorage.setItem("uid", `${res.data.uid}`);
|
||||||
localStorage.setItem("session_token", `${res.data.session}`);
|
localStorage.setItem("session_token", `${res.data.session}`);
|
||||||
|
localStorage.setItem("wallet_available_status", `${res.data.wallet_available_status}`);
|
||||||
if (res.data?.account_type == "FAMILY") {
|
if (res.data?.account_type == "FAMILY") {
|
||||||
sessionStorage.setItem("family_uid", res.data?.family_uid);
|
sessionStorage.setItem("family_uid", res.data?.family_uid);
|
||||||
sessionStorage.setItem("parent_uid", res.data?.parent_uid);
|
sessionStorage.setItem("parent_uid", res.data?.parent_uid);
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
||||||
import debounce from "../../../hooks/debounce";
|
import debounce from "../../../hooks/debounce";
|
||||||
import usersService from "../../../services/UsersService";
|
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 LoadingSpinner from '../../../components/Spinners/LoadingSpinner'
|
||||||
|
import { updateUserDetails } from "../../../store/UserDetails";
|
||||||
|
|
||||||
export default function VerifyLink() {
|
export default function VerifyLink() {
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const [email, setEmail] = useState("");
|
const [email, setEmail] = useState("");
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
const [msgError, setMsgError] = useState("");
|
const [msgError, setMsgError] = useState("");
|
||||||
@@ -49,12 +55,14 @@ export default function VerifyLink() {
|
|||||||
) {
|
) {
|
||||||
localStorage.setItem("email", `${data?.email}`);
|
localStorage.setItem("email", `${data?.email}`);
|
||||||
localStorage.setItem("member_id", `${data?.member_id}`);
|
localStorage.setItem("member_id", `${data?.member_id}`);
|
||||||
|
localStorage.setItem("uid", `${data?.uid}`);
|
||||||
localStorage.setItem("session_token", `${data?.session}`);
|
localStorage.setItem("session_token", `${data?.session}`);
|
||||||
localStorage.setItem("session", `${data?.session}`);
|
localStorage.setItem("wallet_available_status", `${data?.wallet_available_status}`);
|
||||||
localStorage.setItem("uid", data?.uid);
|
dispatch(updateUserDetails({ ...data }));
|
||||||
|
setTimeout(() => {
|
||||||
navigate("/", { replace: true });
|
navigate("/", { replace: true });
|
||||||
setLinkLoader(false);
|
setLinkLoader(false);
|
||||||
|
}, 2000);
|
||||||
} else {
|
} else {
|
||||||
setLinkLoader(false);
|
setLinkLoader(false);
|
||||||
setMsgError("Invalid Link or Password Combination");
|
setMsgError("Invalid Link or Password Combination");
|
||||||
@@ -119,7 +127,14 @@ export default function VerifyLink() {
|
|||||||
<>
|
<>
|
||||||
<AuthLayout slogan="Welcome to WrenchBoard">
|
<AuthLayout slogan="Welcome to WrenchBoard">
|
||||||
{pageLoader ? (
|
{pageLoader ? (
|
||||||
<img src={WrenchBoard} alt="wrenchboard" className="h-10 mx-auto" />
|
<div className='flex flex-col justify-center items-center gap-4'>
|
||||||
|
<img src={WrenchBoard} alt="wrenchboard" className="h-10 mx-auto" />
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="mb-12">
|
<div className="mb-12">
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
import MarketPopUp from "../MarketPlace/PopUp/MarketPopUp";
|
import MarketPopUp from "../MarketPlace/PopUp/MarketPopUp";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import PendingJobsPopout from "../jobPopout/PendingJobsPopout";
|
||||||
|
|
||||||
export default function AvailableJobsCard({
|
export default function AvailableJobsCard({
|
||||||
className,
|
className,
|
||||||
@@ -11,8 +13,15 @@ export default function AvailableJobsCard({
|
|||||||
}) {
|
}) {
|
||||||
//debugger;
|
//debugger;
|
||||||
const [marketPopUp, setMarketPopUp] = useState({ show: false, data: {} });
|
const [marketPopUp, setMarketPopUp] = useState({ show: false, data: {} });
|
||||||
|
const [jobPopout, setJobPopout] = useState({ show: false, data: {} });
|
||||||
|
|
||||||
const [imageUrl, setImageUrl] = useState("");
|
const [imageUrl, setImageUrl] = useState("");
|
||||||
|
|
||||||
|
const {
|
||||||
|
userDetails: { uid },
|
||||||
|
} = useSelector((state) => state?.userDetails); // GETS USER DETAILS
|
||||||
|
|
||||||
|
|
||||||
let thePrice = PriceFormatter(
|
let thePrice = PriceFormatter(
|
||||||
datas?.price * 0.01,
|
datas?.price * 0.01,
|
||||||
datas?.currency_code,
|
datas?.currency_code,
|
||||||
@@ -34,62 +43,68 @@ export default function AvailableJobsCard({
|
|||||||
<>
|
<>
|
||||||
{contentDisplay == "grid" ? (
|
{contentDisplay == "grid" ? (
|
||||||
<div
|
<div
|
||||||
className={`card-style-two w-full h-[426px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
className={`card-style-two w-full p-[10px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
||||||
className || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setMarketPopUp({ show: true, data: datas });
|
datas.market_uid != uid ? setMarketPopUp({ show: true, data: datas }) :setJobPopout({ show: true, data: datas });
|
||||||
}}
|
}}
|
||||||
className="flex flex-col justify-between w-full h-full"
|
className="flex flex-col gap-2 justify-between w-full h-full"
|
||||||
>
|
>
|
||||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
<div className='w-full flex items-center gap-4'>
|
||||||
{datas.title}
|
<div className='min-w-[60px] min-h-[60px] max-w-[60px] max-h-[60px] rounded-full overflow-hidden'>
|
||||||
</h1>
|
<img className='w-full h-full object-cover' src={image} alt='Job Image' />
|
||||||
|
|
||||||
<div className="card-two-info flex justify-between items-center">
|
|
||||||
<div className="owned-by flex space-x-2 items-center">
|
|
||||||
<div>
|
|
||||||
<p className="text-thin-light-gray text-sm leading-3">
|
|
||||||
Added
|
|
||||||
</p>
|
|
||||||
<p className="text-base text-dark-gray dark:text-white">
|
|
||||||
{new Date(datas.offer_added).toLocaleDateString()}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
|
<div className='w-full'>
|
||||||
<div className="created-by flex space-x-2 items-center flex-row-reverse">
|
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||||
<div>
|
{datas.title}
|
||||||
<p className="text-thin-light-gray text-sm leading-3 text-right">
|
</h1>
|
||||||
Expires
|
|
||||||
</p>
|
<div className="card-two-info flex justify-between items-center">
|
||||||
<p className="text-base text-dark-gray dark:text-white text-right">
|
<div className="owned-by flex space-x-2 items-center">
|
||||||
{new Date(datas.expire).toLocaleDateString()}
|
<div>
|
||||||
</p>
|
<p className="text-thin-light-gray text-sm leading-3">
|
||||||
|
Added
|
||||||
|
</p>
|
||||||
|
<p className="text-base text-dark-gray dark:text-white">
|
||||||
|
{new Date(datas.offer_added).toLocaleDateString()}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="w-[1px] bg-light-purple dark:bg-dark-light-purple h-7"></div>
|
||||||
|
<div className="created-by flex space-x-2 items-center flex-row-reverse">
|
||||||
|
<div>
|
||||||
|
<p className="text-thin-light-gray text-sm leading-3 text-right">
|
||||||
|
Expires
|
||||||
|
</p>
|
||||||
|
<p className="text-base text-dark-gray dark:text-white text-right">
|
||||||
|
{new Date(datas.expire).toLocaleDateString()}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="thumbnail-area w-full">
|
<div className="thumbnail-area w-full">
|
||||||
<div
|
<div
|
||||||
className="w-full h-[236px] p-6 rounded-xl overflow-hidden bg-center bg-cover bg-no-repeat"
|
className="w-full p-1 h-[150px] rounded-xl overflow-y-auto bg-center bg-cover bg-no-repeat"
|
||||||
style={{
|
// style={{
|
||||||
backgroundImage: `url('${image}')`,
|
// backgroundImage: `url('${image}')`,
|
||||||
}}
|
// }}
|
||||||
>
|
>
|
||||||
<div className="flex justify-center bg-slate-100 p-2 rounded-md">
|
<div className="flex flex-col min-h-full bg-slate-100 p-2 rounded-md">
|
||||||
{datas.description}
|
<p>{datas.description}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="details-area">
|
<div className="details-area">
|
||||||
<div className="product-two-options flex justify-between mb-5 relative"></div>
|
{/* <div className="product-two-options flex justify-between mb-5 relative"></div> */}
|
||||||
|
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<div>
|
<div>
|
||||||
<p className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white">
|
<p className="w-full font-bold text-xl tracking-wide text-dark-gray dark:text-white">
|
||||||
{/* {thePrice} | {datas.timeline_days} day(s) */}
|
{/* {thePrice} | {datas.timeline_days} day(s) */}
|
||||||
{thePrice}
|
{thePrice}
|
||||||
</p>
|
</p>
|
||||||
@@ -102,15 +117,27 @@ export default function AvailableJobsCard({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
{datas.market_uid != uid ?
|
||||||
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
|
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
|
||||||
|
onClick={() => {
|
||||||
|
setMarketPopUp({ show: true, data: datas });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
View
|
||||||
|
</button>
|
||||||
|
:
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="px-4 py-2.5 text-white text-sm bg-yellow-500 rounded-full tracking-wide"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setMarketPopUp({ show: true, data: datas });
|
setJobPopout({ show: true, data: datas });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
View
|
Manage
|
||||||
</button>
|
</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -125,7 +152,7 @@ export default function AvailableJobsCard({
|
|||||||
<div className="flex flex-col flex-[0.9]">
|
<div className="flex flex-col flex-[0.9]">
|
||||||
<h1
|
<h1
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setMarketPopUp({ show: true, data: datas });
|
datas.market_uid != uid ? setMarketPopUp({ show: true, data: datas }) :setJobPopout({ show: true, data: datas })
|
||||||
}}
|
}}
|
||||||
className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize"
|
className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize"
|
||||||
>
|
>
|
||||||
@@ -134,7 +161,7 @@ export default function AvailableJobsCard({
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setMarketPopUp({ show: true, data: datas });
|
datas.market_uid != uid ? setMarketPopUp({ show: true, data: datas }) :setJobPopout({ show: true, data: datas })
|
||||||
}}
|
}}
|
||||||
className="my-2"
|
className="my-2"
|
||||||
>
|
>
|
||||||
@@ -162,8 +189,9 @@ export default function AvailableJobsCard({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="">
|
||||||
|
{datas.market_uid != uid ?
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
|
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setMarketPopUp({ show: true, data: datas });
|
setMarketPopUp({ show: true, data: datas });
|
||||||
@@ -171,6 +199,17 @@ export default function AvailableJobsCard({
|
|||||||
>
|
>
|
||||||
View
|
View
|
||||||
</button>
|
</button>
|
||||||
|
:
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="px-4 py-2.5 text-white text-sm bg-yellow-500 rounded-full tracking-wide"
|
||||||
|
onClick={() => {
|
||||||
|
setJobPopout({ show: true, data: datas });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Manage
|
||||||
|
</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -183,6 +222,18 @@ export default function AvailableJobsCard({
|
|||||||
situation={marketPopUp.show}
|
situation={marketPopUp.show}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* Active Job Popout */}
|
||||||
|
{jobPopout.show && (
|
||||||
|
<PendingJobsPopout
|
||||||
|
details={datas}
|
||||||
|
onClose={() => {
|
||||||
|
setJobPopout({ show: false, data: {} });
|
||||||
|
}}
|
||||||
|
situation={jobPopout.show}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{/* End of Active Job Popout */}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,346 @@
|
|||||||
|
import React, {
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useMemo,
|
||||||
|
useState,
|
||||||
|
} from "react";
|
||||||
|
import { Link, useOutletContext } from "react-router-dom";
|
||||||
|
import usersService from "../../services/UsersService";
|
||||||
|
import Icons from "../Helpers/Icons";
|
||||||
|
import InputCom from "../Helpers/Inputs/InputCom";
|
||||||
|
import ModalCom from "../Helpers/ModalCom";
|
||||||
|
import Layout from "../Partials/Layout";
|
||||||
|
import FamilyTableSettings from "./FamilyTableSettings";
|
||||||
|
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||||
|
|
||||||
|
export default function FamilyListSettings() {
|
||||||
|
|
||||||
|
const {loader, setLoader, familyList, setListReload} = useOutletContext() // CONTEXT VALUES FROM OUTLET TO CHILD
|
||||||
|
|
||||||
|
// State to store the selected year and month
|
||||||
|
const [selectedYear, setSelectedYear] = useState("");
|
||||||
|
const [selectedMonth, setSelectedMonth] = useState("");
|
||||||
|
// const [familyList, setFamilyList] = useState({});
|
||||||
|
// const [loader, setLoader] = useState(false);
|
||||||
|
const [popUp, setPopUp] = useState(false);
|
||||||
|
// const [listReload, setListReload] = useState(false);
|
||||||
|
const [msgErr, setMsgErr] = useState("");
|
||||||
|
const [formData, setFormData] = useState({
|
||||||
|
first_name: "",
|
||||||
|
last_name: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const apiCall = useMemo(() => new usersService(), []);
|
||||||
|
|
||||||
|
const popUpHandler = () => {
|
||||||
|
setPopUp((prev) => !prev);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Handle year selection
|
||||||
|
const handleYearChange = (e) => {
|
||||||
|
setSelectedYear(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Handle month selection
|
||||||
|
const handleMonthChange = (e) => {
|
||||||
|
setSelectedMonth(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleInputChange = (event) => {
|
||||||
|
const { name, value } = event?.target;
|
||||||
|
setFormData((prevFormData) => ({ ...prevFormData, [name]: value }));
|
||||||
|
};
|
||||||
|
|
||||||
|
// use the useEffect hook to clear the selected month if the year changes (to ensure consistency)
|
||||||
|
useEffect(() => {
|
||||||
|
if (selectedYear === "" && selectedMonth !== "") {
|
||||||
|
setSelectedMonth("");
|
||||||
|
}
|
||||||
|
}, [selectedYear]);
|
||||||
|
|
||||||
|
const addMember = async () => {
|
||||||
|
const { first_name, last_name } = formData;
|
||||||
|
setLoader(true);
|
||||||
|
try {
|
||||||
|
if (first_name !== "" && last_name !== "") {
|
||||||
|
const reqData = {
|
||||||
|
firstname: first_name,
|
||||||
|
lastname: last_name,
|
||||||
|
year: +selectedYear,
|
||||||
|
month: +selectedMonth,
|
||||||
|
};
|
||||||
|
|
||||||
|
const res = await apiCall.addFamily(reqData);
|
||||||
|
const { data } = res;
|
||||||
|
|
||||||
|
if (data?.internal_return > 0 && data?.status === "OK") {
|
||||||
|
setLoader(false);
|
||||||
|
setListReload((prev) => !prev);
|
||||||
|
popUpHandler();
|
||||||
|
} else {
|
||||||
|
setLoader(false);
|
||||||
|
setMsgErr("Sorry, something went wrong");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setLoader(false);
|
||||||
|
setMsgErr("Please fill in the fields");
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
setLoader(false);
|
||||||
|
setMsgErr("An error occurred");
|
||||||
|
throw new Error(error);
|
||||||
|
} finally {
|
||||||
|
setTimeout(() => {
|
||||||
|
setMsgErr(null);
|
||||||
|
}, Number(process.env.REACT_APP_LOGIN_ERROR_TIMEOUT));
|
||||||
|
setFormData({
|
||||||
|
first_name: "",
|
||||||
|
last_name: "",
|
||||||
|
});
|
||||||
|
setSelectedMonth("");
|
||||||
|
setSelectedYear("");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// const memberList = useCallback(async () => {
|
||||||
|
// setLoader(true);
|
||||||
|
// try {
|
||||||
|
// const res = await apiCall.familyListings();
|
||||||
|
// const { data } = res;
|
||||||
|
// if (data?.internal_return >= 0 && data?.status === "OK") {
|
||||||
|
// const { result_list, session_image_server } = data;
|
||||||
|
// setFamilyList({ result_list, session_image_server });
|
||||||
|
// sessionStorage.setItem("family_list", JSON.stringify(result_list))
|
||||||
|
// setLoader(false);
|
||||||
|
// } else {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// } catch (error) {
|
||||||
|
// setLoader(false);
|
||||||
|
// throw new Error(error);
|
||||||
|
// }
|
||||||
|
// }, [apiCall]);
|
||||||
|
|
||||||
|
// useEffect(() => {
|
||||||
|
// let checkMemberList = true;
|
||||||
|
// if (checkMemberList) {
|
||||||
|
// memberList();
|
||||||
|
// }
|
||||||
|
// return () => {
|
||||||
|
// checkMemberList = false;
|
||||||
|
// };
|
||||||
|
// }, [listReload, memberList]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/*<CommonHead />*/}
|
||||||
|
<div className="notification-page w-full">
|
||||||
|
<div className="notification-wrapper w-full">
|
||||||
|
<FamilyTableSettings
|
||||||
|
familyList={familyList?.result_list}
|
||||||
|
loader={loader}
|
||||||
|
popUpHandler={popUpHandler}
|
||||||
|
imageServer={familyList?.session_image_server}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{popUp && (
|
||||||
|
<ModalCom action={popUpHandler} situation={popUp}>
|
||||||
|
<FamilyForm
|
||||||
|
popUpHandler={popUpHandler}
|
||||||
|
value={formData}
|
||||||
|
selectedYear={selectedYear}
|
||||||
|
selectedMonth={selectedMonth}
|
||||||
|
monthHandler={handleMonthChange}
|
||||||
|
yearHandler={handleYearChange}
|
||||||
|
inputHandler={handleInputChange}
|
||||||
|
msgErr={msgErr}
|
||||||
|
onClick={addMember}
|
||||||
|
loader={loader}
|
||||||
|
/>
|
||||||
|
</ModalCom>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const FamilyForm = ({
|
||||||
|
value: { first_name, last_name },
|
||||||
|
ageValue,
|
||||||
|
inputHandler,
|
||||||
|
selectedMonth,
|
||||||
|
selectedYear,
|
||||||
|
monthHandler,
|
||||||
|
yearHandler,
|
||||||
|
msgErr,
|
||||||
|
loader,
|
||||||
|
onClick,
|
||||||
|
popUpHandler,
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<div className="logout-modal-wrapper w-11/12 lg:w-[460px] bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
|
<div className="modal-header-con">
|
||||||
|
<h1 className="modal-title">
|
||||||
|
Add Members
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="modal-close-btn"
|
||||||
|
onClick={popUpHandler}
|
||||||
|
>
|
||||||
|
<CloseIcon />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<form className="logout-modal-body w-full flex flex-col items-center px-10 py-8 gap-4">
|
||||||
|
<InputCom
|
||||||
|
placeholder="Firstname"
|
||||||
|
label="First Name:"
|
||||||
|
name="first_name"
|
||||||
|
type="text"
|
||||||
|
parentClass="flex items-center gap-1 w-full"
|
||||||
|
labelClass="flex-[0.4] mb-0"
|
||||||
|
inputClass="flex-[0.6] input-curve lg border border-[#dce4e9]"
|
||||||
|
fieldClass="px-2"
|
||||||
|
value={first_name}
|
||||||
|
inputHandler={inputHandler}
|
||||||
|
/>
|
||||||
|
<InputCom
|
||||||
|
placeholder="Lastname"
|
||||||
|
label="Last Name:"
|
||||||
|
name="last_name"
|
||||||
|
type="text"
|
||||||
|
parentClass="flex items-center gap-1 w-full"
|
||||||
|
labelClass="flex-[0.4] mb-0"
|
||||||
|
inputClass="flex-[0.6] input-curve lg border border-[#dce4e9]"
|
||||||
|
fieldClass="px-2"
|
||||||
|
value={last_name}
|
||||||
|
inputHandler={inputHandler}
|
||||||
|
/>
|
||||||
|
<div className="input-com mb-7 flex flex-col gap-1 w-full">
|
||||||
|
{/* Age dropdown */}
|
||||||
|
<div className="">
|
||||||
|
<label
|
||||||
|
className="job-label"
|
||||||
|
htmlFor="age-selection"
|
||||||
|
>
|
||||||
|
Birthday: (Year/Month)
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<YearMonthDropdowns
|
||||||
|
handleMonthChange={monthHandler}
|
||||||
|
handleYearChange={yearHandler}
|
||||||
|
selectedMonth={selectedMonth}
|
||||||
|
selectedYear={selectedYear}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{msgErr && (
|
||||||
|
<div className="relative p-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-xs font-light leading-[19.5px]">
|
||||||
|
{msgErr}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="signin-area w-full">
|
||||||
|
<div className="flex justify-center">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={onClick}
|
||||||
|
// className={`rounded-[0.475rem] text-white flex justify-center bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center h-[42px] py-[0.8875rem] px-[1.81rem] text-[14.95px] btn-login`}
|
||||||
|
className="text-white btn-gradient text-lg tracking-wide px-6 py-2 rounded-full"
|
||||||
|
>
|
||||||
|
{loader ? (
|
||||||
|
<div className="signup btn-loader"></div>
|
||||||
|
) : (
|
||||||
|
<span>Add</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const CloseIcon = () => (
|
||||||
|
<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>
|
||||||
|
);
|
||||||
|
|
||||||
|
function YearMonthDropdowns({
|
||||||
|
selectedMonth,
|
||||||
|
selectedYear,
|
||||||
|
handleMonthChange,
|
||||||
|
handleYearChange,
|
||||||
|
}) {
|
||||||
|
// Get the current year
|
||||||
|
const currentYear = new Date().getFullYear();
|
||||||
|
|
||||||
|
// Generate an array of years from the current year to (currentYear - 19)
|
||||||
|
const years = Array.from({ length: 17 }, (_, index) => currentYear - index);
|
||||||
|
|
||||||
|
// Array of month names
|
||||||
|
const months = [
|
||||||
|
"January",
|
||||||
|
"February",
|
||||||
|
"March",
|
||||||
|
"April",
|
||||||
|
"May",
|
||||||
|
"June",
|
||||||
|
"July",
|
||||||
|
"August",
|
||||||
|
"September",
|
||||||
|
"October",
|
||||||
|
"November",
|
||||||
|
"December",
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex max-w-[330px] w-full self-end gap-4">
|
||||||
|
<select
|
||||||
|
id="yearDropdown"
|
||||||
|
value={selectedYear}
|
||||||
|
onChange={handleYearChange}
|
||||||
|
className="input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-56 rounded-[35px] h-10 overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base focus-visible:border-transparent focus-visible:outline-0 focus-visible:ring-transparent px-4"
|
||||||
|
// size="5"
|
||||||
|
>
|
||||||
|
<option value="">Select a Year</option>
|
||||||
|
{years.map((year) => (
|
||||||
|
<option key={year} value={year}>
|
||||||
|
{year}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select
|
||||||
|
id="monthDropdown"
|
||||||
|
value={selectedMonth}
|
||||||
|
onChange={handleMonthChange}
|
||||||
|
className="input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-56 rounded-[35px] h-10 overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base focus-visible:border-transparent focus-visible:outline-0 focus-visible:ring-transparent px-4"
|
||||||
|
// size="5"
|
||||||
|
>
|
||||||
|
<option value="">Select a Month</option>
|
||||||
|
{months.map((month, index) => (
|
||||||
|
<option key={month} value={index + 1}>
|
||||||
|
{month}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { Suspense, useEffect, useState } from "react";
|
import React, { Suspense, useEffect, useState } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation, useOutletContext } from "react-router-dom";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import { tableReload } from "../../../store/TableReloads";
|
import { tableReload } from "../../../store/TableReloads";
|
||||||
import ModalCom from "../../Helpers/ModalCom";
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
@@ -22,8 +22,12 @@ const AssignTaskPopout = ({
|
|||||||
jobList,
|
jobList,
|
||||||
activeTask,
|
activeTask,
|
||||||
setActiveTask,
|
setActiveTask,
|
||||||
setUpdatePage,
|
setUpdatePage,
|
||||||
|
familyList
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
|
const newJobList = {...jobList, data:jobList?.data?.filter(item => item?.job_mode == 'FAMILY')}
|
||||||
|
|
||||||
const {parentAssignJobToKid} = SocketValues()
|
const {parentAssignJobToKid} = SocketValues()
|
||||||
|
|
||||||
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||||
@@ -44,9 +48,9 @@ const AssignTaskPopout = ({
|
|||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const getFamilySession = JSON.parse(sessionStorage.getItem("family_list"));
|
// const getFamilySession = JSON.parse(sessionStorage.getItem("family_list"));
|
||||||
|
|
||||||
const familyList = getFamilySession?.map((member) => (
|
const famList = familyList?.map((member) => (
|
||||||
<option key={member?.family_uid} value={member?.family_uid}>
|
<option key={member?.family_uid} value={member?.family_uid}>
|
||||||
{member?.firstname} {member?.lastname}
|
{member?.firstname} {member?.lastname}
|
||||||
</option>
|
</option>
|
||||||
@@ -332,7 +336,7 @@ const AssignTaskPopout = ({
|
|||||||
<option value="" className="">
|
<option value="" className="">
|
||||||
Select a kid
|
Select a kid
|
||||||
</option>
|
</option>
|
||||||
{familyList}
|
{famList}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -386,7 +390,7 @@ const AssignTaskPopout = ({
|
|||||||
<div className="contents">
|
<div className="contents">
|
||||||
{assignType == 'task' ?
|
{assignType == 'task' ?
|
||||||
<AssignPrevNewTask
|
<AssignPrevNewTask
|
||||||
jobList={jobList}
|
jobList={newJobList}
|
||||||
requestStatus={requestStatus}
|
requestStatus={requestStatus}
|
||||||
assignFamilyTask={assignFamilyTask}
|
assignFamilyTask={assignFamilyTask}
|
||||||
taskType={taskType}
|
taskType={taskType}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import React, {useState, useEffect} from "react";
|
||||||
|
import { Outlet } from "react-router-dom";
|
||||||
|
import Layout from "../Partials/Layout";
|
||||||
|
import usersService from "../../services/UsersService";
|
||||||
|
|
||||||
|
|
||||||
|
export default function FamilyRoutes() {
|
||||||
|
|
||||||
|
const apiCall = new usersService();
|
||||||
|
|
||||||
|
const [loader, setLoader] = useState(false);
|
||||||
|
|
||||||
|
const [familyList, setFamilyList] = useState({});
|
||||||
|
|
||||||
|
const [listReload, setListReload] = useState(false);
|
||||||
|
|
||||||
|
const memberList = async () => {
|
||||||
|
setLoader(true);
|
||||||
|
try {
|
||||||
|
const res = await apiCall.familyListings();
|
||||||
|
const { data } = res;
|
||||||
|
if (data?.internal_return >= 0 && data?.status === "OK") {
|
||||||
|
const { result_list, session_image_server } = data;
|
||||||
|
setFamilyList({ result_list, session_image_server });
|
||||||
|
sessionStorage.setItem("family_list", JSON.stringify(result_list))
|
||||||
|
setLoader(false);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
setLoader(false);
|
||||||
|
throw new Error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
memberList();
|
||||||
|
}, [listReload]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Outlet context={{loader, setLoader, familyList, setListReload}} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,8 +1,15 @@
|
|||||||
import React from 'react'
|
import React, {Suspense, lazy} from 'react'
|
||||||
|
// import FamilyList from '../../FamilyList'
|
||||||
|
import LoadingSpinner from '../../../../components/Spinners/LoadingSpinner'
|
||||||
|
|
||||||
const AddFamily = () => {
|
const AddFamily = () => {
|
||||||
|
const FamilyListSettings = lazy(() => import('../../FamilyListSettings'));
|
||||||
return (
|
return (
|
||||||
<div>Add Family</div>
|
<>
|
||||||
|
<Suspense fallback={<LoadingSpinner color="sky-blue" size="16" height='h-full min-h-[500px]' />}>
|
||||||
|
<FamilyListSettings />
|
||||||
|
</Suspense>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
import React, { Suspense, useEffect, useState } from "react";
|
||||||
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import { useLocation, useOutletContext } from "react-router-dom";
|
||||||
|
import usersService from "../../../../services/UsersService";
|
||||||
|
import ModalCom from '../../../Helpers/ModalCom';
|
||||||
|
import LoadingSpinner from "../../../Spinners/LoadingSpinner";
|
||||||
|
import localImgLoad from '../../../../lib/localImgLoad'
|
||||||
|
|
||||||
|
// import { tableReload } from "../../../store/TableReloads";
|
||||||
|
// import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
||||||
|
|
||||||
|
|
||||||
|
const RelativePopout = ({
|
||||||
|
relativeSelected,
|
||||||
|
action,
|
||||||
|
situation,
|
||||||
|
familyList
|
||||||
|
}) => {
|
||||||
|
|
||||||
|
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||||
|
|
||||||
|
const {userDetails} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
||||||
|
|
||||||
|
const apiCall = new usersService();
|
||||||
|
|
||||||
|
let { pathname, state } = useLocation();
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
},[])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ModalCom action={action} situation={situation}>
|
||||||
|
<div className="modal-container">
|
||||||
|
<div className="modal-header-con">
|
||||||
|
<h1 className="modal-title">
|
||||||
|
{relativeSelected.firstname && relativeSelected.firstname} {relativeSelected.lastname && relativeSelected.lastname}
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="modal-close-btn"
|
||||||
|
onClick={action}
|
||||||
|
>
|
||||||
|
<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="modal-body-wrapper">
|
||||||
|
<div className="w-full grid grid-cols-2 gap-2 space-x-2">
|
||||||
|
<div className='col-span-2 md:col-span-1 overflow-y-auto h-[350px]'>
|
||||||
|
{familyList.loader ?
|
||||||
|
<LoadingSpinner size='10' color='bg-sky-500' height='min-h-40' />
|
||||||
|
: (!familyList.loader && familyList?.familyList?.result_list?.length > 0) ?
|
||||||
|
familyList?.familyList?.result_list?.map(item => {
|
||||||
|
const image = localStorage.getItem("session_token") ? `${familyList?.imageServer}${localStorage.getItem("session_token")}/family/${item?.family_uid}` : "";
|
||||||
|
return (
|
||||||
|
<div key={item.family_uid || index} className="flex items-center border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||||
|
<div className='p-2 flex justify-center items-center'>
|
||||||
|
<input type="checkbox" className='w-4 h-4 border-2 border-blue-500 rounded-sm bg-white cursor-pointer' />
|
||||||
|
</div>
|
||||||
|
<div className='p-2'>
|
||||||
|
<div className="flex space-x-2 items-center w-full">
|
||||||
|
<div className="min-w-[30px] min-h-[30px] max-w-[30px] max-h-[30px] rounded-full overflow-hidden flex justify-center items-center">
|
||||||
|
<img
|
||||||
|
src={image || localImgLoad(`images/icons/${banner}`)}
|
||||||
|
alt={`Avatar`}
|
||||||
|
className="w-full h-full"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-col w-full">
|
||||||
|
<h1 className="font-bold text-[16px] text-dark-gray dark:text-white whitespace-nowrap">
|
||||||
|
{`${item?.firstname} ${item?.lastname}`}
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
:
|
||||||
|
<div className='min-h-[100px] w-full flex flex-col justify-center items-center'>No records found!</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div className='col-span-2 md:col-span-1 bg-green-100 min-h-[100px]'>
|
||||||
|
{/* dummy to be filled latter*/}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="modal-footer-wrapper justify-end">
|
||||||
|
<button
|
||||||
|
onClick={action}
|
||||||
|
className="custom-btn border-gradient"
|
||||||
|
>
|
||||||
|
<span className='text-gradient'>Close</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ModalCom>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RelativePopout;
|
||||||
@@ -2,7 +2,9 @@ import React, { useState } from 'react'
|
|||||||
import { handlePagingFunc } from '../../../Pagination/HandlePagination';
|
import { handlePagingFunc } from '../../../Pagination/HandlePagination';
|
||||||
import PaginatedList from '../../../Pagination/PaginatedList';
|
import PaginatedList from '../../../Pagination/PaginatedList';
|
||||||
|
|
||||||
export default function RelativeTable({relativeList}) {
|
import RelativePopout from './RelativePopout';
|
||||||
|
|
||||||
|
export default function RelativeTable({relativeList, familyList}) {
|
||||||
|
|
||||||
// Handle Pagination
|
// Handle Pagination
|
||||||
const [currentPage, setCurrentPage] = useState(0);
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
@@ -10,21 +12,36 @@ export default function RelativeTable({relativeList}) {
|
|||||||
const indexOfLastItem =Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
const indexOfLastItem =Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||||
|
|
||||||
const currentRelativeList = relativeList?.slice(indexOfFirstItem, indexOfLastItem);
|
const currentRelativeList = relativeList?.slice(indexOfFirstItem, indexOfLastItem);
|
||||||
|
|
||||||
|
const [relativePopout, setRelativePopout] = useState({show:false, data:null})
|
||||||
|
|
||||||
|
const closePopout = () => {
|
||||||
|
setRelativePopout({show:false, data:null})
|
||||||
|
}
|
||||||
|
|
||||||
const handlePagination = (e) => {
|
const handlePagination = (e) => {
|
||||||
handlePagingFunc(e, setCurrentPage);
|
handlePagingFunc(e, setCurrentPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
<div className={`w-full overflow-hidden rounded-2xl`}>
|
<div className={`w-full overflow-hidden rounded-2xl`}>
|
||||||
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between min-h-[400px]">
|
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between min-h-[400px]">
|
||||||
<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">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th className='py-4 px-2'></th>
|
||||||
|
<th className='py-4 px-2'></th>
|
||||||
|
<th className='py-4 px-2 text-center'>Kids</th>
|
||||||
|
<th className='py-4 px-2'></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<>
|
<>
|
||||||
{relativeList && relativeList?.length > 0 ? (
|
{relativeList && relativeList?.length > 0 ? (
|
||||||
currentRelativeList.map((value, index) => (
|
currentRelativeList.map((value, index) => (
|
||||||
<tr key={value.uid || index} className="border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
<tr key={value.uid || index} className="border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||||
<td className='p-2'>
|
<td className='py-4 px-2'>
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
||||||
{value.firstname && value.firstname} {value.lastname && value.lastname}
|
{value.firstname && value.firstname} {value.lastname && value.lastname}
|
||||||
@@ -34,13 +51,34 @@ export default function RelativeTable({relativeList}) {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className='p-2'>
|
<td className='py-4 px-2'>
|
||||||
{/* <span>Family Type</span> */}
|
{/* <span>Family Type</span> */}
|
||||||
<span>{value.family_type && value.family_type.toUpperCase()}</span>
|
<span>{value.family_type && value.family_type.toUpperCase()}</span>
|
||||||
</td>
|
</td>
|
||||||
<td className='p-2 text-right'>
|
<td className='py-4 px-2 text-center'>
|
||||||
{value.status && value.status}
|
{value.status && value.status}
|
||||||
</td>
|
</td>
|
||||||
|
<td className='py-4 px-2 flex items-center justify-end'>
|
||||||
|
<button
|
||||||
|
onClick={() => setRelativePopout({show:true, data:{relativeSelected:value}})}
|
||||||
|
type="button"
|
||||||
|
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>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
@@ -69,5 +107,15 @@ export default function RelativeTable({relativeList}) {
|
|||||||
{/* END OF PAGINATION BUTTON */}
|
{/* END OF PAGINATION BUTTON */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{relativePopout.show &&
|
||||||
|
<RelativePopout
|
||||||
|
situation={relativePopout.show}
|
||||||
|
action={closePopout}
|
||||||
|
relativeSelected={relativePopout.data.relativeSelected}
|
||||||
|
familyList={familyList}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import InviteRelative from './InviteRelative'
|
|||||||
import usersService from '../../../../services/UsersService'
|
import usersService from '../../../../services/UsersService'
|
||||||
import LoadingSpinner from '../../../Spinners/LoadingSpinner'
|
import LoadingSpinner from '../../../Spinners/LoadingSpinner'
|
||||||
|
|
||||||
const Relatives = () => {
|
const Relatives = ({familyList}) => {
|
||||||
|
|
||||||
const api = new usersService()
|
const api = new usersService()
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ const Relatives = () => {
|
|||||||
{relativeList.loading ?
|
{relativeList.loading ?
|
||||||
<LoadingSpinner size='8' height='h-full' />
|
<LoadingSpinner size='8' height='h-full' />
|
||||||
:
|
:
|
||||||
<RelativeTable relativeList={relativeList.result_list} />
|
<RelativeTable relativeList={relativeList.result_list} familyList={familyList} />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Link, useLocation } from "react-router-dom";
|
import { Link, useLocation, useOutletContext } from "react-router-dom";
|
||||||
import CustomBreadcrumb from "../../Breadcrumb/CustomBreadcrumb";
|
import CustomBreadcrumb from "../../Breadcrumb/CustomBreadcrumb";
|
||||||
import Icons from "../../Helpers/Icons";
|
import Icons from "../../Helpers/Icons";
|
||||||
import Layout from "../../Partials/Layout";
|
import Layout from "../../Partials/Layout";
|
||||||
import { AddFamily, FamilyBanner, Relatives } from "./Tabs";
|
import { AddFamily, FamilyBanner, Relatives } from "./Tabs";
|
||||||
|
|
||||||
const FamilySettings = () => {
|
const FamilySettings = () => {
|
||||||
|
|
||||||
|
const {loader, setLoader, familyList, setListReload} = useOutletContext() // CONTEXT VALUES FROM OUTLET TO CHILD
|
||||||
|
|
||||||
let { state } = useLocation();
|
let { state } = useLocation();
|
||||||
|
|
||||||
|
const imageServer = state?.imageServer
|
||||||
|
|
||||||
|
let relativeFamilyList = {loader, familyList, imageServer}
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@@ -44,7 +52,7 @@ const FamilySettings = () => {
|
|||||||
|
|
||||||
const tabComponents = {
|
const tabComponents = {
|
||||||
add_family: <AddFamily />,
|
add_family: <AddFamily />,
|
||||||
relatives: <Relatives />,
|
relatives: <Relatives familyList={relativeFamilyList} />,
|
||||||
family_banner: <FamilyBanner imageServer={state.imageServer} />,
|
family_banner: <FamilyBanner imageServer={state.imageServer} />,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ export default function FamilyTable({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`update-table w-full h-full p-4 bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow min-h-[520px] flex flex-col justify-between ${
|
className={`update-table w-full h-full p-4 bg-white dark:bg-dark-white overflow-y-auto rounded-2xl min-h-[520px] flex flex-col justify-between ${
|
||||||
className || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { Suspense, lazy, useEffect, useMemo, useState } from "react";
|
import React, { Suspense, lazy, useEffect, useMemo, useState } from "react";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation, useOutletContext } from "react-router-dom";
|
||||||
import { apiConst } from "../../lib/apiConst";
|
import { apiConst } from "../../lib/apiConst";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
@@ -13,6 +13,8 @@ const FamilyPending = lazy(() => import("./Tabs/FamilyNewPending"));
|
|||||||
|
|
||||||
export default function FamilyTableNew() {
|
export default function FamilyTableNew() {
|
||||||
|
|
||||||
|
const {familyList} = useOutletContext() // CONTEXT VALUES FROM OUTLET TO CHILD
|
||||||
|
|
||||||
const { jobListTable, pendingListTable, parentFamilyTaskList } = useSelector((state) => state.tableReload); // TABLE RELOAD TRIGGERS
|
const { jobListTable, pendingListTable, parentFamilyTaskList } = useSelector((state) => state.tableReload); // TABLE RELOAD TRIGGERS
|
||||||
|
|
||||||
|
|
||||||
@@ -243,6 +245,7 @@ export default function FamilyTableNew() {
|
|||||||
activeTask={activeTask}
|
activeTask={activeTask}
|
||||||
familyDetailsData={''}
|
familyDetailsData={''}
|
||||||
setUpdatePage={setUpdatePage}
|
setUpdatePage={setUpdatePage}
|
||||||
|
familyList={familyList?.result_list}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,244 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
||||||
|
import PaginatedList from "../Pagination/PaginatedList";
|
||||||
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
|
import familyImage from "../../assets/images/no-family-side.png";
|
||||||
|
import { formatDateString } from "../../lib";
|
||||||
|
import localImgLoad from "../../lib/localImgLoad";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders a list of family members that can be managed.
|
||||||
|
* It has its current maximum members at 8 and it comes with pagination and loading spinner functionality.
|
||||||
|
|
||||||
|
* @returns {JSX.Element} - The rendered component.
|
||||||
|
*/
|
||||||
|
export default function FamilyTableSettings({
|
||||||
|
className,
|
||||||
|
familyList,
|
||||||
|
loader,
|
||||||
|
popUpHandler,
|
||||||
|
imageServer,
|
||||||
|
}) {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
|
const itemsPerPage = Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||||
|
const indexOfFirstItem = Number(currentPage);
|
||||||
|
const indexOfLastItem =
|
||||||
|
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||||
|
const currentFamilyList = familyList?.slice(
|
||||||
|
indexOfFirstItem,
|
||||||
|
indexOfLastItem
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleManageClick = (familyMember) => {
|
||||||
|
navigate("/manage-family", { state: familyMember });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePagination = (e) => {
|
||||||
|
handlePagingFunc(e, setCurrentPage);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders a table row for a family member.
|
||||||
|
* @returns {JSX.Element} - The table row component.
|
||||||
|
*/
|
||||||
|
const FamilyRow = ({
|
||||||
|
firstname,
|
||||||
|
lastname,
|
||||||
|
age,
|
||||||
|
added,
|
||||||
|
last_login,
|
||||||
|
task_count,
|
||||||
|
family_uid,
|
||||||
|
banner,
|
||||||
|
enable_traking,
|
||||||
|
profile_picture,
|
||||||
|
imageServer,
|
||||||
|
username,
|
||||||
|
}) => {
|
||||||
|
// Check for valid dates
|
||||||
|
const addedDate = added ? added.split(" ")[0] : "N/A";
|
||||||
|
const loginDate = last_login ? formatDateString(last_login) : "N/A";
|
||||||
|
const key = `family-${family_uid}`; // Assign a unique key
|
||||||
|
const image = localStorage.getItem("session_token")
|
||||||
|
? `${imageServer}${localStorage.getItem(
|
||||||
|
"session_token"
|
||||||
|
)}/family/${family_uid}`
|
||||||
|
: "";
|
||||||
|
|
||||||
|
const trackingStatus =
|
||||||
|
enable_traking === "0"
|
||||||
|
? "Stopped"
|
||||||
|
: enable_traking === "100"
|
||||||
|
? "Active"
|
||||||
|
: "";
|
||||||
|
|
||||||
|
return (
|
||||||
|
<tr
|
||||||
|
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
||||||
|
key={key}
|
||||||
|
>
|
||||||
|
<td className="py-4">
|
||||||
|
<div className="flex space-x-2 items-center w-full">
|
||||||
|
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
|
||||||
|
<img
|
||||||
|
// src={profile_picture}
|
||||||
|
src={
|
||||||
|
image ||
|
||||||
|
profile_picture ||
|
||||||
|
localImgLoad(`images/icons/${banner}`)
|
||||||
|
}
|
||||||
|
alt={`Avatar of ${firstname} ${lastname}`}
|
||||||
|
className="w-full h-full"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-col flex-[0.9]">
|
||||||
|
<h1 className="font-bold text-lg text-dark-gray dark:text-white whitespace-nowrap">
|
||||||
|
{`${firstname} ${lastname}`}{" "}
|
||||||
|
<span className="ml-1 text-sm">{`[${username}]`}</span>
|
||||||
|
</h1>
|
||||||
|
<span className="text-sm text-thin-light-gray">
|
||||||
|
Added: <span className="text-purple ml-1">{addedDate}</span>
|
||||||
|
</span>
|
||||||
|
<span className="text-sm text-thin-light-gray">
|
||||||
|
Last Login:{" "}
|
||||||
|
<span className="text-purple ml-1">{loginDate}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
{/* <td className="text-center py-4 px-2">
|
||||||
|
<div className="flex space-x-1 items-center justify-center">
|
||||||
|
<span
|
||||||
|
className={`text-base font-medium whitespace-nowrap ${
|
||||||
|
enable_traking === "0"
|
||||||
|
? "text-[#FF0000] dark:text-[#FF6666]"
|
||||||
|
: enable_traking === "100"
|
||||||
|
? "text-[#00A000] dark:text-[#00FF00]"
|
||||||
|
: "text-dark-gray dark:text-white"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{trackingStatus}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td className="text-center py-4 px-2">
|
||||||
|
<div className="flex space-x-1 items-center justify-center">
|
||||||
|
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap">
|
||||||
|
{task_count}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</td> */}
|
||||||
|
|
||||||
|
<td className="text-right py-4 px-2 flex items-center justify-center">
|
||||||
|
<button
|
||||||
|
onClick={() =>
|
||||||
|
handleManageClick({
|
||||||
|
firstname,
|
||||||
|
lastname,
|
||||||
|
age,
|
||||||
|
added,
|
||||||
|
last_login,
|
||||||
|
task_count,
|
||||||
|
family_uid,
|
||||||
|
banner,
|
||||||
|
image,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
type="button"
|
||||||
|
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>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`update-table w-full h-full p-4 bg-white dark:bg-dark-white overflow-y-auto rounded-2xl min-h-[520px] flex flex-col justify-between ${
|
||||||
|
className || ""
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<div className="relative w-full h-full overflow-x-auto sm:rounded-lg">
|
||||||
|
{loader ? (
|
||||||
|
<div className="h-full min-h-[500px] w-full overflow-hidden flex justify-center items-center">
|
||||||
|
<LoadingSpinner size="16" color="sky-blue" height='h-full' />
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{familyList?.length > 0 ? (
|
||||||
|
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
|
||||||
|
<thead className="sticky top-0">
|
||||||
|
<tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-bottom ">
|
||||||
|
<th className="py-4">Name</th>
|
||||||
|
{/* <th className="py-4 text-center">Tracking</th>
|
||||||
|
<th className="py-4 text-center">No of Tasks</th> */}
|
||||||
|
<th className="py-4 text-right"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody className="h-full">
|
||||||
|
{currentFamilyList?.map((familyMember, index) => {
|
||||||
|
return (
|
||||||
|
<FamilyRow
|
||||||
|
key={index}
|
||||||
|
{...familyMember}
|
||||||
|
imageServer={imageServer}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
) : (
|
||||||
|
<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="p-2 w-full md:w-1/2">
|
||||||
|
<p className="mb-4 p-3 md:p-16">
|
||||||
|
Add your family, assign tasks, and get the whole team
|
||||||
|
engaged.
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
onClick={popUpHandler}
|
||||||
|
type="button"
|
||||||
|
className="text-white btn-gradient text-lg tracking-wide px-5 py-2 rounded-full"
|
||||||
|
>
|
||||||
|
Add Family
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="p-2 w-full md:w-1/2">
|
||||||
|
<img className="w-full" src={familyImage} alt="Add Family" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{/* PAGINATION BUTTON */}
|
||||||
|
<PaginatedList
|
||||||
|
onClick={handlePagination}
|
||||||
|
prev={currentPage == 0}
|
||||||
|
next={currentPage + itemsPerPage >= familyList?.length}
|
||||||
|
data={familyList}
|
||||||
|
start={indexOfFirstItem}
|
||||||
|
stop={indexOfLastItem}
|
||||||
|
/>
|
||||||
|
{/* END OF PAGINATION BUTTON */}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -13,6 +13,9 @@ const FamilyAccount = forwardRef(({ familyData, myRef, handlePrint}, ref) => {
|
|||||||
<div className="update-table w-full lg:min-h-[450px] h-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ">
|
<div className="update-table w-full lg:min-h-[450px] h-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ">
|
||||||
<div className="flex items-center justify-around h-[380px]">
|
<div className="flex items-center justify-around h-[380px]">
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
|
<h2 className="print:block hidden font-bold text-lg tracking-wide text-dark-gray dark:text-white capitalize mb-10">
|
||||||
|
Firstname: {familyData?.data?.firstname ? familyData?.data?.firstname : "please wait..."}
|
||||||
|
</h2>
|
||||||
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||||
Username:{" "}
|
Username:{" "}
|
||||||
<span className="ml-2 normal-case">
|
<span className="ml-2 normal-case">
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ const FamilyWaitlist = memo(
|
|||||||
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
||||||
key={value.uid}
|
key={value.uid}
|
||||||
>
|
>
|
||||||
<td className="py-4">
|
<td className="px-2 py-4">
|
||||||
<div className="w-full flex justify-between items-center">
|
<div className="w-full flex justify-between items-center">
|
||||||
<div className="account-name flex space-x-4 items-center">
|
<div className="account-name flex space-x-4 items-center">
|
||||||
<div className="icon w-14 h-14 flex justify-center items-center">
|
<div className="icon w-14 h-14 flex justify-center items-center">
|
||||||
@@ -92,23 +92,40 @@ const FamilyWaitlist = memo(
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="px-2 flex flex-col items-center justify-center">
|
{/* <div className="px-2 flex flex-col items-center justify-center">
|
||||||
{/* <p className="text-sm font-bold text-dark-gray dark:text-white">
|
<p className="text-sm font-bold text-dark-gray dark:text-white">
|
||||||
{addedDate}
|
{addedDate}
|
||||||
</p> */}
|
</p>
|
||||||
<p className="text-xs py-1.5 w-[70px] cursor-default tracking-wide rounded-full bg-gold text-white flex justify-center items-center">
|
<p className="text-xs py-1.5 w-[70px] cursor-default tracking-wide rounded-full bg-gold text-white flex justify-center items-center">
|
||||||
{value.status_text}
|
{value.status_text}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="text-right py-4 px-2">
|
<td className="text-right px-2 py-4">
|
||||||
<button
|
<div className='w-full flex justify-end items-center gap-4'>
|
||||||
onClick={() => openPopUp(value)}
|
<p className="text-xs py-1.5 w-[70px] cursor-default tracking-wide rounded-full bg-gold text-white flex justify-center items-center">
|
||||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
{value.status_text}
|
||||||
>
|
</p>
|
||||||
View
|
<button
|
||||||
</button>
|
onClick={() => openPopUp(value)}
|
||||||
|
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>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import React, {
|
|||||||
useMemo,
|
useMemo,
|
||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link, useOutletContext } from "react-router-dom";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import Icons from "../Helpers/Icons";
|
import Icons from "../Helpers/Icons";
|
||||||
import InputCom from "../Helpers/Inputs/InputCom";
|
import InputCom from "../Helpers/Inputs/InputCom";
|
||||||
@@ -16,13 +16,16 @@ import FamilyTable from "./FamilyTable";
|
|||||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||||
|
|
||||||
export default function FamilyAcc() {
|
export default function FamilyAcc() {
|
||||||
|
|
||||||
|
const {loader, setLoader, familyList, setListReload} = useOutletContext() // CONTEXT VALUES FROM OUTLET TO CHILD
|
||||||
|
|
||||||
// State to store the selected year and month
|
// State to store the selected year and month
|
||||||
const [selectedYear, setSelectedYear] = useState("");
|
const [selectedYear, setSelectedYear] = useState("");
|
||||||
const [selectedMonth, setSelectedMonth] = useState("");
|
const [selectedMonth, setSelectedMonth] = useState("");
|
||||||
const [familyList, setFamilyList] = useState({});
|
// const [familyList, setFamilyList] = useState({});
|
||||||
const [loader, setLoader] = useState(false);
|
// const [loader, setLoader] = useState(false);
|
||||||
const [popUp, setPopUp] = useState(false);
|
const [popUp, setPopUp] = useState(false);
|
||||||
const [listReload, setListReload] = useState(false);
|
// const [listReload, setListReload] = useState(false);
|
||||||
const [msgErr, setMsgErr] = useState("");
|
const [msgErr, setMsgErr] = useState("");
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
first_name: "",
|
first_name: "",
|
||||||
@@ -101,34 +104,34 @@ export default function FamilyAcc() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const memberList = useCallback(async () => {
|
// const memberList = useCallback(async () => {
|
||||||
setLoader(true);
|
// setLoader(true);
|
||||||
try {
|
// try {
|
||||||
const res = await apiCall.familyListings();
|
// const res = await apiCall.familyListings();
|
||||||
const { data } = res;
|
// const { data } = res;
|
||||||
if (data?.internal_return >= 0 && data?.status === "OK") {
|
// if (data?.internal_return >= 0 && data?.status === "OK") {
|
||||||
const { result_list, session_image_server } = data;
|
// const { result_list, session_image_server } = data;
|
||||||
setFamilyList({ result_list, session_image_server });
|
// setFamilyList({ result_list, session_image_server });
|
||||||
sessionStorage.setItem("family_list", JSON.stringify(result_list))
|
// sessionStorage.setItem("family_list", JSON.stringify(result_list))
|
||||||
setLoader(false);
|
// setLoader(false);
|
||||||
} else {
|
// } else {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
setLoader(false);
|
// setLoader(false);
|
||||||
throw new Error(error);
|
// throw new Error(error);
|
||||||
}
|
// }
|
||||||
}, [apiCall]);
|
// }, [apiCall]);
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
let checkMemberList = true;
|
// let checkMemberList = true;
|
||||||
if (checkMemberList) {
|
// if (checkMemberList) {
|
||||||
memberList();
|
// memberList();
|
||||||
}
|
// }
|
||||||
return () => {
|
// return () => {
|
||||||
checkMemberList = false;
|
// checkMemberList = false;
|
||||||
};
|
// };
|
||||||
}, [listReload, memberList]);
|
// }, [listReload, memberList]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
@@ -177,7 +180,7 @@ export default function FamilyAcc() {
|
|||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
to={`/familysettings`}
|
to={`/acc-family/familysettings`}
|
||||||
state={{ imageServer: familyList?.session_image_server }}
|
state={{ imageServer: familyList?.session_image_server }}
|
||||||
className="slider-btns flex space-x-4 w-12 h-12 rounded-md shadow-sm justify-center items-center cursor-pointer dark:bg-[linear-gradient(134.38deg,#f539f8_0%,#c342f9_43.55%,#5356fb_104.51%)] bg-[#76a5df] text-white"
|
className="slider-btns flex space-x-4 w-12 h-12 rounded-md shadow-sm justify-center items-center cursor-pointer dark:bg-[linear-gradient(134.38deg,#f539f8_0%,#c342f9_43.55%,#5356fb_104.51%)] bg-[#76a5df] text-white"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function JobsCompleted() {
|
|||||||
|
|
||||||
const apiCall = new usersService()
|
const apiCall = new usersService()
|
||||||
|
|
||||||
let [familyRewardHistory, setFamilyRewardHistory] = useState({ // FOR PURCHASE HISTORY
|
let [jobHistory, setJobHistory] = useState({ // FOR PURCHASE HISTORY
|
||||||
loading: true,
|
loading: true,
|
||||||
data: [],
|
data: [],
|
||||||
error: false
|
error: false
|
||||||
@@ -22,7 +22,7 @@ function JobsCompleted() {
|
|||||||
const [currentPage, setCurrentPage] = useState(0);
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
const indexOfFirstItem = Number(currentPage);
|
const indexOfFirstItem = Number(currentPage);
|
||||||
const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
const indexOfLastItem = Number(indexOfFirstItem)+Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||||
const currentReward = familyRewardHistory?.data?.slice(indexOfFirstItem, indexOfLastItem);
|
const currentReward = jobHistory?.data?.slice(indexOfFirstItem, indexOfLastItem);
|
||||||
|
|
||||||
const handlePagination = (e) => {
|
const handlePagination = (e) => {
|
||||||
handlePagingFunc(e,setCurrentPage)
|
handlePagingFunc(e,setCurrentPage)
|
||||||
@@ -31,17 +31,17 @@ function JobsCompleted() {
|
|||||||
|
|
||||||
//FUNCTION TO GET FAMILY REWARD HISTORY
|
//FUNCTION TO GET FAMILY REWARD HISTORY
|
||||||
const getJobCompletedHistory = ()=>{
|
const getJobCompletedHistory = ()=>{
|
||||||
// apiCall.getFamilyRewardHx().then((res)=>{
|
apiCall.getContractHx().then((res)=>{
|
||||||
// if(res.data.internal_return < 0){ // success but no data
|
if(res.data.internal_return < 0){ // success but no data
|
||||||
// setFamilyRewardHistory(prev => ({...prev, loading: false}))
|
setJobHistory(prev => ({...prev, loading: false}))
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// setFamilyRewardHistory(prev => ({...prev, loading: false, data: res.data.result_list}))
|
setJobHistory(prev => ({...prev, loading: false, data: res.data.result_list}))
|
||||||
// }).catch((error)=>{
|
}).catch((error)=>{
|
||||||
// setFamilyRewardHistory(prev => ({...prev, loading: false, error: true}))
|
setJobHistory(prev => ({...prev, loading: false, error: true}))
|
||||||
// })
|
})
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
setFamilyRewardHistory(prev => ({...prev, loading: false, error:true}))
|
setJobHistory(prev => ({...prev, loading: false, error:true}))
|
||||||
},3000)
|
},3000)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,42 +51,42 @@ function JobsCompleted() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col justify-between min-h-[500px]'>
|
<div className='flex flex-col justify-between min-h-[500px]'>
|
||||||
{familyRewardHistory.loading ?
|
{jobHistory.loading ?
|
||||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||||
: familyRewardHistory.data.length ?
|
: jobHistory?.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='border-b-2'>
|
<thead className='w-full'>
|
||||||
<tr className='text-slate-600'>
|
<tr className='text-slate-600 dark:text-white'>
|
||||||
<th className="p-2"></th>
|
<th className="p-4">Title</th>
|
||||||
<th className="p-2">Amount</th>
|
<th className="p-4 text-right">Amount</th>
|
||||||
<th className="p-2">Date</th>
|
{/* <th className="p-4">Date</th>
|
||||||
<th className="p-2">Confirmation</th>
|
<th className="p-4">Contract</th> */}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{currentReward.map((item, index) => {
|
{currentReward.map((item, index) => {
|
||||||
let date = new Date(item.added).toLocaleDateString()
|
let date = new Date(item?.delivery_date).toLocaleDateString()
|
||||||
return (
|
return (
|
||||||
<tr key={index} className='text-slate-500'>
|
<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-2">
|
<td className="p-4 w-full">
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<img src={item.icon} className='min-w-[60px] max-w-[60px] min-h-[60px] max-h-[60px] rounded-full bg-slate-500' alt='Reward Logo' />
|
{/* <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'>
|
||||||
<h1 className='text-lg font-bold'>Reward to {item.rec_firstname} {item.rec_lastname}</h1>
|
<h1 className='text-lg font-bold line-clamp-1'>{item?.title}</h1>
|
||||||
<p className='text-sm'>{item.description}</p>
|
<p className='text-sm line-clamp-2'>{item?.description}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-2">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
|
<td className="p-4 text-right">{AmountTo2DP(item?.price*0.01)} {item?.currency}</td>
|
||||||
<td className="p-2">{date}</td>
|
{/* <td className="p-4">{date}</td>
|
||||||
<td className="p-2">{item.confirmation}</td>
|
<td className="p-4">{item?.contract}</td> */}
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
:familyRewardHistory.error ?
|
:jobHistory.error ?
|
||||||
<div className="p-2 text-slate-500 flex flex-col grow justify-center items-center">
|
<div className="p-2 text-slate-500 flex flex-col grow justify-center items-center">
|
||||||
<span>Opps! an error occurred. Please try again!</span>
|
<span>Opps! an error occurred. Please try again!</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -97,7 +97,7 @@ function JobsCompleted() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{/* PAGINATION BUTTON */}
|
{/* PAGINATION BUTTON */}
|
||||||
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= familyRewardHistory?.data?.length ? true : false} data={familyRewardHistory?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
<PaginatedList borderTop={false} onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= jobHistory?.data?.length ? true : false} data={jobHistory?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
||||||
{/* END OF PAGINATION BUTTON */}
|
{/* END OF PAGINATION BUTTON */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -52,20 +52,20 @@ export const RewardsTable = memo(() => {
|
|||||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||||
: familyRewardHistory.data.length ?
|
: familyRewardHistory.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='border-b-2'>
|
<thead className='w-full'>
|
||||||
<tr className='text-slate-600'>
|
<tr className='text-slate-600 dark:text-white'>
|
||||||
<th className="p-2"></th>
|
<th className="p-4"></th>
|
||||||
<th className="p-2">Amount</th>
|
<th className="p-4 text-right">Amount</th>
|
||||||
<th className="p-2">Date</th>
|
<th className="p-4">Date</th>
|
||||||
<th className="p-2">Confirmation</th>
|
<th className="p-4">Confirmation</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{currentReward.map((item, index) => {
|
{currentReward.map((item, index) => {
|
||||||
let date = new Date(item.added).toLocaleDateString()
|
let date = new Date(item.added).toLocaleDateString()
|
||||||
return (
|
return (
|
||||||
<tr key={index} className='text-slate-500'>
|
<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-2">
|
<td className="p-4">
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<img src={item.icon} className='min-w-[60px] max-w-[60px] min-h-[60px] max-h-[60px] rounded-full bg-slate-500' alt='Reward Logo' />
|
<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'>
|
||||||
@@ -74,9 +74,9 @@ export const RewardsTable = memo(() => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-2">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
|
<td className="p-4 text-right">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
|
||||||
<td className="p-2">{date}</td>
|
<td className="p-4">{date}</td>
|
||||||
<td className="p-2">{item.confirmation}</td>
|
<td className="p-4">{item.confirmation}</td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -94,7 +94,7 @@ export const RewardsTable = memo(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{/* PAGINATION BUTTON */}
|
{/* PAGINATION BUTTON */}
|
||||||
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= familyRewardHistory?.data?.length ? true : false} data={familyRewardHistory?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
<PaginatedList borderTop={false} onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= familyRewardHistory?.data?.length ? true : false} data={familyRewardHistory?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
||||||
{/* END OF PAGINATION BUTTON */}
|
{/* END OF PAGINATION BUTTON */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ export default function History() {
|
|||||||
</button>
|
</button>
|
||||||
</div> */}
|
</div> */}
|
||||||
{/* END OF switch button */}
|
{/* END OF switch button */}
|
||||||
<div className="history-tables w-full bg-red-50 overflow-x-auto">
|
<div className="history-tables w-full bg-red-50 dark:bg-dark-white overflow-x-auto">
|
||||||
{/* PURCHASE SECTION */}
|
{/* PURCHASE SECTION */}
|
||||||
{selectedTab == 'purchases' &&
|
{selectedTab == 'purchases' &&
|
||||||
<div className="wallet w-full">
|
<div className="wallet w-full">
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default function MainSection({
|
|||||||
);
|
);
|
||||||
const [tab, setTab] = useState(Object.keys(marketCategories)[0]);
|
const [tab, setTab] = useState(Object.keys(marketCategories)[0]);
|
||||||
|
|
||||||
let [contentDisplay, setContentDisplay] = useState("list"); // STATE TO HOLD LIST VIEW STYLE
|
let [contentDisplay, setContentDisplay] = useState("grid"); // STATE TO HOLD LIST VIEW STYLE
|
||||||
|
|
||||||
// Convert to array in order to map
|
// Convert to array in order to map
|
||||||
const mappedArray = Object.entries(marketCategories).map(([key, value]) => {
|
const mappedArray = Object.entries(marketCategories).map(([key, value]) => {
|
||||||
|
|||||||
@@ -142,8 +142,8 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
<CloseIcon onClose={onClose} />
|
<CloseIcon onClose={onClose} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="md:flex bg-white dark:bg-dark-white text-slate-900 dark:text-white rounded-lg">
|
<div className="md:grid md:grid-cols-4 bg-white dark:bg-dark-white text-slate-900 dark:text-white rounded-lg">
|
||||||
<div className="p-4 w-full md:w-[75%] md:border-r-1">
|
<div className="p-4 w-full md:col-span-3 md:border-r-1">
|
||||||
<div className="min-h-[240px]">
|
<div className="min-h-[240px]">
|
||||||
<h2 className="font-semibold text-slate-900 dark:text-white tracking-wide">
|
<h2 className="font-semibold text-slate-900 dark:text-white tracking-wide">
|
||||||
{details?.title}
|
{details?.title}
|
||||||
@@ -173,11 +173,12 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
{name}
|
{name}
|
||||||
</label>
|
</label>
|
||||||
<div
|
<div
|
||||||
className={`w-full md:w-3/4 text-slate-900 dark:text-white market-pop ${
|
className={`w-full p-2 md:w-3/4 text-slate-900 dark:text-white market-pop ${
|
||||||
name !== "Delivery Detail"
|
name == "Description"
|
||||||
? " h-full flex items-center"
|
? "min-h-[100px] max-h-[100px] h-full overflow-y-auto break-words"
|
||||||
: " overflow-y-auto max-h-[80px]"
|
: name == "Delivery Detail" ? " overflow-y-auto h-full min-h-[100px] max-h-[100px]"
|
||||||
} ${name === "Description" && "max-h-14 h-full overflow-auto"}`}
|
: "h-full flex items-center"
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
{danger ? (
|
{danger ? (
|
||||||
<p
|
<p
|
||||||
@@ -193,12 +194,14 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
{typeof content !== "object" ? content : null}
|
{typeof content !== "object" ? content : null}
|
||||||
{typeof content === "object" && (
|
{typeof content === "object" && (
|
||||||
<>
|
<>
|
||||||
<hr className="mb-1" />
|
{/* <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">
|
<span className="flex items-center gap-2 dark:text-white">
|
||||||
{content?.text}
|
{content?.text}
|
||||||
<strong>{thePrice}</strong>
|
<strong>{thePrice}</strong>
|
||||||
</span>
|
</span>
|
||||||
<hr className="mt-1" />
|
<span className='flex w-full mt-1 h-[1px] bg-slate-500'></span>
|
||||||
|
{/* <hr className="mt-1" /> */}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
@@ -211,7 +214,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr className='my-1' />
|
||||||
<div className="w-full flex flex-col gap-3">
|
<div className="w-full flex flex-col gap-3">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<label className="job-label w-full">
|
<label className="job-label w-full">
|
||||||
@@ -248,11 +251,11 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full md:w-[23%] h-full flex flex-col">
|
<div className="py-2 w-full md:col-span-1 h-full flex flex-col">
|
||||||
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] px-4 rounded-md md:min-h-[420px] flex flex-col justify-between">
|
<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">
|
<div className="w-full flex flex-col justify-center pb-4 gap-2">
|
||||||
<p className="job-label w-full">
|
<p className="job-label w-full">
|
||||||
Interested in the task?
|
Interested?
|
||||||
</p>
|
</p>
|
||||||
<hr />
|
<hr />
|
||||||
<button
|
<button
|
||||||
@@ -261,10 +264,9 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
onClick={ManageInterest}
|
onClick={ManageInterest}
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
<div className="w-full flex flex-col justify-between gap-2">
|
<div className="flex md:flex-col justify-center gap-2">
|
||||||
<span>Send</span>
|
<span>Notify</span>
|
||||||
<span>Interest</span>
|
<span>Owner</span>
|
||||||
<span>Request</span>
|
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import { SocketValues } from "../Contexts/SocketIOContext";
|
|||||||
import TabButton from "../customTabs/TabButton";
|
import TabButton from "../customTabs/TabButton";
|
||||||
import AttachFile from "../attachmentCom/AttachFile";
|
import AttachFile from "../attachmentCom/AttachFile";
|
||||||
|
|
||||||
|
import JobDetailPopout from "./JobDetailPopout";
|
||||||
|
|
||||||
function ActiveJobs(props) {
|
function ActiveJobs(props) {
|
||||||
let {sendMessage, joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
let {sendMessage, joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
||||||
|
|
||||||
@@ -43,6 +45,8 @@ function ActiveJobs(props) {
|
|||||||
|
|
||||||
let [popUp, setPopUp] = useState(false); // STATE FOR POPOUT MODAL
|
let [popUp, setPopUp] = useState(false); // STATE FOR POPOUT MODAL
|
||||||
|
|
||||||
|
let [jobDetailModal, setJobDetailModal] = useState(false); // STATE FOR JOB DELIVERY DETAIL POPOUT MODAL
|
||||||
|
|
||||||
const printRef = useRef();
|
const printRef = useRef();
|
||||||
// to handle printing
|
// to handle printing
|
||||||
const handlePrint = useReactToPrint({
|
const handlePrint = useReactToPrint({
|
||||||
@@ -54,6 +58,10 @@ function ActiveJobs(props) {
|
|||||||
setPopUp((prev) => !prev);
|
setPopUp((prev) => !prev);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const jobDetailModalHandler = () => { // FUNCTION TO CLOSE JOB DELIVERY DETAIL MODAL
|
||||||
|
setJobDetailModal((prev) => !prev);
|
||||||
|
};
|
||||||
|
|
||||||
// FUNCTION TO HANDLE MESSAGE CHANGE
|
// FUNCTION TO HANDLE MESSAGE CHANGE
|
||||||
const handleMessageChange = ({ target: { value } }) => {
|
const handleMessageChange = ({ target: { value } }) => {
|
||||||
setMessageToSend(value);
|
setMessageToSend(value);
|
||||||
@@ -67,11 +75,23 @@ function ActiveJobs(props) {
|
|||||||
// IF NO FILE SELECTED RETURN
|
// IF NO FILE SELECTED RETURN
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) {
|
let fileType = files[0].type.split('/')[0].toLowerCase()
|
||||||
|
if (fileType == 'video' && files[0].size > Number(process.env.REACT_APP_MAX_VIDEO_FILE_SIZE)) { // return if video file is more than 30mb
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
message: "File must be <= 1mb",
|
message: `File must be <= ${Number(process.env.REACT_APP_MAX_VIDEO_FILE_SIZE)/1048576} mb`,
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
|
}, 5000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (fileType != 'video' && files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) { // return if other files is more than 1mb
|
||||||
|
setRequestStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: `File must be <= ${Number(process.env.REACT_APP_MAX_FILE_SIZE)/1048576} mb`,
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
@@ -92,7 +112,8 @@ function ActiveJobs(props) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// INCLUDE FILE IF NO ERROR
|
// INCLUDE FILE IF NO ERROR
|
||||||
setFilesToSend((prev) => [...prev, files[0]]);
|
// setFilesToSend((prev) => [...prev, files[0]]); //for sending multiple file if need be
|
||||||
|
setFilesToSend([files[0]])
|
||||||
};
|
};
|
||||||
|
|
||||||
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
|
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
|
||||||
@@ -181,61 +202,46 @@ function ActiveJobs(props) {
|
|||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
// const fileToBase64 = async () => {
|
||||||
|
// // Converts file data to base64 string
|
||||||
|
// try {
|
||||||
|
// const base64String = await convertFileToBase64(filesToSend[i]);
|
||||||
|
// return base64String;
|
||||||
|
// } catch (error) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
for (let i = 0; i <= filesToSend.length - 1; i++) {
|
let reqData = {
|
||||||
// Loops through files to send array and trigger upload API call
|
// file_name: filesToSend[i].name,
|
||||||
|
// file_size: filesToSend[i].size,
|
||||||
|
// file_type: "image/png",
|
||||||
|
// file_data: await fileToBase64(),
|
||||||
|
msg_type: "FILE",
|
||||||
|
contract: props.details.contract,
|
||||||
|
file: filesToSend[0],
|
||||||
|
};
|
||||||
|
|
||||||
const fileToBase64 = async () => {
|
ApiCall.sendFilesNew(reqData)
|
||||||
// Converts file data to base64 string
|
.then((res) => {
|
||||||
try {
|
if(res.status != 200 || res.data.internal_return < 0){
|
||||||
const base64String = await convertFileToBase64(filesToSend[i]);
|
setRequestStatus({loading: false, status: false, message: 'File could not be sent, try again later'})
|
||||||
return base64String;
|
return
|
||||||
} catch (error) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
};
|
setRequestStatus({loading: false, status: true, message: 'File Uploaded Successfully'})
|
||||||
|
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
||||||
// if(await !fileToBase64()){
|
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
||||||
// return
|
})
|
||||||
// }
|
.catch((error) => {
|
||||||
|
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
|
||||||
let reqData = {
|
})
|
||||||
file_name: filesToSend[i].name,
|
.finally(() => {
|
||||||
file_size: filesToSend[i].size,
|
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
||||||
file_type: "image/png",
|
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
||||||
file_data: await fileToBase64(),
|
setTimeout(() => {
|
||||||
msg_type: "FILE",
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
contract: props.details.contract,
|
}, 5000);
|
||||||
};
|
});
|
||||||
|
|
||||||
ApiCall.sendFiles(reqData)
|
|
||||||
.then((res) => {
|
|
||||||
// if(res.status != 200 || res.data.internal_return < 0){
|
|
||||||
// setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'})
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
|
|
||||||
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
|
||||||
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
// setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
if (i == filesToSend.length - 1) {
|
|
||||||
setRequestStatus({
|
|
||||||
loading: false,
|
|
||||||
status: true,
|
|
||||||
message: "File(s) Uploaded Successfully",
|
|
||||||
});
|
|
||||||
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
|
||||||
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
|
||||||
setTimeout(() => {
|
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
|
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
|
||||||
@@ -276,7 +282,7 @@ function ActiveJobs(props) {
|
|||||||
<div className="py-[20px] bg-white dark:bg-black dark:text-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-8">
|
<div className="py-[20px] bg-white dark:bg-black dark:text-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-8">
|
||||||
{/* job title */}
|
{/* job title */}
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="w-full flex justify-start space-x-3 items-start">
|
<div className="w-full flex justify-start space-x-3 items-center">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
|
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
|
||||||
@@ -325,7 +331,7 @@ function ActiveJobs(props) {
|
|||||||
|
|
||||||
{/* job details */}
|
{/* job details */}
|
||||||
<div className="min-w-[150px]">
|
<div className="min-w-[150px]">
|
||||||
<p className="text-base text-sky-blue">Delivery Detail</p>
|
<button className="text-base text-sky-blue" onClick={jobDetailModalHandler}>Delivery Detail</button>
|
||||||
{passDue ? (
|
{passDue ? (
|
||||||
<div className="my-1">
|
<div className="my-1">
|
||||||
<p className="text-base text-slate-700">
|
<p className="text-base text-slate-700">
|
||||||
@@ -437,7 +443,7 @@ function ActiveJobs(props) {
|
|||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
id="file"
|
id="file"
|
||||||
accept="image/*"
|
accept="image/*,video/*"
|
||||||
style={{ display: "none" }}
|
style={{ display: "none" }}
|
||||||
onChange={handleFileChange}
|
onChange={handleFileChange}
|
||||||
/>
|
/>
|
||||||
@@ -587,6 +593,16 @@ function ActiveJobs(props) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{/* END OF POPOUT SECTION */}
|
{/* END OF POPOUT SECTION */}
|
||||||
|
|
||||||
|
{/* Delivery Details Popout */}
|
||||||
|
{jobDetailModal &&
|
||||||
|
<JobDetailPopout
|
||||||
|
action={jobDetailModalHandler}
|
||||||
|
situation={jobDetailModal}
|
||||||
|
jobDetail={props?.details?.job_description}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
{/* END Delivery Details Popout */}
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,11 +69,23 @@ function ActiveJobsMedia(props) {
|
|||||||
// IF NO FILE SELECTED RETURN
|
// IF NO FILE SELECTED RETURN
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) {
|
let fileType = files[0].type.split('/')[0].toLowerCase()
|
||||||
|
if (fileType == 'video' && files[0].size > Number(process.env.REACT_APP_MAX_VIDEO_FILE_SIZE)) { // return if video file is more than 30mb
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
message: "File must be <= 1mb",
|
message: `File must be <= ${Number(process.env.REACT_APP_MAX_VIDEO_FILE_SIZE)/1048576} mb`,
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
|
}, 5000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (fileType != 'video' && files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) { // return if other files is more than 1mb
|
||||||
|
setRequestStatus({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: `File must be <= ${Number(process.env.REACT_APP_MAX_FILE_SIZE)/1048576} mb`,
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
@@ -94,7 +106,8 @@ function ActiveJobsMedia(props) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// INCLUDE FILE IF NO ERROR
|
// INCLUDE FILE IF NO ERROR
|
||||||
setFilesToSend((prev) => [...prev, files[0]]);
|
// setFilesToSend((prev) => [...prev, files[0]]); //for sending multiple file if need be
|
||||||
|
setFilesToSend([files[0]])
|
||||||
};
|
};
|
||||||
|
|
||||||
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
|
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
|
||||||
@@ -184,60 +197,42 @@ function ActiveJobsMedia(props) {
|
|||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i <= filesToSend.length - 1; i++) {
|
// const fileToBase64 = async () => {
|
||||||
// Loops through files to send array and trigger upload API call
|
// // Converts file data to base64 string
|
||||||
|
// try {
|
||||||
|
// const base64String = await convertFileToBase64(filesToSend[i]);
|
||||||
|
// return base64String;
|
||||||
|
// } catch (error) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
const fileToBase64 = async () => {
|
let reqData = {
|
||||||
// Converts file data to base64 string
|
msg_type: "FILE",
|
||||||
try {
|
contract: props.details.contract,
|
||||||
const base64String = await convertFileToBase64(filesToSend[i]);
|
file: filesToSend[0],
|
||||||
return base64String;
|
};
|
||||||
} catch (error) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// if(await !fileToBase64()){
|
ApiCall.sendFilesNew(reqData)
|
||||||
// return
|
.then((res) => {
|
||||||
// }
|
if(res.status != 200 || res.data.internal_return < 0){
|
||||||
|
setRequestStatus({loading: false, status: false, message: 'File could not be sent, try again later'})
|
||||||
let reqData = {
|
return
|
||||||
file_name: filesToSend[i].name,
|
}
|
||||||
file_size: filesToSend[i].size,
|
setRequestStatus({loading: false, status: true, message: 'File Uploaded Successfully'})
|
||||||
file_type: "image/png",
|
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
||||||
file_data: await fileToBase64(),
|
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
||||||
msg_type: "FILE",
|
})
|
||||||
contract: props.details.contract,
|
.catch((error) => {
|
||||||
};
|
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
|
||||||
|
})
|
||||||
ApiCall.sendFiles(reqData)
|
.finally(() => {
|
||||||
.then((res) => {
|
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
||||||
// if(res.status != 200 || res.data.internal_return < 0){
|
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
||||||
// setRequestStatus({loading: false, status: false, message: 'Files(s) could not be sent, try again later'})
|
setTimeout(() => {
|
||||||
// return
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
// }
|
}, 5000);
|
||||||
// setRequestStatus({loading: false, status: true, message: 'File(s) Uploaded Successfully'})
|
});
|
||||||
// props.reloadActiveJobList(prev => !prev) // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
|
||||||
// setFilesToSend([]) // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
// setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong'})
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
if (i == filesToSend.length - 1) {
|
|
||||||
setRequestStatus({
|
|
||||||
loading: false,
|
|
||||||
status: true,
|
|
||||||
message: "File(s) Uploaded Successfully",
|
|
||||||
});
|
|
||||||
setFilesToSend([]); // SETS FILES TO SEND TO SEND BACK TO EMPTY ARRAY
|
|
||||||
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
|
||||||
setTimeout(() => {
|
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
|
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
|
||||||
@@ -437,7 +432,7 @@ function ActiveJobsMedia(props) {
|
|||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
id="file"
|
id="file"
|
||||||
accept="image/*"
|
accept="image/*,video/*"
|
||||||
style={{ display: "none" }}
|
style={{ display: "none" }}
|
||||||
onChange={handleFileChange}
|
onChange={handleFileChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import ModalCom from '../Helpers/ModalCom'
|
||||||
|
|
||||||
|
export default function JobDetailPopout({action, situation, jobDetail}) {
|
||||||
|
return (
|
||||||
|
<ModalCom action={action} situation={situation}>
|
||||||
|
<div className="modal-container">
|
||||||
|
<div className="modal-header-con">
|
||||||
|
<h1 className="modal-title">
|
||||||
|
Delivery Detail
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="modal-close-btn"
|
||||||
|
onClick={action}
|
||||||
|
>
|
||||||
|
<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="modal-body-wrapper">
|
||||||
|
<p className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'>{jobDetail}</p>
|
||||||
|
</div>
|
||||||
|
<div className="modal-footer-wrapper justify-end">
|
||||||
|
<button
|
||||||
|
onClick={action}
|
||||||
|
className="custom-btn border-gradient"
|
||||||
|
>
|
||||||
|
<span className="text-gradient">Close</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ModalCom>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -104,7 +104,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const currentJobList = filterJobList();
|
const currentJobList = filterJobList()?.filter(item => item?.job_mode == 'GENERAL'); // Show only jobs with job mode of GENERAL
|
||||||
|
|
||||||
// Handling Filter Pagination
|
// Handling Filter Pagination
|
||||||
const filteredCurrentJobList = currentJobList?.slice(
|
const filteredCurrentJobList = currentJobList?.slice(
|
||||||
@@ -358,13 +358,14 @@ function myJobTableFeatures(
|
|||||||
{MyJobList?.data?.result_list?.length > 0 ? (
|
{MyJobList?.data?.result_list?.length > 0 ? (
|
||||||
filteredCurrentJobList.length > 0 ? (
|
filteredCurrentJobList.length > 0 ? (
|
||||||
filteredCurrentJobList.map((value, index) => (
|
filteredCurrentJobList.map((value, index) => (
|
||||||
<JobListItem
|
<JobListItem
|
||||||
key={index}
|
key={index}
|
||||||
index={index}
|
index={index}
|
||||||
value={value}
|
value={value}
|
||||||
image_server={MyJobList.data.session_image_server}
|
image_server={MyJobList.data.session_image_server}
|
||||||
/>
|
/>
|
||||||
))
|
)
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<NoJobsRow text="No Jobs Available In This Category!" />
|
<NoJobsRow text="No Jobs Available In This Category!" />
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -122,17 +122,43 @@ export default function MyJobTable({ className, ActiveJobList, Account, imageSer
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex justify-center items-center py-4 px-2">
|
<div className="flex justify-center items-center py-4 px-2">
|
||||||
<button
|
{accountType ?
|
||||||
type="button"
|
<button
|
||||||
onClick={() => {
|
type="button"
|
||||||
navigate("/manage-active-job", {
|
onClick={() => {
|
||||||
state: { ...task, pathname },
|
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"
|
}}
|
||||||
>
|
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>
|
{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>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ function AmountSection({ currency, amount, country }) {
|
|||||||
<div className={`flex items-center gap-8`}>
|
<div className={`flex items-center gap-8`}>
|
||||||
{/* text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1 */}
|
{/* text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1 */}
|
||||||
<h1 className="min-w-[150px] job-label">
|
<h1 className="min-w-[150px] job-label">
|
||||||
Amount({currency})
|
Amount ({currency})
|
||||||
</h1>
|
</h1>
|
||||||
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{formattedAmount}
|
{formattedAmount}
|
||||||
@@ -91,7 +91,7 @@ function TotalSection({ currency, amount, fee, country }) {
|
|||||||
return (
|
return (
|
||||||
<div className={`flex items-center gap-8`}>
|
<div className={`flex items-center gap-8`}>
|
||||||
<h1 className="min-w-[150px] job-label">
|
<h1 className="min-w-[150px] job-label">
|
||||||
Total
|
Total ({currency})
|
||||||
</h1>
|
</h1>
|
||||||
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{formattedTotal}
|
{formattedTotal}
|
||||||
|
|||||||
@@ -60,13 +60,6 @@ const WalletRoutes = () => {
|
|||||||
getPaymentHistory();
|
getPaymentHistory();
|
||||||
}, [walletTable]);
|
}, [walletTable]);
|
||||||
|
|
||||||
console.log(
|
|
||||||
"Testing all country: ",
|
|
||||||
allCountries,
|
|
||||||
"Testing wallet: ",
|
|
||||||
walletDetails
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
||||||
|
|||||||
@@ -18,21 +18,21 @@ function PurchasesTable({purchase}) {
|
|||||||
<div className='flex flex-col justify-between min-h-[500px]'>
|
<div className='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='border-b-2'>
|
<thead className='w-full'>
|
||||||
<tr className='text-slate-600'>
|
<tr className='text-slate-600 dark:text-white'>
|
||||||
<th className="p-2">Trx.</th>
|
<th className="p-4">Trx.</th>
|
||||||
<th className="p-2">Amount</th>
|
<th className="p-4 text-right">Amount</th>
|
||||||
<th className="p-2">Fee</th>
|
<th className="p-4 text-right">Fee</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{currentPurchase.map((item, index) => (
|
{currentPurchase.map((item, index) => (
|
||||||
<tr key={index} className='text-slate-500'>
|
<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-2">{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-2">{item.amount}</td>
|
<td className="p-4 text-right">{item.amount}</td>
|
||||||
<td className="p-2">{item.fee}</td>
|
<td className="p-4 text-right">{item.fee}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -48,7 +48,7 @@ function PurchasesTable({purchase}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{/* PAGINATION BUTTON */}
|
{/* PAGINATION BUTTON */}
|
||||||
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= purchase?.data?.length ? true : false} data={purchase?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
<PaginatedList borderTop={false} onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= purchase?.data?.length ? true : false} data={purchase?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
||||||
{/* END OF PAGINATION BUTTON */}
|
{/* END OF PAGINATION BUTTON */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,28 +21,28 @@ function RecentActivityTable({ payment }) {
|
|||||||
<div className="flex flex-col justify-between min-h-[500px]">
|
<div className="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="border-b-2">
|
<thead className="w-full">
|
||||||
<tr className="text-slate-600">
|
<tr className="text-slate-600 dark:text-white">
|
||||||
<th className="p-2">Date</th>
|
<th className="p-4">Date</th>
|
||||||
<th className="p-2">Trx.</th>
|
<th className="p-4">Trx.</th>
|
||||||
<th className="p-2">Amnt./Fee</th>
|
<th className="p-4 text-right">Amnt./Fee</th>
|
||||||
<th className="p-2">Status</th>
|
<th className="p-4">Status</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{currentActivity.map((item, index) => (
|
{currentActivity.map((item, index) => (
|
||||||
<tr key={index} className="text-slate-500">
|
<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-2">{item.trx_date}</td>
|
<td className="p-4">{item.trx_date}</td>
|
||||||
<td
|
<td
|
||||||
className="p-4"
|
className="p-4"
|
||||||
dangerouslySetInnerHTML={{ __html: item.recipient }}
|
dangerouslySetInnerHTML={{ __html: item.recipient }}
|
||||||
></td>
|
></td>
|
||||||
<td className="p-2">
|
<td className="p-4 text-right">
|
||||||
{item.amount}
|
{item.amount}
|
||||||
<br />
|
<br />
|
||||||
{item.fee}
|
{item.fee}
|
||||||
</td>
|
</td>
|
||||||
<td className="p-2">{item.status}</td>
|
<td className="p-4">{item.status}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -70,6 +70,7 @@ function RecentActivityTable({ payment }) {
|
|||||||
data={payment?.data}
|
data={payment?.data}
|
||||||
start={indexOfFirstItem}
|
start={indexOfFirstItem}
|
||||||
stop={indexOfLastItem}
|
stop={indexOfLastItem}
|
||||||
|
borderTop={false}
|
||||||
/>
|
/>
|
||||||
{/* END OF PAGINATION BUTTON */}
|
{/* END OF PAGINATION BUTTON */}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { useSelector } from "react-redux";
|
|||||||
|
|
||||||
export default function WalletHeader(props) {
|
export default function WalletHeader(props) {
|
||||||
|
|
||||||
const {userDetails: { account_type }} = useSelector((state) => state?.userDetails);
|
const {userDetails: { account_type, wallet_available_status }} = useSelector((state) => state?.userDetails);
|
||||||
// debugger;
|
// debugger;
|
||||||
//props.myWalletList.result_list
|
//props.myWalletList.result_list
|
||||||
let { pathname } = useLocation();
|
let { pathname } = useLocation();
|
||||||
@@ -22,6 +22,7 @@ export default function WalletHeader(props) {
|
|||||||
props.setBalanceDropdown.toggle();
|
props.setBalanceDropdown.toggle();
|
||||||
else navigate("/my-wallet", { replace: true });
|
else navigate("/my-wallet", { replace: true });
|
||||||
}
|
}
|
||||||
|
// console.log('props.myWalletList', wallet_available_status)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{account_type == 'FULL' ?
|
{account_type == 'FULL' ?
|
||||||
@@ -49,6 +50,8 @@ export default function WalletHeader(props) {
|
|||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="content px-7 pb-7">
|
<div className="content px-7 pb-7">
|
||||||
|
{/* wallet_available_status == 'WALLET_AVAILABLE' */}
|
||||||
|
{(wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE') ?
|
||||||
<ul>
|
<ul>
|
||||||
{props.myWalletList &&
|
{props.myWalletList &&
|
||||||
props.myWalletList?.length > 0 &&
|
props.myWalletList?.length > 0 &&
|
||||||
@@ -176,17 +179,25 @@ export default function WalletHeader(props) {
|
|||||||
{/* </div>*/}
|
{/* </div>*/}
|
||||||
{/*</li>*/}
|
{/*</li>*/}
|
||||||
</ul>
|
</ul>
|
||||||
|
:
|
||||||
|
<div className='p-2 w-full flex gap-4 items-center'>
|
||||||
|
<img className='w-[100px!important] h-auto' src={localImgLoad('images/icons/wallet.svg')} alt='Wallet Icon' />
|
||||||
|
<p className='text-lg text-red-500'>We do not currently support wallets in your area. We are diligently working on it. </p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
{(wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE') &&
|
||||||
<div className="add-money-btn flex justify-center items-center mt-3">
|
<div className="add-money-btn flex justify-center items-center mt-3">
|
||||||
{/* <button
|
{/* <button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if(pathname == '/my-wallet') props.setBalanceDropdown.toggle()
|
if(pathname == '/my-wallet') props.setBalanceDropdown.toggle()
|
||||||
else navigate('/my-wallet', {replace: true})
|
else navigate('/my-wallet', {replace: true})
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
Manage
|
Manage
|
||||||
</button> */}
|
</button> */}
|
||||||
<Link
|
<Link
|
||||||
to="/my-wallet"
|
to="/my-wallet"
|
||||||
onClick={onWalletClick}
|
onClick={onWalletClick}
|
||||||
@@ -195,6 +206,7 @@ export default function WalletHeader(props) {
|
|||||||
Manage
|
Manage
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,10 +6,20 @@ import CommonHead from "../UserHeader/CommonHead";
|
|||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import OthersInterestedTable from "./OthersInterestedTable";
|
import OthersInterestedTable from "./OthersInterestedTable";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { tableReload } from "../../store/TableReloads";
|
import { tableReload } from "../../store/TableReloads";
|
||||||
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
|
|
||||||
export default function ManageInterestOffer(props) {
|
export default function ManageInterestOffer(props) {
|
||||||
|
|
||||||
|
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||||
|
|
||||||
|
let { othersInterestedTable } = useSelector((state) => state.tableReload); // FOR OTHERS INTERESTED TABLE RELOAD
|
||||||
|
|
||||||
|
let walletBal = walletDetails?.data?.filter(wallet => wallet.code == props?.offerDetails?.currency_code) // USER WALLET BALANCE FOR CORRESPONDING TASK CURRENCY
|
||||||
|
|
||||||
|
let clientAdded = new Date(props.offerDetails?.client_added)
|
||||||
|
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const apiCall = new usersService()
|
const apiCall = new usersService()
|
||||||
@@ -26,6 +36,8 @@ export default function ManageInterestOffer(props) {
|
|||||||
|
|
||||||
const [messageList, setMessageList] = useState({loading: true, data: []}) // TO BE REMOVED AND REPLACE WITH REAL MESSAGE FROM API CALL
|
const [messageList, setMessageList] = useState({loading: true, data: []}) // TO BE REMOVED AND REPLACE WITH REAL MESSAGE FROM API CALL
|
||||||
|
|
||||||
|
const [interestStats, setInterestStats] = useState({loading: true, data: []}) // STATE TO HOLD INTEREST STATS
|
||||||
|
|
||||||
const [selectTab, setValue] = useState("today");
|
const [selectTab, setValue] = useState("today");
|
||||||
const filterHandler = (value) => {
|
const filterHandler = (value) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
@@ -120,6 +132,20 @@ export default function ManageInterestOffer(props) {
|
|||||||
console.log('Failed', err)
|
console.log('Failed', err)
|
||||||
})
|
})
|
||||||
},[messageListReload])
|
},[messageListReload])
|
||||||
|
|
||||||
|
useEffect(()=>{ //API to get Interest stats
|
||||||
|
let reqData = { // API PAYLOADS
|
||||||
|
interest_uid: props?.offerDetails?.interest_uid,
|
||||||
|
client_uid: props?.offerDetails?.client_uid
|
||||||
|
}
|
||||||
|
setInterestStats(prev => ({...prev, loading: true}))
|
||||||
|
apiCall.interestStatistics(reqData).then(res=>{
|
||||||
|
setInterestStats({loading: false, data:res?.data})
|
||||||
|
}).catch(err => {
|
||||||
|
setInterestStats(prev => ({...prev, loading: false}))
|
||||||
|
console.log('Failed', err)
|
||||||
|
})
|
||||||
|
},[othersInterestedTable])
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<CommonHead
|
<CommonHead
|
||||||
@@ -183,12 +209,21 @@ export default function ManageInterestOffer(props) {
|
|||||||
<button
|
<button
|
||||||
name="message"
|
name="message"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
onClick={(e) => setTab(e.target.name)}
|
||||||
className={`px-4 py-1 rounded-t-2xl ${
|
className={`px-4 py-1 rounded-t-2xl flex gap-2 ${
|
||||||
tab == "message" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
tab == "message" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
Messages ({messageList.data.length})
|
Messages ({messageList.data.length})
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
name="details"
|
||||||
|
onClick={(e) => setTab(e.target.name)}
|
||||||
|
className={`px-4 py-1 rounded-t-2xl ${
|
||||||
|
tab == "details" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
Delivery Details
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/* END OF switch button */}
|
{/* END OF switch button */}
|
||||||
|
|
||||||
@@ -197,40 +232,90 @@ export default function ManageInterestOffer(props) {
|
|||||||
<div className="info-details w-full border-t">
|
<div className="info-details w-full border-t">
|
||||||
<div className="my-0 md:my-3 block md:flex items-center gap-10">
|
<div className="my-0 md:my-3 block md:flex items-center gap-10">
|
||||||
<div className="my-3 md:my-0 flex items-center gap-1">
|
<div className="my-3 md:my-0 flex items-center gap-1">
|
||||||
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Name</span>
|
<p className="w-[200px] text-lg font-bold text-black dark:text-white tracking-wide">Name</p>
|
||||||
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_name}</span>
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_name}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="my-3 md:my-0 flex items-center gap-1">
|
<div className="my-3 md:my-0 flex items-center gap-1">
|
||||||
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Member Since</span>
|
<p className="w-[200px] text-lg font-bold text-black dark:text-white tracking-wide">Member Since</p>
|
||||||
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_added}</span>
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">
|
||||||
</div>
|
{clientAdded.getFullYear()}{" - "}
|
||||||
</div>
|
{clientAdded.getMonth() < 9 ? '0'+ (clientAdded.getMonth() + 1) : clientAdded.getMonth() + 1}
|
||||||
<div className="my-3 flex items-center gap-1">
|
</p>
|
||||||
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs completed</span>
|
|
||||||
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_jobs_completed ? props.offerDetails?.client_jobs_completed :0}</span>
|
|
||||||
</div>
|
|
||||||
<div className="my-0 md:my-3 block md:flex items-center gap-10">
|
|
||||||
<div className="my-3 md:my-0 flex items-center gap-1">
|
|
||||||
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs active</span>
|
|
||||||
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_jobs_active ? props.offerDetails?.client_jobs_active:0}</span>
|
|
||||||
</div>
|
|
||||||
<div className="my-3 md:my-0 flex items-center gap-1">
|
|
||||||
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs uncompleted</span>
|
|
||||||
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_jobs_missed ? props.offerDetails?.client_jobs_missed:0}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="block md:flex items-center gap-10">
|
|
||||||
<div className="my-3 md:my-0 flex items-center gap-1">
|
|
||||||
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">% completion</span>
|
|
||||||
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_percent_completion ? props.offerDetails?.client_percent_completion:0}</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Pending Offers</span>
|
|
||||||
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_offers_pending ? props.offerDetails?.client_offers_pending:0}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<>
|
||||||
|
{interestStats.loading ?
|
||||||
|
<LoadingSpinner color='sky-blue' size='10' height='min-h-[40px]' />
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
<div className='w-full'>
|
||||||
|
<h1 className="text-xl font-extrabold text-black dark:text-white tracking-wide">Previous Job Statistics</h1>
|
||||||
|
</div>
|
||||||
|
<div className='p-2 flex flex-col md:flex-row gap-4 justify-center items-center max-w-xl rounded-2xl bg-sky-100'>
|
||||||
|
<div className='contents md:flex flex-col gap-3'>
|
||||||
|
<div className='flex items-center gap-4'>
|
||||||
|
<p className="min-w-[150px] text-lg font-bold text-black dark:text-white tracking-wide text-right">Completed:</p>
|
||||||
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_completed && interestStats.data?.job_completed}</p>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-4">
|
||||||
|
<p className="min-w-[150px] text-lg font-bold text-black dark:text-white tracking-wide text-right">Active:</p>
|
||||||
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_active && interestStats.data?.job_active}</p>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-4">
|
||||||
|
<p className="min-w-[150px] text-lg font-bold text-black dark:text-white tracking-wide text-right">% Completion:</p>
|
||||||
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_percent_complete && interestStats.data?.job_percent_complete}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className='contents md:flex flex-col gap-3'>
|
||||||
|
<div className="flex items-center gap-4">
|
||||||
|
<p className="min-w-[150px] text-lg font-bold text-black dark:text-white tracking-wide text-right">Last Completed:</p>
|
||||||
|
<p className="min-w-[150px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_last_date && interestStats.data?.job_last_date}</p>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-4">
|
||||||
|
<p className="min-w-[150px] text-lg font-bold text-black dark:text-white tracking-wide text-right">Uncompleted:</p>
|
||||||
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_uncompleted && interestStats.data?.job_uncompleted}</p>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-4">
|
||||||
|
<p className="min-w-[150px] text-lg font-bold text-black dark:text-white tracking-wide text-right">Pending Offers:</p>
|
||||||
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_pending && interestStats.data?.job_pending}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* <div className="my-0 md:my-3 block md:flex items-center gap-5">
|
||||||
|
<div className='my-3 md:my-0 flex items-center gap-4'>
|
||||||
|
<p className="min-w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide text-right">Completed:</p>
|
||||||
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_completed && interestStats.data?.job_completed}</p>
|
||||||
|
</div>
|
||||||
|
<div className="my-3 md:my-0 flex items-center gap-4">
|
||||||
|
<p className="min-w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide text-right">Completed:</p>
|
||||||
|
<p className="min-w-[150px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_last_date && interestStats.data?.job_last_date}</p>
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
{/* <div className="my-0 md:my-3 block md:flex items-center gap-10">
|
||||||
|
<div className="my-3 md:my-0 flex items-center gap-4">
|
||||||
|
<p className="min-w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide text-right">Active:</p>
|
||||||
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_active && interestStats.data?.job_active}</p>
|
||||||
|
</div>
|
||||||
|
<div className="my-3 md:my-0 flex items-center gap-4">
|
||||||
|
<p className="min-w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide text-right">Uncompleted:</p>
|
||||||
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_uncompleted && interestStats.data?.job_uncompleted}</p>
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
{/* <div className="block md:flex items-center gap-10">
|
||||||
|
<div className="my-3 md:my-0 flex items-center gap-4">
|
||||||
|
<p className="min-w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide text-right">% Completion:</p>
|
||||||
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_percent_complete && interestStats.data?.job_percent_complete}</p>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-4">
|
||||||
|
<p className="min-w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide text-right">Pending Offers:</p>
|
||||||
|
<p className="min-w-[100px] text-lg font-normal text-dark-gray dark:text-white tracking-wide">{interestStats.data?.job_pending && interestStats.data?.job_pending}</p>
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</>
|
||||||
</div>
|
</div>
|
||||||
:
|
: tab == 'message' ?
|
||||||
<div className="message-details w-full border-t">
|
<div className="message-details w-full border-t">
|
||||||
<p className="my-1 text-base text-dark-gray dark:text-white tracking-wide">To: <span className="font-bold">{props.offerDetails?.client_name}</span></p>
|
<p className="my-1 text-base text-dark-gray dark:text-white tracking-wide">To: <span className="font-bold">{props.offerDetails?.client_name}</span></p>
|
||||||
<div className="w-full flex items-center gap-5">
|
<div className="w-full flex items-center gap-5">
|
||||||
@@ -294,14 +379,31 @@ export default function ManageInterestOffer(props) {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
: tab == 'details' ?
|
||||||
|
<div className="info-details w-full border-t">
|
||||||
|
<h1 className="my-3 text-base font-medium text-dark-gray dark:text-white tracking-wide">{props?.offerDetails?.description}</h1>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
null
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* END OF Detail section */}
|
{/* END OF Detail section */}
|
||||||
|
|
||||||
{/* BUTTON section */}
|
<div className="p-4 w-full min-h-full bg-sky-100 rounded-2xl dark:bg-dark-gray col-span-1">
|
||||||
<div className="p-4 w-full min-h-full bg-sky-100 dark:bg-dark-gray col-span-1">
|
{/* Wallet balance and reward */}
|
||||||
<div className="w-full h-full">
|
<div className='mb-4 border-b-2 flex flex-col justify-center items-center gap-4'>
|
||||||
|
<div className='w-full flex flex-col lg:flex-row justify-center items-center gap-2'>
|
||||||
|
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Wallet:</p>
|
||||||
|
<span className="font-medium text-dark-gray dark:text-white">{ walletDetails?.loading ? 'loading...' : PriceFormatter(walletBal[0]?.amount * 0.01,props?.offerDetails?.currency_code,props?.offerDetails?.currency)}</span>
|
||||||
|
</div>
|
||||||
|
<div className='w-full flex flex-col lg:flex-row justify-center items-center gap-2'>
|
||||||
|
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Reward:</p>
|
||||||
|
<span className="font-medium text-dark-gray dark:text-white">{PriceFormatter(props?.offerDetails?.price * 0.01,props?.offerDetails?.currency_code,props?.offerDetails?.currency)}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* BUTTON section */}
|
||||||
|
<div className="w-full">
|
||||||
<div className="h-full flex sm:flex-col justify-center items-center gap-10">
|
<div className="h-full flex sm:flex-col justify-center items-center gap-10">
|
||||||
{requestStatus.loading && requestStatus.processType == 'accept' ?
|
{requestStatus.loading && requestStatus.processType == 'accept' ?
|
||||||
<LoadingSpinner color='sky-blue' size='10' />
|
<LoadingSpinner color='sky-blue' size='10' />
|
||||||
@@ -333,6 +435,7 @@ export default function ManageInterestOffer(props) {
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
{/* END of BUTTON section */}
|
||||||
|
|
||||||
{/* ERROR DISPLAY */}
|
{/* ERROR DISPLAY */}
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
@@ -357,7 +460,6 @@ export default function ManageInterestOffer(props) {
|
|||||||
{/* End of error or success display */}
|
{/* End of error or success display */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* END of BUTTON section */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* END OF manage offer section */}
|
{/* END OF manage offer section */}
|
||||||
|
|||||||
@@ -100,9 +100,21 @@ export default function OffersInterestTable({offerInterestList, className}) {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className='w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white'
|
||||||
>
|
>
|
||||||
View
|
<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>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -101,9 +101,22 @@ export default function OthersInterestTable({othersInterestedList, className}) {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
View
|
{/* View */}
|
||||||
|
<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>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const PaginatedList = ({ onClick, prev, next, data, start, stop }) => {
|
const PaginatedList = ({ onClick, prev, next, data, start, stop, borderTop=true }) => {
|
||||||
if (data?.length > process.env.REACT_APP_ITEM_PER_PAGE) {
|
if (data?.length > process.env.REACT_APP_ITEM_PER_PAGE) {
|
||||||
return (
|
return (
|
||||||
<div className="p-3 flex justify-center items-center min-h-[70px] space-x-2 border-t-2 w-full">
|
<div className={`p-3 flex justify-center items-center min-h-[70px] space-x-2 w-full ${borderTop ? 'border-t-2' : 'border-t-0'}`}>
|
||||||
{/* Render pagination buttons */}
|
{/* Render pagination buttons */}
|
||||||
{!prev && (
|
{!prev && (
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ export default function Layout({ children }) {
|
|||||||
<Header sidebarHandler={() => setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} />
|
<Header sidebarHandler={() => setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} />
|
||||||
</div>
|
</div>
|
||||||
{/* container */}
|
{/* container */}
|
||||||
<div className="nft-container 2xl:space-x-8 h-full mb-12 lg:mt-[140px] mt-24 xl:mt-10 flex flex-col items-start justify-center xl:flex-row xl:justify-between gap-4">
|
<div className="nft-container h-full mb-12 lg:mt-[140px] mt-24 xl:mt-10 flex flex-col items-start justify-center 2xl:flex-row 2xl:justify-between gap-10">
|
||||||
<div className="flex-[80%] 2xl:flex-[85%] w-full">
|
<div className="w-full 2xl:w-[calc(100%-250px)]">
|
||||||
{children && children}
|
{children && children}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="nft-right-side-content flex-[20%] 2xl:flex-[15%] w-full h-full 2xl:flex justify-center 2xl:justify-end relative">
|
<div className="nft-right-side-content w-full 2xl:w-[200px] 2xl:flex justify-center 2xl:justify-end relative">
|
||||||
<RightSideBar myJobList={userJobList} />
|
<RightSideBar myJobList={userJobList} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ export default function MobileSidebar({
|
|||||||
const marketData = jobLists?.result_list;
|
const marketData = jobLists?.result_list;
|
||||||
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
|
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
|
||||||
|
|
||||||
|
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full h-full">
|
<div className="w-full h-full">
|
||||||
{/* logo-area */}
|
{/* logo-area */}
|
||||||
@@ -138,7 +140,7 @@ export default function MobileSidebar({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{userDetails?.account_type !== "FAMILY" && (
|
{(userDetails?.account_type !== "FAMILY" && walletExist) && (
|
||||||
<>
|
<>
|
||||||
{!userDetails?.post_jobs ? (
|
{!userDetails?.post_jobs ? (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export default function RightSideBar({ myJobList }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -129,25 +130,27 @@ export default function RightSideBar({ myJobList }) {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="item flex space-x-3 items-center">
|
{ Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1 &&
|
||||||
{/* image */}
|
<div className="item flex space-x-3 items-center">
|
||||||
<div className="w-8 h-8 rounded-full bg-sky-500/50 p-1 flex justify-center items-center">
|
{/* image */}
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 50" id="Page">
|
<div className="w-8 h-8 rounded-full bg-sky-500/50 p-1 flex justify-center items-center">
|
||||||
<path
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 50" id="Page">
|
||||||
fillRule="evenodd"
|
<path
|
||||||
d="M0 13V2a2 2 0 0 1 2-2h64a2 2 0 0 1 2 2v11H0Zm0 4v31a2 2 0 0 0 2 2h20V17H0Zm26 33h40a2 2 0 0 0 2-2V17H26v33Z"
|
fillRule="evenodd"
|
||||||
fill="#ffffff"
|
d="M0 13V2a2 2 0 0 1 2-2h64a2 2 0 0 1 2 2v11H0Zm0 4v31a2 2 0 0 0 2 2h20V17H0Zm26 33h40a2 2 0 0 0 2-2V17H26v33Z"
|
||||||
className="color000000 svgShape"
|
fill="#ffffff"
|
||||||
></path>
|
className="color000000 svgShape"
|
||||||
</svg>
|
></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
{/* name */}
|
||||||
|
<div>
|
||||||
|
<p className="text-thin-light-gray text-base font-medium">
|
||||||
|
<NavLink to="/yourpage">My Page</NavLink>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* name */}
|
}
|
||||||
<div>
|
|
||||||
<p className="text-thin-light-gray text-base font-medium">
|
|
||||||
<NavLink to="/yourpage">My Page</NavLink>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -278,7 +281,7 @@ export default function RightSideBar({ myJobList }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/*JOB LINKS*/}
|
{/*JOB LINKS*/}
|
||||||
{userDetails?.account_type !== "FAMILY" &&
|
{(userDetails?.account_type !== "FAMILY" && walletExist) &&
|
||||||
myJobList?.data?.result_list?.length > 0 && (
|
myJobList?.data?.result_list?.length > 0 && (
|
||||||
<div className="top-platform mt-6 bg-white dark:bg-dark-white rounded-2xl py-8 w-full 2xl:mb-10 2xl:border-none border ">
|
<div className="top-platform mt-6 bg-white dark:bg-dark-white rounded-2xl py-8 w-full 2xl:mb-10 2xl:border-none border ">
|
||||||
{/* heading */}
|
{/* heading */}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ export default function Sidebar({
|
|||||||
const marketData = jobLists?.result_list;
|
const marketData = jobLists?.result_list;
|
||||||
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
|
let noOfJobs = marketData?.length <= 0 ? "0" : marketData?.length;
|
||||||
|
|
||||||
|
let walletExist = userDetails?.wallet_available_status == 'WALLET_AVAILABLE' || localStorage.getItem('wallet_available_status')== 'WALLET_AVAILABLE'
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const title = document.querySelectorAll(".menu-setting-items .heading");
|
const title = document.querySelectorAll(".menu-setting-items .heading");
|
||||||
if (sidebar) {
|
if (sidebar) {
|
||||||
@@ -104,7 +106,7 @@ export default function Sidebar({
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-sky-blue">Menu</h1>
|
<h1 className={`${!sidebar && 'text-center'} title text-xl font-bold text-sky-blue`}>Menu</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="items">
|
<div className="items">
|
||||||
<ul className="flex flex-col space-y-6">
|
<ul className="flex flex-col space-y-6">
|
||||||
@@ -139,11 +141,11 @@ export default function Sidebar({
|
|||||||
{userDetails?.account_type !== "FAMILY" && (
|
{userDetails?.account_type !== "FAMILY" && (
|
||||||
<div
|
<div
|
||||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||||
sidebar ? "my-5" : ""
|
sidebar ? "mb-5" : "mb-2"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-sky-blue">Family</h1>
|
<h1 className={`${!sidebar && 'text-center'} title text-xl font-bold text-sky-blue`}>Family</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="items">
|
<div className="items">
|
||||||
<ul className="flex flex-col space-y-6">
|
<ul className="flex flex-col space-y-6">
|
||||||
@@ -157,7 +159,7 @@ export default function Sidebar({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{userDetails?.account_type !== "FAMILY" && (
|
{(userDetails?.account_type !== "FAMILY" && walletExist) && (
|
||||||
<>
|
<>
|
||||||
{!userDetails?.post_jobs ? (
|
{!userDetails?.post_jobs ? (
|
||||||
<div
|
<div
|
||||||
@@ -204,8 +206,8 @@ export default function Sidebar({
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-sky-blue">
|
<h1 className={`${!sidebar && 'text-center'} title text-xl font-bold text-sky-blue`}>
|
||||||
My Jobs
|
Jobs
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="items">
|
<div className="items">
|
||||||
@@ -319,7 +321,7 @@ const ListItem = ({ sidebar, route, title, bubble, iconName, popup }) => {
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
className={`item-content relative group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray font-medium ${
|
className={`item-content relative group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray font-medium ${
|
||||||
sidebar ? "active flex-1" : "w-0"
|
sidebar ? "active flex-1" : "hidden"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{title && title}
|
{title && title}
|
||||||
|
|||||||
@@ -16,6 +16,22 @@ export default function MyUploadedFiles({ uploadedFiles }) {
|
|||||||
const handlePagination = (e) => {
|
const handlePagination = (e) => {
|
||||||
handlePagingFunc(e, setCurrentPage);
|
handlePagingFunc(e, setCurrentPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//FUNCTION TO OPEN NEW WINDOW
|
||||||
|
const openNewWindow = (e, url, width=1000, height=600) => {
|
||||||
|
e.preventDefault()
|
||||||
|
var leftPosition, topPosition;
|
||||||
|
//Allow for borders.
|
||||||
|
leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
|
||||||
|
//Allow for title and status bars.
|
||||||
|
topPosition = (window.screen.height / 2) - ((height / 2) + 50);
|
||||||
|
//Open the window.
|
||||||
|
window.open(url, "",
|
||||||
|
"status=no,height=" + height + ",width=" + width + ",resizable=yes,left="
|
||||||
|
+ leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY="
|
||||||
|
+ topPosition + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="mb-4 w-full flex justify-end item-center">
|
<div className="mb-4 w-full flex justify-end item-center">
|
||||||
@@ -44,7 +60,8 @@ export default function MyUploadedFiles({ uploadedFiles }) {
|
|||||||
currentFiles.map((value, idx) => {
|
currentFiles.map((value, idx) => {
|
||||||
let addedDate = value?.added?.split(" ")[0];
|
let addedDate = value?.added?.split(" ")[0];
|
||||||
let formattedSize = formatFileSize(value?.file_size);
|
let formattedSize = formatFileSize(value?.file_size);
|
||||||
let imageLink = `${uploadedFiles?.image}${localStorage.getItem('session_token')}/myfile/${value.file_uid}`
|
let downloadLink = value.file_type == 'video/mp4' ? `${process.env.REACT_APP_MEDIA_LINK}/myfile/${value.file_uid}` : `${uploadedFiles?.image}${localStorage.getItem('session_token')}/myfile/${value.file_uid}`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={value?.file_uid}
|
key={value?.file_uid}
|
||||||
@@ -103,8 +120,9 @@ export default function MyUploadedFiles({ uploadedFiles }) {
|
|||||||
<td className="text-right py-4 px-2">
|
<td className="text-right py-4 px-2">
|
||||||
<div className="flex justify-center items-center">
|
<div className="flex justify-center items-center">
|
||||||
<a
|
<a
|
||||||
href={imageLink}
|
href={downloadLink}
|
||||||
title="download"
|
title="download"
|
||||||
|
onClick={(e)=> openNewWindow(e, downloadLink)}
|
||||||
// className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
// className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ export default function Settings({ faq }) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="content-body w-full lg:flex lg:px-10 px-4">
|
<div className="content-body w-full lg:flex lg:px-10 px-4">
|
||||||
<div className="content-tab-items lg:w-[230px] w-full mr-2">
|
<div className="content-tab-items lg:w-[230px] w-full mr-2">
|
||||||
<ul className="overflow-hidden mb-10 lg:mb-0">
|
<ul className="overflow-hidden mb-10 lg:mb-0 flex flex-col sm:block lg:flex-col">
|
||||||
{tabs.map(({ name, id, title, iconName }) => (
|
{tabs.map(({ name, id, title, iconName }) => (
|
||||||
<li
|
<li
|
||||||
onClick={() => tabHandler(name)}
|
onClick={() => tabHandler(name)}
|
||||||
|
|||||||
@@ -146,10 +146,12 @@ export default function UploadProduct({uploadTypes}) {
|
|||||||
|
|
||||||
let reqData = { // PAYLOAD FOR API CALL
|
let reqData = { // PAYLOAD FOR API CALL
|
||||||
// file_name: selectedFile.substring(0,21).replace(/ /gi, ""),
|
// file_name: selectedFile.substring(0,21).replace(/ /gi, ""),
|
||||||
|
|
||||||
|
// file_data: img.file?.split(",")[1],
|
||||||
file_name: `myfile.${imgDetails?.type?.split('/')[1]}`,
|
file_name: `myfile.${imgDetails?.type?.split('/')[1]}`,
|
||||||
file_size: imgDetails.size,
|
file_size: imgDetails.size,
|
||||||
file_type: imgDetails.type,
|
file_type: imgDetails.type,
|
||||||
file_data: img.file?.split(",")[1],
|
files: imgDetails,
|
||||||
title: itemName,
|
title: itemName,
|
||||||
description: description,
|
description: description,
|
||||||
msg_type: 'FILE',
|
msg_type: 'FILE',
|
||||||
@@ -173,7 +175,7 @@ export default function UploadProduct({uploadTypes}) {
|
|||||||
|
|
||||||
// API CALL TO UPLOAD COMES HERE
|
// API CALL TO UPLOAD COMES HERE
|
||||||
setRequestStatus({loading: true, status: null, message: ''}) // SETS REQUEST LOADING TRUE
|
setRequestStatus({loading: true, status: null, message: ''}) // SETS REQUEST LOADING TRUE
|
||||||
apiCall.sendFiles(reqData).then(res=>{
|
apiCall.uploadFile(reqData).then(res=>{
|
||||||
if(res.status != 200 || res.data.internal_return < 0){
|
if(res.status != 200 || res.data.internal_return < 0){
|
||||||
return setRequestStatus({loading: false, status: false, message: 'Something went wrong, try again'})
|
return setRequestStatus({loading: false, status: false, message: 'Something went wrong, try again'})
|
||||||
}
|
}
|
||||||
@@ -311,6 +313,13 @@ export default function UploadProduct({uploadTypes}) {
|
|||||||
className="w-full h-full object-cover"
|
className="w-full h-full object-cover"
|
||||||
controls
|
controls
|
||||||
></video>
|
></video>
|
||||||
|
) : img.type === "audio" ? (
|
||||||
|
<audio
|
||||||
|
type=""
|
||||||
|
src={img.file}
|
||||||
|
className="w-full h-full object-cover"
|
||||||
|
controls
|
||||||
|
></audio>
|
||||||
) : img.type != null ? (
|
) : img.type != null ? (
|
||||||
<p>{selectedFile}</p>
|
<p>{selectedFile}</p>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -434,6 +443,7 @@ export default function UploadProduct({uploadTypes}) {
|
|||||||
// to="/"
|
// to="/"
|
||||||
onClick={uploadItem}
|
onClick={uploadItem}
|
||||||
className="sm:w-[126px] h-[46px] w-[100px] flex justify-center items-center btn-gradient sm:text-18 text-sm rounded-full text-white"
|
className="sm:w-[126px] h-[46px] w-[100px] flex justify-center items-center btn-gradient sm:text-18 text-sm rounded-full text-white"
|
||||||
|
disabled={uploadTypes.loading || requestStatus.loading}
|
||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import usersService from '../../services/UsersService'
|
|||||||
export default function AttachFile({data='', fontSize='text-sm', showOnData=false}) {
|
export default function AttachFile({data='', fontSize='text-sm', showOnData=false}) {
|
||||||
|
|
||||||
const apiCall = new usersService()
|
const apiCall = new usersService()
|
||||||
|
|
||||||
let [uploadedList, setUploadedList] = useState({loading: true, data:{}})
|
let [uploadedList, setUploadedList] = useState({loading: true, data:{}})
|
||||||
let [reloadList, setReloadList] = useState(false) // Triggers list of upload reload
|
let [reloadList, setReloadList] = useState(false) // Triggers list of upload reload
|
||||||
|
|
||||||
@@ -19,9 +19,9 @@ export default function AttachFile({data='', fontSize='text-sm', showOnData=fals
|
|||||||
let inputs = {
|
let inputs = {
|
||||||
file: event.target.files[0],
|
file: event.target.files[0],
|
||||||
job_uid: data?.job_uid,
|
job_uid: data?.job_uid,
|
||||||
uid: 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"),
|
||||||
};
|
};
|
||||||
setRequestStatus({loading: true, status:false, message:''})
|
setRequestStatus({loading: true, status:false, message:''})
|
||||||
if(!inputs.file){
|
if(!inputs.file){
|
||||||
@@ -31,12 +31,11 @@ export default function AttachFile({data='', fontSize='text-sm', showOnData=fals
|
|||||||
}, 3000)
|
}, 3000)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const formData = new FormData()
|
// const formData = new FormData()
|
||||||
for (let input in inputs) {
|
// for (let input in inputs) {
|
||||||
formData.append(input, inputs[input]);
|
// formData.append(input, inputs[input]);
|
||||||
}
|
// }
|
||||||
|
apiCall.uploadTaskFile(inputs).then(res => {
|
||||||
axios.post(`${process.env.REACT_APP_MEDIA_LINK}/upload/task`,formData).then(res => {
|
|
||||||
if(res.data.internal_return < 0){
|
if(res.data.internal_return < 0){
|
||||||
inputFile.current.value = null
|
inputFile.current.value = null
|
||||||
setRequestStatus({loading: false, status:false, message:'upload failed'})
|
setRequestStatus({loading: false, status:false, message:'upload failed'})
|
||||||
@@ -61,6 +60,21 @@ export default function AttachFile({data='', fontSize='text-sm', showOnData=fals
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//FUNCTION TO OPEN NEW WINDOW
|
||||||
|
const openNewWindow = (e, url, width=1000, height=600) => {
|
||||||
|
e.preventDefault()
|
||||||
|
var leftPosition, topPosition;
|
||||||
|
//Allow for borders.
|
||||||
|
leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
|
||||||
|
//Allow for title and status bars.
|
||||||
|
topPosition = (window.screen.height / 2) - ((height / 2) + 50);
|
||||||
|
//Open the window.
|
||||||
|
window.open(url, "",
|
||||||
|
"status=no,height=" + height + ",width=" + width + ",resizable=yes,left="
|
||||||
|
+ leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY="
|
||||||
|
+ topPosition + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
apiCall.jobManagerFiles({job_uid:data?.job_uid || data?.origin_job_uid}).then(res => {
|
apiCall.jobManagerFiles({job_uid:data?.job_uid || data?.origin_job_uid}).then(res => {
|
||||||
setUploadedList({loading: false, data:res.data})
|
setUploadedList({loading: false, data:res.data})
|
||||||
@@ -97,14 +111,16 @@ export default function AttachFile({data='', fontSize='text-sm', showOnData=fals
|
|||||||
uploadedList.data.result_list.length > 0 ?
|
uploadedList.data.result_list.length > 0 ?
|
||||||
uploadedList.data.result_list.map((item, index) => {
|
uploadedList.data.result_list.map((item, index) => {
|
||||||
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
||||||
|
let downloadLink = fileNameExt == 'mp4' ? `${process.env.REACT_APP_MEDIA_LINK}/mytask/${item.file_uid}` : `${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}`
|
||||||
return(
|
return(
|
||||||
<div key={item.file_uid} className={`my-[6px] flex justify-start gap-2 ${fontSize}`}>
|
<div key={item.file_uid} className={`mb-[6px] flex justify-start gap-2 ${fontSize}`}>
|
||||||
<span>{index + 1}:</span>
|
<span>{index + 1}:</span>
|
||||||
<a
|
<a
|
||||||
target='_blank'
|
target='_blank'
|
||||||
alt='download-link'
|
alt='download-link'
|
||||||
className=''
|
className=''
|
||||||
href={`${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}`}
|
href={downloadLink}
|
||||||
|
onClick={(e)=> openNewWindow(e, downloadLink)}
|
||||||
>
|
>
|
||||||
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
|
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
|
||||||
</a>
|
</a>
|
||||||
@@ -139,14 +155,16 @@ export default function AttachFile({data='', fontSize='text-sm', showOnData=fals
|
|||||||
<div className='text-[12px] w-full p-2 h-20 overflow-y-auto flex flex-col gap-2'>
|
<div className='text-[12px] w-full p-2 h-20 overflow-y-auto flex flex-col gap-2'>
|
||||||
{uploadedList.data.result_list.map((item, index) => {
|
{uploadedList.data.result_list.map((item, index) => {
|
||||||
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
let fileNameExt = item.originalname.split('.')[item.originalname.split('.').length - 1]
|
||||||
|
let downloadLink = fileNameExt == 'mp4' ? `${process.env.REACT_APP_MEDIA_LINK}/mytask/${item.file_uid}` : `${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}`
|
||||||
return(
|
return(
|
||||||
<div key={item.file_uid} className={`my-[6px] flex justify-start gap-2 ${fontSize}`}>
|
<div key={item.file_uid} className={`mb-[6px] flex justify-start gap-2 ${fontSize}`}>
|
||||||
<span>{index + 1}:</span>
|
<span>{index + 1}:</span>
|
||||||
<a
|
<a
|
||||||
target='_blank'
|
target='_blank'
|
||||||
alt='download-link'
|
alt='download-link'
|
||||||
className=''
|
className=''
|
||||||
href={`${uploadedList?.data?.session_image_server}/${localStorage.getItem("session_token")}/jobfile/${item.file_uid}`}
|
href={downloadLink}
|
||||||
|
onClick={(e)=> openNewWindow(e, downloadLink)}
|
||||||
>
|
>
|
||||||
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
|
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ function PendingJobsPopout({ details, onClose, situation }) {
|
|||||||
onClose();
|
onClose();
|
||||||
dispatch(tableReload({ type: "PENDINGTABLE" }));
|
dispatch(tableReload({ type: "PENDINGTABLE" }));
|
||||||
dispatch(tableReload({ type: "JOBTABLE" }));
|
dispatch(tableReload({ type: "JOBTABLE" }));
|
||||||
|
dispatch(tableReload({ type: "MARKETTABLELIST" }));
|
||||||
}, 4000);
|
}, 4000);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
+1
-1
@@ -178,7 +178,7 @@
|
|||||||
|
|
||||||
/* Modal Body section */
|
/* Modal Body section */
|
||||||
.modal-body-wrapper {
|
.modal-body-wrapper {
|
||||||
@apply w-full h-full overflow-y-auto flex flex-col items-center px-10 p-2
|
@apply w-full min-h-[300px] h-full overflow-y-auto flex flex-col items-center px-10 p-2
|
||||||
}
|
}
|
||||||
|
|
||||||
/* modal footer */
|
/* modal footer */
|
||||||
|
|||||||
@@ -188,6 +188,8 @@ export const apiConst = {
|
|||||||
WRENCHBOARD_JOB_JOBGROUPADD: 13046,
|
WRENCHBOARD_JOB_JOBGROUPADD: 13046,
|
||||||
WRENCHBOARD_JOB_REPORT: 13047,
|
WRENCHBOARD_JOB_REPORT: 13047,
|
||||||
|
|
||||||
|
WRENCHBOARD_INTEREST_STATS: 13048,
|
||||||
|
|
||||||
WRENCHBOARD_GROUP_START: 12000,
|
WRENCHBOARD_GROUP_START: 12000,
|
||||||
WRENCHBOARD_GROUP_CREATEGROUP: 12010,
|
WRENCHBOARD_GROUP_CREATEGROUP: 12010,
|
||||||
WRENCHBOARD_GROUP_INVITEGROUP: 12015,
|
WRENCHBOARD_GROUP_INVITEGROUP: 12015,
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
}
|
}
|
||||||
// Getting market data
|
// Getting market data
|
||||||
const getMarketActiveJobList = async () => {
|
const getMarketActiveJobList = async () => {
|
||||||
|
dispatch(updateJobs({loading: true}));
|
||||||
try {
|
try {
|
||||||
const res = await apiCall.getActiveJobList();
|
const res = await apiCall.getActiveJobList();
|
||||||
dispatch(updateJobs({loading: false, ...res.data}));
|
dispatch(updateJobs({loading: false, ...res.data}));
|
||||||
|
|||||||
@@ -570,6 +570,20 @@ class usersService {
|
|||||||
return this.postAuxEnd("/familyrewardhx", postData);
|
return this.postAuxEnd("/familyrewardhx", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// API FUNCTION TO GET CONTRACT HISTORY
|
||||||
|
getContractHx() {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
offset: 1,
|
||||||
|
limit: 20,
|
||||||
|
// action: apiConst.WRENCHBOARD_FAMILY_TRANSFERHX,
|
||||||
|
action: "",
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/contracthx", postData);
|
||||||
|
}
|
||||||
|
|
||||||
// API FUNCTION TO GET PAYMENT HISTORY
|
// API FUNCTION TO GET PAYMENT HISTORY
|
||||||
getPaymentHx() {
|
getPaymentHx() {
|
||||||
var postData = {
|
var postData = {
|
||||||
@@ -908,6 +922,60 @@ class usersService {
|
|||||||
return this.postAuxEnd("/uploads", postData);
|
return this.postAuxEnd("/uploads", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION FOR NEW FILE UPLOAD
|
||||||
|
sendFilesNew(reqData) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
action: apiConst.WRENCHBOARD_CONTRACT_MESSAGE,
|
||||||
|
...reqData,
|
||||||
|
};
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
for (let data in postData) {
|
||||||
|
formData.append(data, postData[data]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.postAuxEnd("/upload/contract", formData, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO UPLOAD RESOURCE FILES
|
||||||
|
uploadFile(reqData) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
action: apiConst.WRENCHBOARD_CONTRACT_MESSAGE,
|
||||||
|
...reqData,
|
||||||
|
};
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
for (let data in postData) {
|
||||||
|
formData.append(data, postData[data]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.postAuxEnd("/upload/resources", formData, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO UPLOAD TASK FILES
|
||||||
|
uploadTaskFile(reqData) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
// action: apiConst.WRENCHBOARD_CONTRACT_MESSAGE,
|
||||||
|
...reqData,
|
||||||
|
};
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
for (let data in postData) {
|
||||||
|
formData.append(data, postData[data]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.postAuxEnd("/upload/task", formData, true);
|
||||||
|
}
|
||||||
|
|
||||||
// END POINT TO DELETE A JOB
|
// END POINT TO DELETE A JOB
|
||||||
deleteJob(reqData) {
|
deleteJob(reqData) {
|
||||||
var postData = {
|
var postData = {
|
||||||
@@ -1044,6 +1112,18 @@ class usersService {
|
|||||||
return this.postAuxEnd("/offerinterestlistmsg", postData);
|
return this.postAuxEnd("/offerinterestlistmsg", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// END POINT TO GET INTEREST STATS
|
||||||
|
interestStatistics(reqData) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
action: apiConst.WRENCHBOARD_INTEREST_STATS,
|
||||||
|
...reqData,
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/intereststats", postData);
|
||||||
|
}
|
||||||
|
|
||||||
// TO ADD FAMILY
|
// TO ADD FAMILY
|
||||||
addFamily(reqData) {
|
addFamily(reqData) {
|
||||||
var postData = {
|
var postData = {
|
||||||
@@ -1456,8 +1536,8 @@ class usersService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
postAuxEnd(uri, reqData) {
|
postAuxEnd(uri, reqData, uploadPost=false) {
|
||||||
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
const endPoint = uploadPost ? process.env.REACT_APP_MEDIA_LINK + uri : process.env.REACT_APP_USERS_ENDPOINT + uri;
|
||||||
const session_token = localStorage.getItem("session_token");
|
const session_token = localStorage.getItem("session_token");
|
||||||
// session_token = session_token !=null ?session_token : '';
|
// session_token = session_token !=null ?session_token : '';
|
||||||
// 'Authorization': `Basic ${(session_token !=null) ?session_token : ''}`,
|
// 'Authorization': `Basic ${(session_token !=null) ?session_token : ''}`,
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { Route, Routes } from "react-router-dom";
|
||||||
|
|
||||||
|
import FamilyRoutes from '../components/FamilyAcc/FamilyRoutes'
|
||||||
|
import FamilyAcc from '../components/FamilyAcc';
|
||||||
|
import FamilyActivities from '../components/FamilyAcc/FamilyActivities';
|
||||||
|
import FamilySettings from '../components/FamilyAcc/FamilySettings';
|
||||||
|
import FourZeroFour from '../components/FourZeroFour';
|
||||||
|
|
||||||
|
export default function FamilyRoutesPage() {
|
||||||
|
return (
|
||||||
|
<Routes>
|
||||||
|
<Route element={<FamilyRoutes />}>
|
||||||
|
<Route exact path='/' element={<FamilyAcc />} />
|
||||||
|
<Route exact path="/activities" element={<FamilyActivities />} />
|
||||||
|
<Route exact path="/familysettings" element={<FamilySettings />} />
|
||||||
|
<Route exact path="/*" element={<FourZeroFour />} />
|
||||||
|
</Route>
|
||||||
|
</Routes>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,5 +1,19 @@
|
|||||||
|
import {useEffect} from 'react'
|
||||||
import WalletRoutes from "../components/MyWallet/Wallet";
|
import WalletRoutes from "../components/MyWallet/Wallet";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import {useNavigate} from 'react-router-dom'
|
||||||
|
|
||||||
export default function MyWalletPage() {
|
export default function MyWalletPage() {
|
||||||
|
const {userDetails: { account_type, wallet_available_status }} = useSelector((state) => state?.userDetails);
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
let walletExist = wallet_available_status || localStorage.getItem('wallet_available_status')
|
||||||
|
console.log(walletExist)
|
||||||
|
if(account_type == 'FULL' && walletExist != 'WALLET_AVAILABLE'){
|
||||||
|
navigate('/', {replace: true})
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
return <WalletRoutes />;
|
return <WalletRoutes />;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user