Compare commits
169 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 976b4afbbf | |||
| 5f0364df10 | |||
| 5810345ca7 | |||
| 61d8c938e9 | |||
| b96bb061d0 | |||
| e0a728c5cf | |||
| f63e52422d | |||
| 12a56bdb05 | |||
| 7666d78c0b | |||
| 0a0cca7326 | |||
| 3749fc89db | |||
| fcab0acdad | |||
| 497407112c | |||
| bbbfe799a3 | |||
| 97bfcd68b5 | |||
| 7125ce936e | |||
| a235448897 | |||
| 36479d1246 | |||
| 134f2fbe9f | |||
| c1805376ae | |||
| e60a2aaea2 | |||
| 72118cefc4 | |||
| 30131e53c2 | |||
| 79361f35f2 | |||
| 8749bf9f55 | |||
| 4204b94231 | |||
| 7b1f27a641 | |||
| e4569ca81f | |||
| 58d0fc3dee | |||
| 2f2777cc05 | |||
| e534c81606 | |||
| e76b589e4d | |||
| 1cc0c314a2 | |||
| c01cfa104c | |||
| f5c3922a02 | |||
| 8255eedb00 | |||
| b4ff0b5eca | |||
| 120f2c1866 | |||
| 7389cf164c | |||
| 3700fe066f | |||
| 5e85697c82 | |||
| 5f87c5f36c | |||
| 66b7d20e43 | |||
| c389e06ae6 | |||
| 0b83682da7 | |||
| 78b14ec797 | |||
| 8b0954c28c | |||
| 15ef592252 | |||
| 4d74946f0d | |||
| 78ee32efcc | |||
| a2ef201cfd | |||
| 746cd00ec4 | |||
| 3461b828dd | |||
| d0e1a7acd0 | |||
| c5d84655a9 | |||
| 796f220c1d | |||
| 99ea92ae99 | |||
| d279e707dc | |||
| ba8213d120 | |||
| 0933dc8925 | |||
| fe48c962b2 | |||
| d2738f28d5 | |||
| 0f17783ab5 | |||
| 83f2339a17 | |||
| 13c0571b92 | |||
| a3e53afd99 | |||
| 83f9d5a1f4 | |||
| a16d958fa2 | |||
| 2ffabb63f3 | |||
| 1d673487af | |||
| 313c47f430 | |||
| 67aaf62f7b | |||
| 0526fdb572 | |||
| 7352c30969 | |||
| 7079ae963e | |||
| 9bfe3ce642 | |||
| ff862e72be | |||
| a1dc63e958 | |||
| 465e0745ec | |||
| e8789e7be6 | |||
| e84d583958 | |||
| 06549bf9bb | |||
| 2cd7ce9392 | |||
| 835b583056 | |||
| b72d9ccc35 | |||
| 225166a8be | |||
| b54a6fbee2 | |||
| db03242886 | |||
| 07c20fd927 | |||
| c706b5c143 | |||
| 294f6af6e4 | |||
| 76603294a3 | |||
| 5ff9876681 | |||
| aba23e82a1 | |||
| 7175c217b2 | |||
| 8a81e6da54 | |||
| 36ee1e8987 | |||
| b73a6afeac | |||
| 721c5a588f | |||
| a2431ff825 | |||
| 692fe461c3 | |||
| 3f84eef132 | |||
| 119f48642d | |||
| 1a0f97030f | |||
| 71d1b61bbd | |||
| 17ffe957e8 | |||
| e23aa95685 | |||
| 1c1293989b | |||
| 63448429b2 | |||
| 8d1eac9ff6 | |||
| 25e5c3f47a | |||
| 9f9c36ec85 | |||
| 05eb1a020d | |||
| 30d344833c | |||
| acdf167a69 | |||
| fd00113aab | |||
| 8765329256 | |||
| 3b9c0987b8 | |||
| 0304eaa328 | |||
| 85ac8d183c | |||
| 1aa0fc6016 | |||
| 18b85e0ec9 | |||
| 024c8bbed1 | |||
| 865c61f393 | |||
| bb79342762 | |||
| 413e8e0361 | |||
| ce5438ff85 | |||
| cf644d6349 | |||
| 0f6a49246c | |||
| 6c690fe897 | |||
| 1895b47b76 | |||
| 442fb36578 | |||
| cf157df31e | |||
| 99359d7568 | |||
| 0e09b84be2 | |||
| bbedfbd801 | |||
| 3d940a8629 | |||
| 6c38c6b44c | |||
| aeb22d7f28 | |||
| 1d50790cc1 | |||
| 172c4b7e6f | |||
| 3ea0737341 | |||
| bb0c8c9f34 | |||
| 9139f637cf | |||
| 16401cc3a2 | |||
| 93f26fcfba | |||
| ced9c523ad | |||
| 759269cd74 | |||
| fb27a0d156 | |||
| 03da0e211b | |||
| c00d702a6b | |||
| 206f292dd9 | |||
| abb2329795 | |||
| a92a9f961d | |||
| f90a6e6687 | |||
| b44c039bbf | |||
| 09e0661e48 | |||
| af2c2d66a3 | |||
| b2bfa6cd54 | |||
| 577212eb19 | |||
| f5bf5997d6 | |||
| 42c3676bcf | |||
| 9c00badcf6 | |||
| 85899a72d2 | |||
| 9cd3ef273b | |||
| 918575d802 | |||
| f2070ae31d | |||
| 4d9f0adf0c | |||
| e9271e649f |
@@ -18,6 +18,7 @@ REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/svs/user"
|
||||
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
||||
|
||||
REACT_APP_SESSION_EXPIRE_MINUTES=300000
|
||||
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
|
||||
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||
|
||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||
@@ -45,6 +46,9 @@ REACT_APP_FACEBOOK_CLIENT_ID=390204307987009
|
||||
REACT_APP_FACEBOOK_CLIENT_SECRET=19f778e312f2ab96d147bacb612910c2
|
||||
REACT_APP_FACEBOOK_CLIENT_SCOPE="email, public_profile"
|
||||
|
||||
REACT_APP_MAX_FILE_SIZE=1000000
|
||||
REACT_APP_TOTAL_NUM_FILE=4
|
||||
|
||||
|
||||
#apigate.lotus.g1.wrenchboard.com:76.209.103.227
|
||||
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
||||
|
||||
+5
-1
@@ -18,6 +18,7 @@ REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/svs/user"
|
||||
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
||||
|
||||
REACT_APP_SESSION_EXPIRE_MINUTES=300000
|
||||
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
|
||||
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||
|
||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||
@@ -37,4 +38,7 @@ REACT_APP_ITEM_PER_PAGE=5
|
||||
REACT_APP_GOOGLE_CLIENT_ID=817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com
|
||||
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_REDIRECT_URL=http://localhost:9082/login/auth/
|
||||
REACT_APP_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/
|
||||
|
||||
REACT_APP_MAX_FILE_SIZE=1000000
|
||||
REACT_APP_TOTAL_NUM_FILE=4
|
||||
+7
-1
@@ -18,6 +18,7 @@ REACT_APP_USERS_ENDPOINT="https://apigate.orion.g1.wrenchboard.com/svs/user"
|
||||
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
||||
|
||||
REACT_APP_SESSION_EXPIRE_MINUTES=300000
|
||||
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
|
||||
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||
|
||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||
@@ -37,4 +38,9 @@ REACT_APP_ITEM_PER_PAGE=5
|
||||
REACT_APP_GOOGLE_CLIENT_ID=817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com
|
||||
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_REDIRECT_URL=https://users.wrenchboard.com/login/auth/
|
||||
REACT_APP_GOOGLE_REDIRECT_URL=https://users.wrenchboard.com/login/auth/
|
||||
|
||||
DISABLE_ESLINT_PLUGIN=true
|
||||
|
||||
REACT_APP_MAX_FILE_SIZE=1000000
|
||||
REACT_APP_TOTAL_NUM_FILE=4
|
||||
+8
-6
@@ -14,17 +14,19 @@
|
||||
"chartjs": "^0.3.24",
|
||||
"cors": "^2.8.5",
|
||||
"faker": "^6.6.6",
|
||||
"flutterwave-react-v3": "^1.3.0",
|
||||
"formik": "^2.2.9",
|
||||
"react": "^18.2.0",
|
||||
"react-chartjs-2": "^4.1.0",
|
||||
"react-countup": "^6.2.0",
|
||||
"react-router-dom": "^6.0.2",
|
||||
"react-slick": "^0.29.0",
|
||||
"react-toastify": "^9.0.1",
|
||||
"flutterwave-react-v3": "^1.3.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-qr-code": "^2.0.11",
|
||||
"react-redux": "^8.0.5",
|
||||
"react-router-dom": "^6.0.2",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-slick": "^0.29.0",
|
||||
"react-to-print": "^2.14.12",
|
||||
"react-toastify": "^9.0.1",
|
||||
"redux": "^4.2.0",
|
||||
"slick-carousel": "^1.8.1",
|
||||
"web-vitals": "^1.0.1",
|
||||
@@ -54,4 +56,4 @@
|
||||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,10 @@ import ManageActiveJobs from "./views/ManageActiveJobs";
|
||||
import FamilyManagePage from "./views/FamilyManagePage";
|
||||
import MyCouponPage from "./views/MyCouponPage";
|
||||
import AuthRedirect from "./views/AuthRedirect";
|
||||
import MyPastDueJobsPage from "./views/MyPastDueJobsPage";
|
||||
import BlogPage from "./views/BlogPage";
|
||||
import MyReviewDueJobsPage from "./views/MyReviewDueJobsPage";
|
||||
import OffersInterestPage from "./views/OffersInterestPage";
|
||||
|
||||
export default function Routers() {
|
||||
return (
|
||||
@@ -86,11 +90,17 @@ export default function Routers() {
|
||||
<Route exact path="/myjobs" element={<MyJobsPage />} />
|
||||
<Route exact path="/add-job" element={<AddJobPage />} />
|
||||
<Route exact path="/my-active-jobs" element={<MyActiveJobsPage />} />
|
||||
<Route exact path="/my-pastdue-jobs" element={<MyPastDueJobsPage />} />
|
||||
<Route exact path="/my-pending-jobs" element={<MyPendingJobsPage />} />
|
||||
<Route exact path="/my-review-jobs" element={<MyReviewDueJobsPage />} />
|
||||
<Route exact path="/acc-family" element={<FamilyAccPage />} />
|
||||
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
||||
<Route exact path="/start-job" element={<StartJob />} />
|
||||
<Route exact path="/manage-active-job" element={<ManageActiveJobs />} />
|
||||
<Route exact path="/blog-page" element={<BlogPage />} />
|
||||
<Route exact path="/offer-interest" element={<OffersInterestPage />} />
|
||||
|
||||
|
||||
<Route
|
||||
exact
|
||||
path="/my-collection/collection-item"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 441 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 178 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
@@ -4,7 +4,9 @@ import InputCom from "../Helpers/Inputs/InputCom";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import usersService from "../../services/UsersService";
|
||||
|
||||
import { useSelector } from "react-redux";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
|
||||
import { tableReload } from '../../store/TableReloads'
|
||||
|
||||
import { Field, Form, Formik } from "formik";
|
||||
import * as Yup from "yup";
|
||||
@@ -36,20 +38,12 @@ const validationSchema = Yup.object().shape({
|
||||
.required("Timeline is required"),
|
||||
});
|
||||
|
||||
// let initialValues = {
|
||||
// // initial values for formik
|
||||
// country: "NG",
|
||||
// price: 0,
|
||||
// title: "",
|
||||
// description: "",
|
||||
// job_detail: "",
|
||||
// timeline_days: "",
|
||||
// };
|
||||
|
||||
function AddJob() {
|
||||
const ApiCall = new usersService();
|
||||
const navigate = useNavigate();
|
||||
|
||||
let dispatch = useDispatch()
|
||||
|
||||
let { userDetails } = useSelector((state) => state.userDetails);
|
||||
|
||||
let [pageLoading, setPageLoading] = useState(true); // State used for knowing when the page is mounting
|
||||
@@ -115,6 +109,7 @@ function AddJob() {
|
||||
message: "Job Added Successfully",
|
||||
});
|
||||
setTimeout(() => {
|
||||
dispatch(tableReload({type:'JOBTABLE'}))
|
||||
navigate("/myjobs", { replace: true });
|
||||
}, 1000);
|
||||
})
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import React, { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import Layout from "../Partials/Layout";
|
||||
import CommonHead from "../UserHeader/CommonHead";
|
||||
|
||||
export default function BlogItem(props) {
|
||||
const [selectTab, setValue] = useState("today");
|
||||
const filterHandler = (value) => {
|
||||
setValue(value);
|
||||
};
|
||||
return (
|
||||
<Layout>
|
||||
<CommonHead
|
||||
commonHeadData={props.commonHeadData}
|
||||
/>
|
||||
<div className="notification-page w-full mb-10">
|
||||
<div className="notification-wrapper w-full">
|
||||
{/* heading */}
|
||||
<div className="sm:flex justify-between items-center mb-6">
|
||||
<div className="mb-5 sm:mb-0">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||
<span
|
||||
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||
>
|
||||
Title of this Blog Items
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
<div className="slider-btns flex space-x-4">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Blog Items Details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
import React, { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { Link, useNavigate, } from "react-router-dom";
|
||||
import { toast } from "react-toastify";
|
||||
import localImgLoad from "../../lib/localImgLoad";
|
||||
import Icons from "../Helpers/Icons";
|
||||
import MarketPopUp from "../MarketPlace/PopUp/MarketPopUp";
|
||||
import usersService from "../../services/UsersService";
|
||||
|
||||
export default function AvailableJobsCard({
|
||||
className,
|
||||
@@ -11,7 +13,13 @@ export default function AvailableJobsCard({
|
||||
}) {
|
||||
//debugger;
|
||||
const [addFavorite, setValue] = useState(datas.whishlisted);
|
||||
const [options, setOption] = useState(false);
|
||||
const [marketPopUp, setMarketPopUp] = useState({ show: false, data: {} });
|
||||
const [manageInt, setManageInt] = useState(null)
|
||||
|
||||
const navigate = useNavigate();
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
|
||||
|
||||
const favoriteHandler = () => {
|
||||
if (!addFavorite) {
|
||||
setValue(true);
|
||||
@@ -21,98 +29,134 @@ export default function AvailableJobsCard({
|
||||
toast.warn("Remove to Favorite List");
|
||||
}
|
||||
};
|
||||
|
||||
const marketInterestData = useCallback(async() => {
|
||||
let { offer_code } = datas;
|
||||
let reqData = { offer_code };
|
||||
|
||||
try {
|
||||
const manageInt = await apiCall.MarketInterest(reqData);
|
||||
const manageIntRes = await manageInt?.data;
|
||||
setManageInt(manageIntRes)
|
||||
} catch (error) {
|
||||
throw new Error(error)
|
||||
}
|
||||
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (!datas) {
|
||||
navigate("/market", { replace: true });
|
||||
}
|
||||
marketInterestData()
|
||||
}, [marketInterestData, datas])
|
||||
return (
|
||||
<div
|
||||
className={`card-style-two w-full h-[426px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
<div className="flex flex-col justify-between w-full h-full">
|
||||
<Link to="/shop-details" className="mb-2.5">
|
||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
{datas.title}
|
||||
</h1>
|
||||
</Link>
|
||||
<>
|
||||
<div
|
||||
className={`card-style-two w-full h-[426px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
<div className="flex flex-col justify-between w-full h-full">
|
||||
<Link to="/shop-details" className="mb-2.5">
|
||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
{datas.title}
|
||||
</h1>
|
||||
</Link>
|
||||
|
||||
<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">
|
||||
{datas.offer_added}
|
||||
</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">
|
||||
{datas.expire}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="thumbnail-area w-full">
|
||||
<div
|
||||
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
|
||||
style={{
|
||||
background: `url(${localImgLoad(
|
||||
`images/${datas.thumbnil}`
|
||||
)}) 0% 0% / cover no-repeat`,
|
||||
}}
|
||||
>
|
||||
<div className="flex justify-center">{datas.description}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="details-area">
|
||||
<div className="product-two-options flex justify-between mb-5 relative">
|
||||
{/* <div className="status">*/}
|
||||
{/* {datas.isActive && (*/}
|
||||
{/* <span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">*/}
|
||||
{/* Active*/}
|
||||
{/*</span>*/}
|
||||
{/* )}*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/*<div className=" review flex space-x-2">*/}
|
||||
{/* <button*/}
|
||||
{/* onClick={favoriteHandler}*/}
|
||||
{/* type="button"*/}
|
||||
{/* className={`w-7 h-7 bg-white rounded-full flex justify-center items-center ${*/}
|
||||
{/* addFavorite ? "text-red-500" : "text-thin-light-gray"*/}
|
||||
{/* }`}*/}
|
||||
{/* >*/}
|
||||
{/* <Icons name="star" />*/}
|
||||
{/* </button>*/}
|
||||
{/*</div>*/}
|
||||
</div>
|
||||
|
||||
<div className="flex justify-between">
|
||||
<div className="flex items-center space-x-2">
|
||||
<div className="card-two-info flex justify-between items-center">
|
||||
<div className="owned-by flex space-x-2 items-center">
|
||||
<div>
|
||||
<p className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white">
|
||||
{datas.price * 0.01}
|
||||
{datas.currency} | {datas.timeline_days} day(s)
|
||||
</p>
|
||||
<p className="text-sm text-lighter-gray">
|
||||
( {datas.offer_code})
|
||||
<p className="text-thin-light-gray text-sm leading-3">Added</p>
|
||||
<p className="text-base text-dark-gray dark:text-white">
|
||||
{datas.offer_added}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
|
||||
>
|
||||
View
|
||||
</button>
|
||||
<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">
|
||||
{datas.expire}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="thumbnail-area w-full">
|
||||
<div
|
||||
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
|
||||
style={{
|
||||
background: `url(${localImgLoad(
|
||||
`images/${datas.thumbnil}`
|
||||
)}) 0% 0% / cover no-repeat`,
|
||||
}}
|
||||
>
|
||||
<div className="flex justify-center">{datas.description}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="details-area">
|
||||
<div className="product-two-options flex justify-between mb-5 relative">
|
||||
{/* <div className="status">*/}
|
||||
{/* {datas.isActive && (*/}
|
||||
{/* <span className="text-xs px-3 py-1.5 tracking-wide rounded-full bg-gold text-white">*/}
|
||||
{/* Active*/}
|
||||
{/*</span>*/}
|
||||
{/* )}*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/*<div className=" review flex space-x-2">*/}
|
||||
{/* <button*/}
|
||||
{/* onClick={favoriteHandler}*/}
|
||||
{/* type="button"*/}
|
||||
{/* className={`w-7 h-7 bg-white rounded-full flex justify-center items-center ${*/}
|
||||
{/* addFavorite ? "text-red-500" : "text-thin-light-gray"*/}
|
||||
{/* }`}*/}
|
||||
{/* >*/}
|
||||
{/* <Icons name="star" />*/}
|
||||
{/* </button>*/}
|
||||
{/*</div>*/}
|
||||
</div>
|
||||
|
||||
<div className="flex justify-between">
|
||||
<div className="flex items-center space-x-2">
|
||||
<div>
|
||||
<p className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white">
|
||||
{datas.price * 0.01}
|
||||
{datas.currency} | {datas.timeline_days} day(s)
|
||||
</p>
|
||||
<p className="text-sm text-lighter-gray">
|
||||
( {datas.offer_code})
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
className="px-4 py-2.5 text-white text-sm bg-pink rounded-full tracking-wide"
|
||||
onClick={() => {
|
||||
setMarketPopUp({show: true, data: datas})
|
||||
}}
|
||||
>
|
||||
View
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{marketPopUp.show && (
|
||||
<MarketPopUp
|
||||
details={datas}
|
||||
onClose={() => {
|
||||
setMarketPopUp({ show: false, data: {} });
|
||||
}}
|
||||
situation={marketPopUp.show}
|
||||
marketInt={manageInt}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,27 +1,46 @@
|
||||
import React from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import localImgLoad from "../../lib/localImgLoad";
|
||||
|
||||
export default function HomeBannerOffersCard(props) {
|
||||
console.log("HomeBannerOffersCard->",props.itemData)
|
||||
return (
|
||||
<Link
|
||||
to="/my-collection/collection-item"
|
||||
className="item w-full block group banner-630-340"
|
||||
>
|
||||
<div className="flex flex-col justify-between h-full">
|
||||
<div className="content flex justify-between items-center mb-5">
|
||||
<div>
|
||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
<>{props.itemData.title}</>
|
||||
</h1>
|
||||
</div>
|
||||
{/*<SelectBox datas={filterDatas} action={dataSetHandler} />*/}
|
||||
</div>
|
||||
<div className="h-[233px]">
|
||||
{props.itemData.description}
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
const [imageUrl, setImageUrl] = useState("");
|
||||
const link_result = "/" + props.itemData.link_path;
|
||||
|
||||
useEffect(() => {
|
||||
let { banner, banner_location } = props?.itemData;
|
||||
if (banner_location === "LOCAL") {
|
||||
const imagePath = require(`../../assets/images/${banner}`); // Replace with your directory path for local images
|
||||
console.log("This is local");
|
||||
setImageUrl(imagePath);
|
||||
} else if (banner_location === "URL") setImageUrl(banner);
|
||||
else return null;
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Link
|
||||
to={link_result}
|
||||
className="item w-full block group banner-630-340 bg-cover bg-center"
|
||||
style={{
|
||||
backgroundImage: `url('${imageUrl}')`,
|
||||
}}
|
||||
>
|
||||
<div className="flex flex-col justify-between h-full">
|
||||
<div className="content flex justify-between items-center mb-5">
|
||||
<div className="siderCardHeader">
|
||||
<h1 className="text-2xl font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
<>{props.itemData.title}</>
|
||||
</h1>
|
||||
</div>
|
||||
{/*<SelectBox datas={filterDatas} action={dataSetHandler} />*/}
|
||||
</div>
|
||||
<div className="h-[233px]">
|
||||
<div className="siderCardDescription">
|
||||
{props.itemData.description}
|
||||
</div>
|
||||
<div className="siderCardButton">
|
||||
[ {props.itemData.button_text} ]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,44 +1,59 @@
|
||||
import React, { useState } from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import Layout from "../Partials/Layout";
|
||||
import FamilyManageTabs from "./FamilyManageTabs";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import FamilyManageTabs from "./Tabs/FamilyManageTabs";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
|
||||
export default function FamilyManage() {
|
||||
const [selectTab, setValue] = useState("today");
|
||||
let [pageLoading, setPageLoading] = useState(true);
|
||||
|
||||
let location = useLocation();
|
||||
let accountDetails = location?.state
|
||||
let navigate = useNavigate();
|
||||
let accountDetails = location?.state;
|
||||
// tab handler
|
||||
const filterHandler = (value) => {
|
||||
setValue(value);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!accountDetails) {
|
||||
navigate("/acc-family", { replace: true });
|
||||
} else {
|
||||
setPageLoading(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
{/*<CommonHead />*/}
|
||||
<div className="notification-page w-full mb-10">
|
||||
<div className="notification-wrapper w-full">
|
||||
{/* heading */}
|
||||
<div className="sm:flex justify-between items-center mb-6">
|
||||
<div className="mb-5 sm:mb-0">
|
||||
<h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
|
||||
<span
|
||||
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||
>
|
||||
Manage Family
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
<div className="slider-btns flex space-x-4">
|
||||
<div
|
||||
onClick={() => filterHandler("today")}
|
||||
className="relative"
|
||||
></div>
|
||||
{pageLoading ? (
|
||||
<LoadingSpinner size={8} color="sky-blue" />
|
||||
) : (
|
||||
<div className="notification-page w-full mb-10">
|
||||
<div className="notification-wrapper w-full">
|
||||
{/* heading */}
|
||||
<div className="sm:flex justify-between items-center mb-6">
|
||||
<div className="mb-5 sm:mb-0">
|
||||
<h1 className="text-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
|
||||
<span
|
||||
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||
>
|
||||
Manage Family
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
<div className="slider-btns flex space-x-4">
|
||||
<div
|
||||
onClick={() => filterHandler("today")}
|
||||
className="relative"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<FamilyManageTabs accountDetails={accountDetails} />
|
||||
</div>
|
||||
<FamilyManageTabs accountDetails={accountDetails} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import { useNavigate, useLocation, Link } from "react-router-dom";
|
||||
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
||||
import PaginatedList from "../Pagination/PaginatedList";
|
||||
|
||||
export default function FamilyTable({ className, familyList, loader }) {
|
||||
import familyImage from '../../assets/images/no-family-side.png'
|
||||
|
||||
export default function FamilyTable({ className, familyList, loader, popUpHandler }) {
|
||||
const filterCategories = ["All Categories", "Explore", "Featured"];
|
||||
const [selectedCategory, setCategory] = useState(filterCategories[0]);
|
||||
const navigate = useNavigate();
|
||||
@@ -23,7 +25,7 @@ export default function FamilyTable({ className, familyList, loader }) {
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`update-table w-full h-full p-8 bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow ${
|
||||
className={`update-table w-full h-full p-8 bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow min-h-[520px] ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
@@ -32,9 +34,11 @@ export default function FamilyTable({ className, familyList, loader }) {
|
||||
<div className="h-full min-h-[500px] w-full overflow-hidden flex justify-center items-center">
|
||||
<LoadingSpinner size="16" color="sky-blue" />
|
||||
</div>
|
||||
) : (
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
|
||||
<>
|
||||
)
|
||||
:
|
||||
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>
|
||||
@@ -44,9 +48,7 @@ export default function FamilyTable({ className, familyList, loader }) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="h-full">
|
||||
<>
|
||||
{familyList?.length > 0 ? (
|
||||
currentFamilyList?.map((props, idx) => {
|
||||
{currentFamilyList?.map((props, idx) => {
|
||||
let {
|
||||
firstname,
|
||||
lastname,
|
||||
@@ -115,18 +117,29 @@ export default function FamilyTable({ className, familyList, loader }) {
|
||||
</tr>
|
||||
);
|
||||
})
|
||||
) : (
|
||||
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
<td className="p-2" colSpan="4">
|
||||
No Family Accounts Found!
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
</tbody>
|
||||
</>
|
||||
</table>
|
||||
)}
|
||||
</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="A Family" />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
{/* PAGINATION BUTTON */}
|
||||
<PaginatedList
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import React, { useState } from "react";
|
||||
import dataImage1 from "../../assets/images/data-table-user-1.png";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import { useNavigate, useLocation, Link } from "react-router-dom";
|
||||
|
||||
export default function FamilyTasks({ className, loader }) {
|
||||
return (
|
||||
<div
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow min-h-[520px] max-h-[600px] ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
<div className="relative w-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" />
|
||||
</div>
|
||||
) : (
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
|
||||
|
||||
<tr>
|
||||
<td> Yes This are my tasks </td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
+127
-46
@@ -1,13 +1,17 @@
|
||||
import React, {
|
||||
Suspense,
|
||||
forwardRef,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import profile from "../../assets/images/profile-info-profile.png";
|
||||
import usersService from "../../services/UsersService";
|
||||
import QRCode from "react-qr-code";
|
||||
import { useReactToPrint } from "react-to-print";
|
||||
import usersService from "../../../services/UsersService";
|
||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||
import profile from "../../../assets/images/profile-info-profile.png";
|
||||
import FamilyTasks from "./FamilyTasks";
|
||||
|
||||
export default function FamilyManageTabs({
|
||||
@@ -16,7 +20,16 @@ export default function FamilyManageTabs({
|
||||
listReload,
|
||||
loader,
|
||||
}) {
|
||||
const [familyDetails, setFamilyDetails] = useState(null);
|
||||
const [details, setDetails] = useState({
|
||||
familyDetails: {
|
||||
loading: false,
|
||||
data: null,
|
||||
},
|
||||
familyTasks: {
|
||||
loading: false,
|
||||
data: null,
|
||||
},
|
||||
});
|
||||
const [errMsg, setErrMsg] = useState("");
|
||||
// List of tabs
|
||||
const tabs = [
|
||||
@@ -34,7 +47,6 @@ export default function FamilyManageTabs({
|
||||
},
|
||||
];
|
||||
const [tab, setTab] = useState(tabs[0].name);
|
||||
const [manageLoader, setManageLoader] = useState(false);
|
||||
const tabHandler = (value) => {
|
||||
setTab(value);
|
||||
};
|
||||
@@ -54,28 +66,54 @@ export default function FamilyManageTabs({
|
||||
imgReader.readAsDataURL(e.target.files[0]);
|
||||
}
|
||||
};
|
||||
|
||||
// Api call
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
// function for manage family
|
||||
const familyManageHandler = useCallback(async () => {
|
||||
setManageLoader(true);
|
||||
const manageFamily = useCallback(async () => {
|
||||
try {
|
||||
setDetails({
|
||||
familyDetails: { loading: true },
|
||||
familyTasks: { loading: true },
|
||||
});
|
||||
let { family_uid } = accountDetails;
|
||||
let reqData = { family_uid };
|
||||
let res = await apiCall.ManageFamily(reqData);
|
||||
let { data } = await res;
|
||||
if (data?.internal_return < 0) return;
|
||||
setFamilyDetails(data);
|
||||
setManageLoader(false);
|
||||
|
||||
// the family response
|
||||
const familyRes = await apiCall.ManageFamily(reqData);
|
||||
const familyData = familyRes.data;
|
||||
|
||||
// the tasks response
|
||||
const tasksRes = await apiCall.ManageTasks(reqData);
|
||||
const tasksData = tasksRes.data;
|
||||
|
||||
// checking the internal return
|
||||
if (familyData?.internal_return < 0 || tasksData?.internal_return < 0)
|
||||
return;
|
||||
|
||||
setDetails({
|
||||
familyDetails: { loading: false, data: familyData },
|
||||
familyTasks: { loading: false, data: tasksData },
|
||||
});
|
||||
} catch (error) {
|
||||
setDetails({
|
||||
familyDetails: { loading: false },
|
||||
familyTasks: { loading: false },
|
||||
});
|
||||
setErrMsg("An error occurred");
|
||||
throw new Error(error);
|
||||
}
|
||||
}, [apiCall, accountDetails]);
|
||||
|
||||
useEffect(() => {
|
||||
familyManageHandler();
|
||||
}, [tab]);
|
||||
manageFamily();
|
||||
}, [tab, manageFamily]);
|
||||
|
||||
const accountRef = useRef();
|
||||
// to handle printing
|
||||
const useHandlePrint = useReactToPrint({
|
||||
content: () => accountRef.current,
|
||||
});
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -84,11 +122,13 @@ export default function FamilyManageTabs({
|
||||
}`}
|
||||
>
|
||||
<div className="relative w-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" />
|
||||
</div>
|
||||
) : (
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className="h-full min-h-[500px] w-full overflow-hidden flex justify-center items-center">
|
||||
<LoadingSpinner size="16" color="sky-blue" />
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div className="w-full h-full text-sm text-left text-gray-500 dark:text-gray-400 relative grid grid-cols-4 min-h-[520px]">
|
||||
<div className="border-r border-[#E3E4FE] dark:border-[#a7a9b533] p-6 h-full">
|
||||
<ProfileInfo
|
||||
@@ -99,7 +139,7 @@ export default function FamilyManageTabs({
|
||||
accountDetails={accountDetails}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 p-6 h-full w-full">
|
||||
<div className="col-span-3 justify-self-end h-full w-full">
|
||||
<div className="flex flex-col w-full">
|
||||
<ul className="flex-[0.1] flex gap-2 items-center border-b border-b-[#FAFAF] w-full">
|
||||
{tabs.map(({ name, id }) => (
|
||||
@@ -123,20 +163,25 @@ export default function FamilyManageTabs({
|
||||
<div
|
||||
className={`${
|
||||
tab === name ? "block" : "hidden"
|
||||
} h-full p-4 border border-[#dbd9d9]`}
|
||||
} h-full p-4 border border-[#dbd9d9] relative overflow-y-auto`}
|
||||
key={id}
|
||||
>
|
||||
{manageLoader ? (
|
||||
<LoadingSpinner size="8" color="sky-blue" />
|
||||
) : (
|
||||
<>
|
||||
{name === "Tasks" && <FamilyTasks className={className} loader={loader}/>}
|
||||
{name === "Account" && (
|
||||
<Account familyDetails={familyDetails} />
|
||||
)}
|
||||
{name === "Profile" && <Profile />}
|
||||
</>
|
||||
{name === "Tasks" && (
|
||||
<FamilyTasks
|
||||
className={className}
|
||||
loader={details.familyTasks.loading}
|
||||
familyData={details.familyTasks.data}
|
||||
/>
|
||||
)}
|
||||
{name === "Account" && (
|
||||
<Account
|
||||
familyData={details.familyDetails.data}
|
||||
myRef={accountRef}
|
||||
loader={details.familyDetails.loading}
|
||||
handlePrint={useHandlePrint}
|
||||
/>
|
||||
)}
|
||||
{name === "Profile" && <Profile />}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
@@ -144,7 +189,7 @@ export default function FamilyManageTabs({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Suspense>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -157,7 +202,6 @@ function ProfileInfo({
|
||||
browseProfileImg,
|
||||
accountDetails,
|
||||
}) {
|
||||
let { firstname, lastname, age } = accountDetails;
|
||||
return (
|
||||
<div className="flex flex-col items-center gap-6">
|
||||
<div className="flex justify-center">
|
||||
@@ -198,33 +242,70 @@ function ProfileInfo({
|
||||
</div>
|
||||
<div className="flex flex-col justify-center gap-3 items-center">
|
||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
{firstname}
|
||||
{accountDetails?.firstname}
|
||||
</h1>
|
||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
{lastname}
|
||||
{accountDetails?.lastname}
|
||||
</h1>
|
||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
{age}
|
||||
{accountDetails?.age}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Account({ familyDetails }) {
|
||||
const Account = forwardRef(({ familyData, myRef, handlePrint }, ref) => {
|
||||
return (
|
||||
<div className="w-full lg:min-h-[400px] h-full flex items-center justify-center">
|
||||
<div className="flex flex-col">
|
||||
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
Username: <span className="ml-2 normal-case">{familyDetails?.username}</span>
|
||||
</h2>
|
||||
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
Pin: <span className="ml-2 normal-case">{familyDetails?.pin}</span>
|
||||
</h2>
|
||||
<div
|
||||
className="w-full lg:min-h-[500px] h-full flex flex-col items-center justify-center"
|
||||
ref={myRef}
|
||||
>
|
||||
<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 flex-col">
|
||||
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
Username:{" "}
|
||||
<span className="ml-2 normal-case">
|
||||
{familyData?.username ? familyData?.username : "please wait..."}
|
||||
</span>
|
||||
</h2>
|
||||
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||
Pin:{" "}
|
||||
<span className="ml-2 normal-case">
|
||||
{familyData?.pin ? familyData?.pin : "please wait..."}
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<span className="text-5xl text-gray-400 opacity-20 font-bold">
|
||||
or
|
||||
</span>
|
||||
|
||||
<div className="max-w-[200px]">
|
||||
<p className="text-xl tracking-wide mb-[15px] text-center font-bold text-dark-gray dark:text-white">
|
||||
Scan the code from mobile app
|
||||
</p>
|
||||
<QRCode
|
||||
size={256}
|
||||
style={{ height: "auto", maxWidth: "100%", width: "100%" }}
|
||||
value={`https://www.google.com`}
|
||||
viewBox={`0 0 256 256`}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="h-[50px] w-full flex justify-center items-center">
|
||||
<button
|
||||
className="btn-shine w-[116px] h-[46px] text-white rounded-full text-base bg-pink flex justify-center items-center"
|
||||
onClick={handlePrint}
|
||||
>
|
||||
Print
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
function Profile() {
|
||||
return <>Profile</>;
|
||||
@@ -0,0 +1,142 @@
|
||||
import React, { useState } from "react";
|
||||
import dataImage2 from "../../../assets/images/data-table-user-2.png";
|
||||
import { useNavigate, useLocation } from "react-router-dom";
|
||||
import { handlePagingFunc } from "../../Pagination/HandlePagination";
|
||||
import PaginatedList from "../../Pagination/PaginatedList";
|
||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||
import Icons from "../../Helpers/Icons";
|
||||
|
||||
export default function FamilyTasks({ familyData, className, loader }) {
|
||||
const filterCategories = ["All Categories", "Explore", "Featured"];
|
||||
const [selectedCategory, setCategory] = useState(filterCategories[0]);
|
||||
|
||||
let navigate = useNavigate();
|
||||
let { pathname } = useLocation();
|
||||
|
||||
let data = ["1", "2", "3", "4", "5", "6"]; // to be replaced later by result from API CALL
|
||||
|
||||
const [currentPage, setCurrentPage] = useState(0);
|
||||
const indexOfFirstItem = Number(currentPage);
|
||||
const indexOfLastItem =
|
||||
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||
const currentTask = familyData?.result_list.slice(
|
||||
indexOfFirstItem,
|
||||
indexOfLastItem
|
||||
);
|
||||
|
||||
|
||||
const handlePagination = (e) => {
|
||||
handlePagingFunc(e, setCurrentPage);
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`update-table w-full bg-white dark:bg-dark-white h-full lg:min-h-[450px] overflow-hidden rounded-2xl section-shadow ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
{loader ? (
|
||||
<div className="w-full h-full flex justify-center items-center lg:min-h-[470px]">
|
||||
<LoadingSpinner size={16} color="sky-blue" />
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
{" "}
|
||||
{familyData && familyData?.result_list && (
|
||||
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between h-full">
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<tbody>
|
||||
{
|
||||
<>
|
||||
{familyData &&
|
||||
familyData?.result_list &&
|
||||
familyData.result_list.length > 0 &&
|
||||
currentTask.map((value, index) => {
|
||||
// find due date
|
||||
const dueDate = value?.delivery_date.split(" ")[0]
|
||||
return (
|
||||
<tr
|
||||
key={index}
|
||||
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
||||
>
|
||||
<td className=" py-4">
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] max-w-[60px] min-w-[60px]">
|
||||
<img
|
||||
src={dataImage2}
|
||||
alt="data"
|
||||
className="w-full h-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col flex-[0.9]">
|
||||
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
||||
{value.title}
|
||||
</h1>
|
||||
<div className="flex gap-4 items-center">
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Price:{" "}
|
||||
<span className="text-purple">
|
||||
{value.price * 0.01}
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Duration:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{value.timeline_days} day(s)
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Due Date:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{dueDate}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td className="text-right py-4 px-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
navigate("/manage-active-job", {
|
||||
state: { ...value, pathname },
|
||||
});
|
||||
}}
|
||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
>
|
||||
<Icons name="right-arrow" />
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
})}
|
||||
</>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
{/* PAGINATION BUTTON */}
|
||||
<PaginatedList
|
||||
onClick={handlePagination}
|
||||
prev={currentPage == 0 ? true : false}
|
||||
next={
|
||||
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
|
||||
familyData?.result_list.length
|
||||
? true
|
||||
: false
|
||||
}
|
||||
data={familyData?.result_list}
|
||||
start={indexOfFirstItem}
|
||||
stop={indexOfLastItem}
|
||||
/>
|
||||
{/* END OF PAGINATION BUTTON */}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -158,7 +158,7 @@ export default function FamilyAcc() {
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<FamilyTable familyList={familyList} loader={loader} />
|
||||
<FamilyTable familyList={familyList} loader={loader} popUpHandler={popUpHandler} />
|
||||
</div>
|
||||
</div>
|
||||
{popUp && (
|
||||
|
||||
@@ -468,6 +468,21 @@ export default function Icons({ name }) {
|
||||
>
|
||||
<rect y="0.823242" width="20" height="2.35294" rx="1.17647" />
|
||||
</svg>
|
||||
) : name === "right-arrow" ? (
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
// enableBackground="new 0 0 24 24"
|
||||
viewBox="0 0 24 24"
|
||||
className="fill-black dark:fill-white"
|
||||
id="right-arrow"
|
||||
>
|
||||
<path
|
||||
d="M15.5,11.3L9.9,5.6c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l4.9,4.9l-4.9,4.9c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.6,0.4,1,1,1
|
||||
c0.3,0,0.5-0.1,0.7-0.3l5.7-5.7c0,0,0,0,0,0C15.9,12.3,15.9,11.7,15.5,11.3z"
|
||||
></path>
|
||||
</svg>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
|
||||
@@ -51,8 +51,6 @@ export default function HistoryTable({ className }) {
|
||||
<td className="py-4 text-center">Value</td>
|
||||
<td className="py-4 text-center">USD</td>
|
||||
<td className="py-4 text-center">24H%</td>
|
||||
<td className="py-4 text-center">Bits</td>
|
||||
<td className="py-4 text-center">Time</td>
|
||||
<td className="py-4 text-right">Status</td>
|
||||
</tr>
|
||||
|
||||
@@ -165,16 +163,6 @@ export default function HistoryTable({ className }) {
|
||||
-24.75 (11.5%)
|
||||
</span>
|
||||
</td>
|
||||
<td className="text-right py-4 px-2">
|
||||
<span className="text-base text-dark-gray dark:text-white font-medium">
|
||||
343
|
||||
</span>
|
||||
</td>
|
||||
<td className="text-right py-4 px-2">
|
||||
<span className="text-base text-thin-light-gray">
|
||||
2 Hours 1 min 30s
|
||||
</span>
|
||||
</td>
|
||||
<td className="text-right py-4 px-2">
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -217,7 +217,7 @@ export default function History() {
|
||||
{/* PURCHASE SECTION */}
|
||||
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
|
||||
<div className="wallet w-full md:p-8 p-4 h-full max-h-[700px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
|
||||
<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Purchases</h2>
|
||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">Purchases</h1>
|
||||
{purchaseHistory.loading ?
|
||||
<LoadingSpinner size='16' color='sky-blue' />
|
||||
:
|
||||
@@ -230,7 +230,7 @@ export default function History() {
|
||||
{/* RECENT ACTIVITY SECTION */}
|
||||
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
|
||||
<div className="wallet w-full md:p-8 p-4 h-full max-h-[700px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
|
||||
<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Recent Activity</h2>
|
||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">Recent Activity</h1>
|
||||
{/* <p className='text-base text-slate-500 dark:text-white'>Activity Report</p> */}
|
||||
{paymentHistory.loading ?
|
||||
<LoadingSpinner size='16' color='sky-blue' />
|
||||
|
||||
@@ -1,39 +1,46 @@
|
||||
import React from "react";
|
||||
import datas from "../../data/product_data.json";
|
||||
import Hero from "./Hero";
|
||||
import HomeTaskDisplay from "./HomeTaskDisplay";
|
||||
// import HomeTaskDisplay from "./HomeTaskDisplay";
|
||||
import usersService from "../../services/UsersService";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
|
||||
// import SellHistoryMarketVisitorAnalytic from './SellHistoryMarketVisitorAnalytic';
|
||||
// import TopSellerTopBuyerSliderSection from "./TopSellerTopBuyerSliderSection";
|
||||
//import UpdateTable from "./UpdateTable";
|
||||
import HomeActivities from "./HomeActivities";
|
||||
|
||||
export default function FullAccountDash(props) {
|
||||
console.log("PROPS IN HOME->", props);
|
||||
|
||||
console.log("PROPS IN HOME->",props);
|
||||
const trending = datas.datas;
|
||||
const jobData = datas.datas; // api calls or cache
|
||||
|
||||
const trending = datas.datas;
|
||||
const jobData = datas.datas; // api calls or cache
|
||||
//getHomeDate
|
||||
const userApi = new usersService();
|
||||
const homeData = userApi.getHomeDate();
|
||||
const userApi = new usersService();
|
||||
|
||||
const {userDetails} = useSelector((state) => state?.userDetails)
|
||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="home-page-wrapper">
|
||||
<Hero className="mb-10"
|
||||
data={userDetails}
|
||||
bannerList={props.bannerList}
|
||||
/>
|
||||
<HomeTaskDisplay
|
||||
jobData={jobData}
|
||||
className="mb-10"
|
||||
bannerList={props.bannerList}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<div>
|
||||
<div className="home-page-wrapper">
|
||||
<Hero
|
||||
className="mb-10"
|
||||
data={userDetails}
|
||||
bannerList={props.bannerList}
|
||||
nextDueTask={props.nextDueTask}
|
||||
/>
|
||||
<HomeActivities className="mb-10" />
|
||||
{/*<UpdateTable className="mb-10"/>*/}
|
||||
{/*<SellHistoryMarketVisitorAnalytic className="mb-10"/>*/}
|
||||
{/*<TopSellerTopBuyerSliderSection className="mb-10" />*/}
|
||||
|
||||
{/*<HomeTaskDisplay*/}
|
||||
{/* jobData={jobData}*/}
|
||||
{/* className="mb-10"*/}
|
||||
{/* bannerList={props.bannerList}*/}
|
||||
{/*/>*/}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
// /*
|
||||
// <Layout>
|
||||
@@ -46,10 +53,10 @@ export default function FullAccountDash(props) {
|
||||
// className="mb-10"
|
||||
// bannerList={props.bannerList}
|
||||
// />
|
||||
{/* <SellHistoryMarketVisitorAnalytic className="mb-10"/>
|
||||
{
|
||||
/* <SellHistoryMarketVisitorAnalytic className="mb-10"/>
|
||||
<TopSellerTopBuyerSliderSection className="mb-10" />
|
||||
<UpdateTable className="mb-10"/>*/}
|
||||
<UpdateTable className="mb-10"/>*/
|
||||
}
|
||||
// </div>
|
||||
// </Layout>
|
||||
|
||||
|
||||
|
||||
@@ -3,15 +3,11 @@ import { Link } from "react-router-dom";
|
||||
import { toast } from "react-toastify";
|
||||
import heroBg from "../../assets/images/hero-bg.svg";
|
||||
import heroUser from "../../assets/images/hero-user.png";
|
||||
import slider1 from "../../assets/images/slider-1.jpg";
|
||||
import slider2 from "../../assets/images/slider-2.jpg";
|
||||
import slider3 from "../../assets/images/slider-3.jpg";
|
||||
import CountDown from "../Helpers/CountDown";
|
||||
import SliderCom from "../Helpers/SliderCom";
|
||||
import HomeSliders from "./HomeSliders";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function Hero({ className,bannerList }) {
|
||||
export default function Hero({ className, bannerList, nextDueTask }) {
|
||||
const settings = {
|
||||
autoplay: true,
|
||||
dots: true,
|
||||
@@ -19,23 +15,12 @@ export default function Hero({ className,bannerList }) {
|
||||
infinite: true,
|
||||
swipe: true,
|
||||
};
|
||||
const sildeData =null;
|
||||
const [addFavorite, setValue] = useState(false);
|
||||
const sildeData = null;
|
||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||
|
||||
const {userDetails} = useSelector((state) => state?.userDetails)
|
||||
const favoriteHandler = () => {
|
||||
if (!addFavorite) {
|
||||
setValue(true);
|
||||
toast.success("Added to Favorite List");
|
||||
} else {
|
||||
setValue(false);
|
||||
toast.warn("Remove to Favorite List");
|
||||
}
|
||||
};
|
||||
|
||||
let loginDate = userDetails?.last_login.split(' ')[0]
|
||||
let {firstname, lastname, email, profile_pic} = userDetails
|
||||
let userEmail = email.split('@')[0]
|
||||
let loginDate = userDetails?.last_login.split(" ")[0];
|
||||
let { firstname, lastname, email, profile_pic } = userDetails;
|
||||
let userEmail = email.split("@")[0];
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -55,13 +40,13 @@ export default function Hero({ className,bannerList }) {
|
||||
Welcome
|
||||
</h1>
|
||||
<span className="text-[18px] font-thin tracking-wide text-white">
|
||||
Last Login : {loginDate}
|
||||
Last Login : {loginDate}
|
||||
</span>
|
||||
</div>
|
||||
{/* user */}
|
||||
<div className="flex items-center space-x-3">
|
||||
<div className="w-14 h-14 flex justify-center items-center rounded-full overflow-hidden">
|
||||
<img src={profile_pic != '' ? profile_pic : heroUser} alt="" />
|
||||
<img src={profile_pic != "" ? profile_pic : heroUser} alt="" />
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xl tracking-wide font-bold antise text-white">
|
||||
@@ -71,33 +56,35 @@ export default function Hero({ className,bannerList }) {
|
||||
</div>
|
||||
</div>
|
||||
{/* countdown */}
|
||||
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border border-white-opacity">
|
||||
<div className="flex flex-col justify-between">
|
||||
<p className="text-base text-white tracking-wide">Current Task</p>
|
||||
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
|
||||
ABCDEFGH01
|
||||
</p>
|
||||
<p className="text-base text-white tracking-wide">773.69 USD</p>
|
||||
</div>
|
||||
<div className="w-[1px] h-full bg-white-opacity"></div>
|
||||
<div className="flex flex-col justify-between">
|
||||
<p className="text-base text-white tracking-wide">Next due in</p>
|
||||
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
|
||||
<CountDown lastDate="2023-04-26 4:00:00" />
|
||||
</p>
|
||||
<div className="text-base text-white tracking-wide flex gap-[23px]">
|
||||
<span>Hrs</span>
|
||||
<span>Min</span>
|
||||
<span>Sec</span>
|
||||
{nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length && (
|
||||
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border border-white-opacity">
|
||||
<div className="flex flex-col justify-between">
|
||||
<p className="text-base text-white tracking-wide">Current Task</p>
|
||||
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
|
||||
{nextDueTask.next_due.item_code}
|
||||
</p>
|
||||
<p className="text-base text-white tracking-wide">
|
||||
{nextDueTask.next_due.price} Naira
|
||||
</p>
|
||||
</div>
|
||||
<div className="w-[1px] h-full bg-white-opacity"></div>
|
||||
<div className="flex flex-col justify-between">
|
||||
<p className="text-base text-white tracking-wide">Next due in</p>
|
||||
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
|
||||
{/* <CountDown lastDate="2023-04-26 4:00:00" /> */}
|
||||
<CountDown lastDate={nextDueTask.next_due.due_date} />
|
||||
</p>
|
||||
<div className="text-base text-white tracking-wide flex gap-[23px]">
|
||||
<span>Hrs</span>
|
||||
<span>Min</span>
|
||||
<span>Sec</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{/* action */}
|
||||
<div className="flex lg:space-x-3 space-x-1 items-center">
|
||||
<Link
|
||||
to="/mytask"
|
||||
className="text-white text-base sm:block hidden"
|
||||
>
|
||||
<Link to="/mytask" className="text-white text-base sm:block hidden">
|
||||
<span className=" border-b dark:border-[#5356fb29] border-white">
|
||||
{" "}
|
||||
View All Task(s)
|
||||
@@ -106,9 +93,9 @@ export default function Hero({ className,bannerList }) {
|
||||
</div>
|
||||
</div>
|
||||
<HomeSliders
|
||||
settings={settings}
|
||||
sideData={sildeData}
|
||||
bannerList={bannerList}
|
||||
settings={settings}
|
||||
sideData={sildeData}
|
||||
bannerList={bannerList}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,267 @@
|
||||
import React, { useState } from "react";
|
||||
import dataImage1 from "../../assets/images/data-table-user-1.png";
|
||||
import dataImage2 from "../../assets/images/data-table-user-2.png";
|
||||
import dataImage3 from "../../assets/images/data-table-user-3.png";
|
||||
import dataImage4 from "../../assets/images/data-table-user-4.png";
|
||||
import SelectBox from "../Helpers/SelectBox";
|
||||
|
||||
export default function HomeActivities({ className }) {
|
||||
const filterCategories = ["All Categories", "Explore", "Featured"];
|
||||
const [selectedCategory, setCategory] = useState(filterCategories[0]);
|
||||
return (
|
||||
<div
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow relative min-h-[520px] ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
<div className="header w-full sm:flex justify-between items-center mb-5">
|
||||
<div className="flex space-x-2 items-center mb-2 sm:mb-0">
|
||||
<h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
Recent Activities
|
||||
</h1>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div className="relative w-full overflow-x-auto sm:rounded-lg">
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<tbody>
|
||||
{/* table heading */}
|
||||
{/*<tr className="text-base text-thin-light-gray whitespace-nowrap px-2 border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">*/}
|
||||
{/* <td className="py-4 w-[300px] block whitespace-nowrap">*/}
|
||||
{/* All Product*/}
|
||||
{/* </td>*/}
|
||||
{/* <td className="py-4 whitespace-nowrap text-center">.</td>*/}
|
||||
{/* <td className="py-4 whitespace-nowrap text-center"></td>*/}
|
||||
|
||||
{/* <td className="py-4 whitespace-nowrap text-right"></td>*/}
|
||||
{/*</tr>*/}
|
||||
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||
<td className=" py-4">
|
||||
<div className="flex space-x-2 items-center">
|
||||
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
|
||||
<img
|
||||
src={dataImage1}
|
||||
alt="data"
|
||||
className="w-full h-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
||||
Mullican Computer Joy
|
||||
</h1>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Owned by <span className="text-purple">Xoeyam</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="text-center py-4 px-2">
|
||||
<div className="flex space-x-1 items-center justify-center">
|
||||
<span>
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z"
|
||||
fill="#627EEA"
|
||||
/>
|
||||
<path
|
||||
d="M9.28125 2.25V7.23937L13.4983 9.12375L9.28125 2.25Z"
|
||||
fill="white"
|
||||
fillOpacity="0.602"
|
||||
/>
|
||||
<path
|
||||
d="M9.28012 2.25L5.0625 9.12375L9.28012 7.23937V2.25Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M9.28125 12.3582V15.7483L13.5011 9.91016L9.28125 12.3582Z"
|
||||
fill="white"
|
||||
fillOpacity="0.602"
|
||||
/>
|
||||
<path
|
||||
d="M9.28012 15.7483V12.3576L5.0625 9.91016L9.28012 15.7483Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M9.28125 11.572L13.4983 9.12348L9.28125 7.24023V11.572Z"
|
||||
fill="white"
|
||||
fillOpacity="0.2"
|
||||
/>
|
||||
<path
|
||||
d="M5.0625 9.12348L9.28012 11.572V7.24023L5.0625 9.12348Z"
|
||||
fill="white"
|
||||
fillOpacity="0.602"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap">
|
||||
7473 ETH
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="text-center py-4 px-2">
|
||||
<div className="flex space-x-1 items-center justify-center">
|
||||
<span>
|
||||
<svg
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M7.55225 0C7.8457 0 8.13914 0 8.43205 0C8.44829 0.026534 8.47537 0.0151623 8.49756 0.0162453C9.28966 0.0649812 10.0606 0.220936 10.8013 0.505229C12.7699 1.26172 14.2323 2.58354 15.183 4.46638C15.5999 5.29218 15.8506 6.16997 15.9561 7.08891C15.9691 7.201 15.9621 7.3158 16 7.42465C16 7.80858 16 8.19251 16 8.57698C15.9778 8.5916 15.9854 8.61543 15.9838 8.63546C15.9475 9.10387 15.8744 9.56686 15.7515 10.0206C15.1787 12.1342 13.9524 13.7603 12.0818 14.8942C11.1516 15.4579 10.1397 15.8002 9.06064 15.941C8.89497 15.9626 8.72875 15.98 8.56308 15.9995C8.17217 15.9995 7.78127 15.9995 7.39036 16C7.3752 15.9789 7.35138 15.9865 7.33135 15.9848C6.96752 15.9545 6.60639 15.9009 6.25068 15.8197C4.77639 15.4829 3.48998 14.793 2.4131 13.7311C0.998917 12.3372 0.204656 10.6461 0.0270709 8.66687C0.0205739 8.59431 0.033568 8.51904 0 8.44972C0 8.15081 0 7.85244 0 7.55352C0.0265295 7.53403 0.0151597 7.50479 0.016784 7.47988C0.0730915 6.64162 0.251218 5.83044 0.564158 5.05066C1.10179 3.71043 1.93774 2.59058 3.07634 1.70142C4.33839 0.715876 5.77098 0.159745 7.36762 0.0270755C7.4288 0.0216604 7.49432 0.0341151 7.55225 0ZM7.24635 9.86252C7.24635 10.2383 7.24526 10.6147 7.24743 10.9905C7.24797 11.0457 7.23389 11.0679 7.17596 11.0593C7.09691 11.0479 7.01678 11.0446 6.93774 11.0338C6.26746 10.9461 5.63563 10.7371 5.03952 10.4192C5.00379 10.4002 4.97834 10.3802 4.9621 10.4425C4.81375 11.0176 4.66324 11.5926 4.51164 12.1666C4.50027 12.2094 4.51272 12.2278 4.54954 12.2473C4.66486 12.3096 4.78235 12.3665 4.90309 12.4152C5.5961 12.6968 6.31998 12.8408 7.06497 12.8842C7.14131 12.8885 7.16134 12.9112 7.1608 12.9865C7.15701 13.4159 7.16026 13.8453 7.15809 14.2747C7.15755 14.3397 7.17488 14.3619 7.2431 14.3614C7.69085 14.3581 8.13914 14.3576 8.5869 14.3614C8.66432 14.3619 8.67731 14.3359 8.67731 14.2666C8.67461 13.8026 8.67677 13.3385 8.67461 12.8744C8.67407 12.8089 8.68544 12.7786 8.76015 12.765C9.09962 12.7049 9.4288 12.6058 9.74228 12.4607C10.3498 12.1802 10.8408 11.7703 11.1603 11.1724C11.4288 10.6699 11.51 10.1327 11.4618 9.56957C11.4158 9.03239 11.2366 8.55207 10.8787 8.14431C10.5506 7.77121 10.1402 7.51129 9.69843 7.29522C9.39145 7.14523 9.07363 7.02284 8.75041 6.91129C8.7098 6.89721 8.67407 6.88693 8.67407 6.82736C8.67623 6.14993 8.67569 5.4725 8.67461 4.79507C8.67461 4.75121 8.68489 4.73117 8.73308 4.73767C8.87547 4.75717 9.01895 4.77016 9.16134 4.79236C9.634 4.86493 10.0796 5.02467 10.5116 5.22395C10.5717 5.25157 10.5945 5.24886 10.6123 5.17684C10.7434 4.6467 10.8771 4.1171 11.0162 3.58913C11.0379 3.5079 11.0244 3.47541 10.948 3.44076C10.2799 3.13751 9.57282 3.01025 8.8457 2.97614C8.78018 2.97289 8.76123 2.95556 8.76178 2.88896C8.76503 2.50232 8.76232 2.11568 8.76448 1.72904C8.76503 1.66785 8.75041 1.64727 8.68489 1.64727C8.23173 1.64998 7.77802 1.64998 7.32485 1.64727C7.26151 1.64673 7.24418 1.66406 7.24418 1.72742C7.24689 2.1433 7.24256 2.55972 7.24797 2.9756C7.24905 3.06116 7.2209 3.08661 7.14239 3.10285C6.73579 3.18679 6.34651 3.32271 5.98646 3.53281C5.20628 3.98822 4.72117 4.64724 4.61938 5.5586C4.51597 6.48837 4.83812 7.2427 5.57661 7.81778C6.05739 8.19251 6.60639 8.43781 7.1738 8.64683C7.2274 8.66633 7.24743 8.68907 7.24689 8.7481C7.24472 9.12066 7.24635 9.49159 7.24635 9.86252Z"
|
||||
fill="#59BE59"
|
||||
/>
|
||||
<path
|
||||
d="M7.2452 9.86252C7.2452 9.49158 7.24358 9.12119 7.24683 8.75026C7.24737 8.69123 7.22734 8.66903 7.17374 8.64899C6.60687 8.43997 6.05787 8.19467 5.57655 7.81994C4.8386 7.24486 4.51591 6.49053 4.61933 5.56076C4.72057 4.6494 5.20568 3.99092 5.98641 3.53497C6.34645 3.32486 6.73519 3.18894 7.14233 3.10501C7.22084 3.08876 7.24899 3.06277 7.24791 2.97775C7.2425 2.56187 7.24683 2.14545 7.24412 1.72957C7.24358 1.66621 7.2609 1.64888 7.32479 1.64943C7.77796 1.65213 8.23167 1.65213 8.68483 1.64943C8.7498 1.64888 8.76442 1.66946 8.76442 1.73119C8.76171 2.11783 8.76496 2.50447 8.76171 2.89111C8.76117 2.95717 8.78012 2.97504 8.84563 2.97829C9.57276 3.01295 10.2793 3.13966 10.948 3.44291C11.0243 3.47757 11.0373 3.51006 11.0162 3.59128C10.877 4.11926 10.7433 4.64885 10.6123 5.17899C10.5944 5.25156 10.5717 5.25372 10.5116 5.2261C10.079 5.02683 9.63394 4.86708 9.16128 4.79452C9.01889 4.77286 8.87595 4.75932 8.73302 4.73983C8.68483 4.73333 8.67455 4.75337 8.67455 4.79723C8.67563 5.47466 8.67617 6.15209 8.674 6.82952C8.674 6.88908 8.70974 6.89937 8.75034 6.91345C9.07303 7.02446 9.39138 7.14684 9.69837 7.29738C10.1396 7.51344 10.5506 7.77283 10.8787 8.14647C11.2365 8.55369 11.4157 9.03455 11.4618 9.57173C11.51 10.1349 11.4287 10.6726 11.1602 11.1746C10.8408 11.7724 10.3497 12.1818 9.74222 12.4629C9.42874 12.608 9.09956 12.7071 8.76009 12.7672C8.68483 12.7802 8.674 12.811 8.67455 12.8766C8.67671 13.3406 8.67455 13.8047 8.67725 14.2688C8.67779 14.3381 8.66426 14.3646 8.58684 14.3636C8.13908 14.3598 7.69079 14.3608 7.24304 14.3636C7.17536 14.3641 7.15803 14.3424 7.15803 14.2769C7.1602 13.8475 7.15695 13.4181 7.16074 12.9887C7.16128 12.9128 7.14179 12.8906 7.06491 12.8863C6.31992 12.843 5.59658 12.699 4.90303 12.4174C4.78229 12.3681 4.66426 12.3112 4.54948 12.2495C4.51321 12.23 4.50075 12.2116 4.51158 12.1688C4.66318 11.5943 4.81369 11.0197 4.96204 10.4446C4.97829 10.3824 5.00373 10.4024 5.03947 10.4214C5.63557 10.7387 6.2674 10.9477 6.93768 11.036C7.01672 11.0463 7.09685 11.0501 7.1759 11.0614C7.23383 11.0695 7.24737 11.0479 7.24737 10.9927C7.24412 10.6147 7.2452 10.2383 7.2452 9.86252ZM8.68537 9.36325C8.67942 9.37245 8.67455 9.37678 8.67455 9.38112C8.674 9.83978 8.67401 10.2984 8.67292 10.7571C8.67292 10.8177 8.70216 10.7928 8.72598 10.7755C8.82452 10.7046 8.90736 10.619 8.96691 10.5123C9.17698 10.1333 9.05679 9.63725 8.68537 9.36325ZM7.23871 6.11147C7.23871 5.75354 7.23871 5.40589 7.23871 5.05174C6.92522 5.33982 6.92522 5.77249 7.23871 6.11147Z"
|
||||
fill="#FEFEFE"
|
||||
/>
|
||||
<path
|
||||
d="M8.68433 9.36328C9.05574 9.63729 9.17539 10.1333 8.96586 10.5118C8.90631 10.619 8.82347 10.7046 8.72493 10.775C8.70111 10.7918 8.67188 10.8172 8.67188 10.7566C8.67242 10.2979 8.67296 9.83927 8.6735 9.38061C8.67404 9.37682 8.67891 9.37249 8.68433 9.36328Z"
|
||||
fill="#59BE59"
|
||||
/>
|
||||
<path
|
||||
d="M7.23882 6.11149C6.92533 5.77305 6.92587 5.33984 7.23882 5.05176C7.23882 5.40591 7.23882 5.75355 7.23882 6.11149Z"
|
||||
fill="#59BE59"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
<span className="text-base text-dark-gray dark:text-white font-medium">
|
||||
6392.99$
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td className="text-right py-4">
|
||||
<button
|
||||
type="button"
|
||||
className="text-sm text-white bg-purple px-2.5 py-1.5 rounded-full"
|
||||
>
|
||||
Active
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||
<td className=" py-4">
|
||||
<div className="flex space-x-2 items-center">
|
||||
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
|
||||
<img
|
||||
src={dataImage2}
|
||||
alt="data"
|
||||
className="w-full h-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
||||
Mullican Computer Joy
|
||||
</h1>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Owned by <span className="text-purple">Xoeyam</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="text-center py-4 px-2">
|
||||
<div className="flex space-x-1 items-center justify-center">
|
||||
<span>
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z"
|
||||
fill="#627EEA"
|
||||
/>
|
||||
<path
|
||||
d="M9.28125 2.25V7.23937L13.4983 9.12375L9.28125 2.25Z"
|
||||
fill="white"
|
||||
fillOpacity="0.602"
|
||||
/>
|
||||
<path
|
||||
d="M9.28012 2.25L5.0625 9.12375L9.28012 7.23937V2.25Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M9.28125 12.3582V15.7483L13.5011 9.91016L9.28125 12.3582Z"
|
||||
fill="white"
|
||||
fillOpacity="0.602"
|
||||
/>
|
||||
<path
|
||||
d="M9.28012 15.7483V12.3576L5.0625 9.91016L9.28012 15.7483Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M9.28125 11.572L13.4983 9.12348L9.28125 7.24023V11.572Z"
|
||||
fill="white"
|
||||
fillOpacity="0.2"
|
||||
/>
|
||||
<path
|
||||
d="M5.0625 9.12348L9.28012 11.572V7.24023L5.0625 9.12348Z"
|
||||
fill="white"
|
||||
fillOpacity="0.602"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap">
|
||||
7473 ETH
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="text-center py-4 px-2">
|
||||
<div className="flex space-x-1 items-center justify-center">
|
||||
<span>
|
||||
<svg
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M7.55225 0C7.8457 0 8.13914 0 8.43205 0C8.44829 0.026534 8.47537 0.0151623 8.49756 0.0162453C9.28966 0.0649812 10.0606 0.220936 10.8013 0.505229C12.7699 1.26172 14.2323 2.58354 15.183 4.46638C15.5999 5.29218 15.8506 6.16997 15.9561 7.08891C15.9691 7.201 15.9621 7.3158 16 7.42465C16 7.80858 16 8.19251 16 8.57698C15.9778 8.5916 15.9854 8.61543 15.9838 8.63546C15.9475 9.10387 15.8744 9.56686 15.7515 10.0206C15.1787 12.1342 13.9524 13.7603 12.0818 14.8942C11.1516 15.4579 10.1397 15.8002 9.06064 15.941C8.89497 15.9626 8.72875 15.98 8.56308 15.9995C8.17217 15.9995 7.78127 15.9995 7.39036 16C7.3752 15.9789 7.35138 15.9865 7.33135 15.9848C6.96752 15.9545 6.60639 15.9009 6.25068 15.8197C4.77639 15.4829 3.48998 14.793 2.4131 13.7311C0.998917 12.3372 0.204656 10.6461 0.0270709 8.66687C0.0205739 8.59431 0.033568 8.51904 0 8.44972C0 8.15081 0 7.85244 0 7.55352C0.0265295 7.53403 0.0151597 7.50479 0.016784 7.47988C0.0730915 6.64162 0.251218 5.83044 0.564158 5.05066C1.10179 3.71043 1.93774 2.59058 3.07634 1.70142C4.33839 0.715876 5.77098 0.159745 7.36762 0.0270755C7.4288 0.0216604 7.49432 0.0341151 7.55225 0ZM7.24635 9.86252C7.24635 10.2383 7.24526 10.6147 7.24743 10.9905C7.24797 11.0457 7.23389 11.0679 7.17596 11.0593C7.09691 11.0479 7.01678 11.0446 6.93774 11.0338C6.26746 10.9461 5.63563 10.7371 5.03952 10.4192C5.00379 10.4002 4.97834 10.3802 4.9621 10.4425C4.81375 11.0176 4.66324 11.5926 4.51164 12.1666C4.50027 12.2094 4.51272 12.2278 4.54954 12.2473C4.66486 12.3096 4.78235 12.3665 4.90309 12.4152C5.5961 12.6968 6.31998 12.8408 7.06497 12.8842C7.14131 12.8885 7.16134 12.9112 7.1608 12.9865C7.15701 13.4159 7.16026 13.8453 7.15809 14.2747C7.15755 14.3397 7.17488 14.3619 7.2431 14.3614C7.69085 14.3581 8.13914 14.3576 8.5869 14.3614C8.66432 14.3619 8.67731 14.3359 8.67731 14.2666C8.67461 13.8026 8.67677 13.3385 8.67461 12.8744C8.67407 12.8089 8.68544 12.7786 8.76015 12.765C9.09962 12.7049 9.4288 12.6058 9.74228 12.4607C10.3498 12.1802 10.8408 11.7703 11.1603 11.1724C11.4288 10.6699 11.51 10.1327 11.4618 9.56957C11.4158 9.03239 11.2366 8.55207 10.8787 8.14431C10.5506 7.77121 10.1402 7.51129 9.69843 7.29522C9.39145 7.14523 9.07363 7.02284 8.75041 6.91129C8.7098 6.89721 8.67407 6.88693 8.67407 6.82736C8.67623 6.14993 8.67569 5.4725 8.67461 4.79507C8.67461 4.75121 8.68489 4.73117 8.73308 4.73767C8.87547 4.75717 9.01895 4.77016 9.16134 4.79236C9.634 4.86493 10.0796 5.02467 10.5116 5.22395C10.5717 5.25157 10.5945 5.24886 10.6123 5.17684C10.7434 4.6467 10.8771 4.1171 11.0162 3.58913C11.0379 3.5079 11.0244 3.47541 10.948 3.44076C10.2799 3.13751 9.57282 3.01025 8.8457 2.97614C8.78018 2.97289 8.76123 2.95556 8.76178 2.88896C8.76503 2.50232 8.76232 2.11568 8.76448 1.72904C8.76503 1.66785 8.75041 1.64727 8.68489 1.64727C8.23173 1.64998 7.77802 1.64998 7.32485 1.64727C7.26151 1.64673 7.24418 1.66406 7.24418 1.72742C7.24689 2.1433 7.24256 2.55972 7.24797 2.9756C7.24905 3.06116 7.2209 3.08661 7.14239 3.10285C6.73579 3.18679 6.34651 3.32271 5.98646 3.53281C5.20628 3.98822 4.72117 4.64724 4.61938 5.5586C4.51597 6.48837 4.83812 7.2427 5.57661 7.81778C6.05739 8.19251 6.60639 8.43781 7.1738 8.64683C7.2274 8.66633 7.24743 8.68907 7.24689 8.7481C7.24472 9.12066 7.24635 9.49159 7.24635 9.86252Z"
|
||||
fill="#59BE59"
|
||||
/>
|
||||
<path
|
||||
d="M7.2452 9.86252C7.2452 9.49158 7.24358 9.12119 7.24683 8.75026C7.24737 8.69123 7.22734 8.66903 7.17374 8.64899C6.60687 8.43997 6.05787 8.19467 5.57655 7.81994C4.8386 7.24486 4.51591 6.49053 4.61933 5.56076C4.72057 4.6494 5.20568 3.99092 5.98641 3.53497C6.34645 3.32486 6.73519 3.18894 7.14233 3.10501C7.22084 3.08876 7.24899 3.06277 7.24791 2.97775C7.2425 2.56187 7.24683 2.14545 7.24412 1.72957C7.24358 1.66621 7.2609 1.64888 7.32479 1.64943C7.77796 1.65213 8.23167 1.65213 8.68483 1.64943C8.7498 1.64888 8.76442 1.66946 8.76442 1.73119C8.76171 2.11783 8.76496 2.50447 8.76171 2.89111C8.76117 2.95717 8.78012 2.97504 8.84563 2.97829C9.57276 3.01295 10.2793 3.13966 10.948 3.44291C11.0243 3.47757 11.0373 3.51006 11.0162 3.59128C10.877 4.11926 10.7433 4.64885 10.6123 5.17899C10.5944 5.25156 10.5717 5.25372 10.5116 5.2261C10.079 5.02683 9.63394 4.86708 9.16128 4.79452C9.01889 4.77286 8.87595 4.75932 8.73302 4.73983C8.68483 4.73333 8.67455 4.75337 8.67455 4.79723C8.67563 5.47466 8.67617 6.15209 8.674 6.82952C8.674 6.88908 8.70974 6.89937 8.75034 6.91345C9.07303 7.02446 9.39138 7.14684 9.69837 7.29738C10.1396 7.51344 10.5506 7.77283 10.8787 8.14647C11.2365 8.55369 11.4157 9.03455 11.4618 9.57173C11.51 10.1349 11.4287 10.6726 11.1602 11.1746C10.8408 11.7724 10.3497 12.1818 9.74222 12.4629C9.42874 12.608 9.09956 12.7071 8.76009 12.7672C8.68483 12.7802 8.674 12.811 8.67455 12.8766C8.67671 13.3406 8.67455 13.8047 8.67725 14.2688C8.67779 14.3381 8.66426 14.3646 8.58684 14.3636C8.13908 14.3598 7.69079 14.3608 7.24304 14.3636C7.17536 14.3641 7.15803 14.3424 7.15803 14.2769C7.1602 13.8475 7.15695 13.4181 7.16074 12.9887C7.16128 12.9128 7.14179 12.8906 7.06491 12.8863C6.31992 12.843 5.59658 12.699 4.90303 12.4174C4.78229 12.3681 4.66426 12.3112 4.54948 12.2495C4.51321 12.23 4.50075 12.2116 4.51158 12.1688C4.66318 11.5943 4.81369 11.0197 4.96204 10.4446C4.97829 10.3824 5.00373 10.4024 5.03947 10.4214C5.63557 10.7387 6.2674 10.9477 6.93768 11.036C7.01672 11.0463 7.09685 11.0501 7.1759 11.0614C7.23383 11.0695 7.24737 11.0479 7.24737 10.9927C7.24412 10.6147 7.2452 10.2383 7.2452 9.86252ZM8.68537 9.36325C8.67942 9.37245 8.67455 9.37678 8.67455 9.38112C8.674 9.83978 8.67401 10.2984 8.67292 10.7571C8.67292 10.8177 8.70216 10.7928 8.72598 10.7755C8.82452 10.7046 8.90736 10.619 8.96691 10.5123C9.17698 10.1333 9.05679 9.63725 8.68537 9.36325ZM7.23871 6.11147C7.23871 5.75354 7.23871 5.40589 7.23871 5.05174C6.92522 5.33982 6.92522 5.77249 7.23871 6.11147Z"
|
||||
fill="#FEFEFE"
|
||||
/>
|
||||
<path
|
||||
d="M8.68433 9.36328C9.05574 9.63729 9.17539 10.1333 8.96586 10.5118C8.90631 10.619 8.82347 10.7046 8.72493 10.775C8.70111 10.7918 8.67188 10.8172 8.67188 10.7566C8.67242 10.2979 8.67296 9.83927 8.6735 9.38061C8.67404 9.37682 8.67891 9.37249 8.68433 9.36328Z"
|
||||
fill="#59BE59"
|
||||
/>
|
||||
<path
|
||||
d="M7.23882 6.11149C6.92533 5.77305 6.92587 5.33984 7.23882 5.05176C7.23882 5.40591 7.23882 5.75355 7.23882 6.11149Z"
|
||||
fill="#59BE59"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
<span className="text-base text-dark-gray dark:text-white font-medium">
|
||||
6392.99$
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td className="text-right py-4">
|
||||
<button
|
||||
type="button"
|
||||
className="text-sm text-white bg-light-green px-2.5 py-1.5 rounded-full"
|
||||
>
|
||||
Complated
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,37 +1,32 @@
|
||||
import SliderCom from "../Helpers/SliderCom";
|
||||
import slider1 from "../../assets/images/slider-1.jpg";
|
||||
import slider2 from "../../assets/images/slider-2.jpg";
|
||||
import slider3 from "../../assets/images/slider-3.jpg";
|
||||
import HomeBannerOffersCard from "../Cards/HomeBannerOffersCard";
|
||||
|
||||
|
||||
export default function HomeSliders(props) {
|
||||
console.log("BANNER LIST IN HomeSliders->",props.bannerList);
|
||||
// debugger;
|
||||
return (
|
||||
<>
|
||||
<div className="hero-slider relative 2xl:w-[600px] xl:w-[500px] lg:w-[420px] w-full mb-2 lg:mb-0 ">
|
||||
<div className="w-full">
|
||||
<SliderCom settings={props.settings}>
|
||||
{/*<div className="item w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden">*/}
|
||||
{/* <img src={slider1} alt="slider" className="w-full h-full" />*/}
|
||||
{/*</div>*/}
|
||||
<div className="item w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden">
|
||||
<img src={slider2} alt="slider" className="w-full h-full" />
|
||||
</div>
|
||||
<div className="item w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden">
|
||||
<img src={slider3} alt="slider" className="w-full h-full" />
|
||||
</div>
|
||||
{props.bannerList.map((item, index) => (
|
||||
<div className="item w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden">
|
||||
<HomeBannerOffersCard
|
||||
itemData={item}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</SliderCom>
|
||||
// console.log("BANNER LIST IN HomeSliders->", props.bannerList);
|
||||
// debugger;
|
||||
return (
|
||||
<>
|
||||
<div className="hero-slider relative 2xl:w-[600px] xl:w-[500px] lg:w-[420px] w-full mb-2 lg:mb-0 ">
|
||||
<div className="w-full">
|
||||
<SliderCom settings={props.settings}>
|
||||
{props.bannerList?.length <= 0 && (
|
||||
<div className="item w-full h-full bg-white dark:bg-dark-white max-h-80 rounded-2xl overflow-hidden">
|
||||
<img src={slider2} alt="slider" className="w-full h-full" />
|
||||
</div>
|
||||
)}
|
||||
{props.bannerList?.length > 0 &&
|
||||
props.bannerList.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="item w-full h-full bg-white dark:bg-dark-white rounded-2xl overflow-hidden"
|
||||
>
|
||||
<HomeBannerOffersCard itemData={item} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
))}
|
||||
</SliderCom>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import datas from "../../data/product_data.json";
|
||||
import Layout from "../Partials/Layout";
|
||||
import usersService from "../../services/UsersService";
|
||||
@@ -6,35 +6,51 @@ import { useSelector } from "react-redux";
|
||||
import FamilyDash from "./FamilyDash";
|
||||
import FullAccountDash from "./FullAccountDash";
|
||||
|
||||
|
||||
export default function Home(props) {
|
||||
console.log("PROPS IN HOME->", props);
|
||||
|
||||
console.log("PROPS IN HOME->",props);
|
||||
let [nextDueTask, setNextDueTask] = useState({});
|
||||
|
||||
// const trending = datas.datas;
|
||||
// const jobData = datas.datas; // api calls or cache
|
||||
const userApi = new usersService();
|
||||
// const homeData = userApi.getHomeDate();
|
||||
const {userDetails} = useSelector((state) => state?.userDetails)
|
||||
const userApi = new usersService();
|
||||
|
||||
const commonHeadData =()=>{
|
||||
console.log("COMMON HEAD DATA INDEX ----------------=====---------------------");
|
||||
return 0;
|
||||
}
|
||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<div className="home-page-wrapper">
|
||||
{userDetails && userDetails?.account_type == "FAMILY" && (
|
||||
<FamilyDash commonHeadData={commonHeadData} />
|
||||
)}
|
||||
{userDetails && userDetails?.account_type == "FULL" && (
|
||||
<FullAccountDash bannerList={props.bannerList} />
|
||||
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
||||
|
||||
)}
|
||||
</div>
|
||||
</Layout>
|
||||
);
|
||||
// FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
|
||||
const getHomeDate = () => {
|
||||
userApi
|
||||
.getHomeDate()
|
||||
.then((res) => {
|
||||
if (res.status != 200 || res.internal_return < 0) {
|
||||
return;
|
||||
}
|
||||
setNextDueTask(res.data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getHomeDate();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<div className="home-page-wrapper">
|
||||
{userDetails && userDetails?.account_type == "FAMILY" && (
|
||||
<FamilyDash commonHeadData={props.bannerList} />
|
||||
)}
|
||||
{userDetails && userDetails?.account_type == "FULL" && (
|
||||
<FullAccountDash
|
||||
nextDueTask={nextDueTask}
|
||||
bannerList={props.bannerList}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
// /*
|
||||
// <Layout>
|
||||
@@ -47,10 +63,10 @@ export default function Home(props) {
|
||||
// className="mb-10"
|
||||
// bannerList={props.bannerList}
|
||||
// />
|
||||
{/* <SellHistoryMarketVisitorAnalytic className="mb-10"/>
|
||||
{
|
||||
/* <SellHistoryMarketVisitorAnalytic className="mb-10"/>
|
||||
<TopSellerTopBuyerSliderSection className="mb-10" />
|
||||
<UpdateTable className="mb-10"/>*/}
|
||||
<UpdateTable className="mb-10"/>*/
|
||||
}
|
||||
// </div>
|
||||
// </Layout>
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import DataIteration from "../Helpers/DataIteration";
|
||||
import AvailableJobsCard from "../Cards/AvailableJobsCard";
|
||||
|
||||
export default function MainSection({ className, marketPlaceProduct }) {
|
||||
const [tab, setTab] = useState("explore");
|
||||
const [tab, setTab] = useState("all");
|
||||
const [products, setProducts] = useState(marketPlaceProduct);
|
||||
const tabHandler = (value) => {
|
||||
setTab(value);
|
||||
@@ -29,15 +29,17 @@ export default function MainSection({ className, marketPlaceProduct }) {
|
||||
<div className="tab-item lg:mb-0 mb-5">
|
||||
<div className="md:flex md:space-x-8 space-x-2">
|
||||
<span
|
||||
onClick={() => tabHandler("explore")}
|
||||
onClick={() => tabHandler("all")}
|
||||
className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${
|
||||
tab === "explore"
|
||||
tab === "all"
|
||||
? "text-pink border-pink"
|
||||
: " border-transparent"
|
||||
}`}
|
||||
>
|
||||
Explore
|
||||
All
|
||||
</span>
|
||||
|
||||
|
||||
<span
|
||||
onClick={() => tabHandler("artist")}
|
||||
className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${
|
||||
@@ -78,6 +80,8 @@ export default function MainSection({ className, marketPlaceProduct }) {
|
||||
>
|
||||
Game Assets
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,290 @@
|
||||
import React, { useCallback, useMemo, useState } from "react";
|
||||
import ModalCom from "../../Helpers/ModalCom";
|
||||
import { toast } from "react-toastify";
|
||||
import { Form, Formik } from "formik";
|
||||
import usersService from "../../../services/UsersService";
|
||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||
|
||||
const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
||||
const [marketMsg, setMarketMsg] = useState({
|
||||
loading: false,
|
||||
data: {},
|
||||
state: undefined,
|
||||
});
|
||||
const [manageInt, setManageInt] = useState({
|
||||
loading: false,
|
||||
data: {},
|
||||
state: undefined,
|
||||
msg: "",
|
||||
});
|
||||
|
||||
const [textValue, setTextValue] = useState("");
|
||||
|
||||
const handleInputChange = ({ target: { value } }) => {
|
||||
setTextValue(value);
|
||||
};
|
||||
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
|
||||
const marketCalls = useCallback(
|
||||
async (e) => {
|
||||
try {
|
||||
const nameOfCall = e?.target?.name;
|
||||
const { offer_code } = details;
|
||||
const reqData = { offer_code };
|
||||
|
||||
if (nameOfCall === "market-message") {
|
||||
setMarketMsg({ loading: true });
|
||||
if (!textValue) return;
|
||||
|
||||
reqData.yourmessage = textValue;
|
||||
|
||||
const marketMessage = await apiCall.MarketMessage(reqData);
|
||||
const marketMessageRes = marketMessage?.data;
|
||||
|
||||
if (marketMessageRes?.internal_return < 0) {
|
||||
toast.warn("Something wrong happened", {
|
||||
autoClose: 2000,
|
||||
hideProgressBar: true,
|
||||
});
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
|
||||
toast.success("Message sent", {
|
||||
autoClose: 2500,
|
||||
hideProgressBar: true,
|
||||
});
|
||||
|
||||
setMarketMsg({ data: marketMessageRes, state: true });
|
||||
setTimeout(() => onClose(), 2000);
|
||||
} else {
|
||||
setManageInt({ loading: true });
|
||||
|
||||
const manageInt = await apiCall.MarketInterest(reqData);
|
||||
const manageIntRes = manageInt?.data;
|
||||
|
||||
if (manageIntRes?.internal_return < 0) {
|
||||
setManageInt({
|
||||
loading: false,
|
||||
msg: `Error - ${manageIntRes?.status}`,
|
||||
data: manageIntRes,
|
||||
state: false,
|
||||
});
|
||||
} else {
|
||||
setManageInt({
|
||||
loading: false,
|
||||
msg: manageIntRes?.status,
|
||||
data: manageIntRes,
|
||||
state: true,
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(() => setManageInt({ msg: "" }), 3000);
|
||||
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error(error);
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
setTextValue("");
|
||||
setMarketMsg({ loading: false });
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
[apiCall, details, onClose, textValue]
|
||||
);
|
||||
|
||||
console.log('Checking my mangeInt',manageInt)
|
||||
|
||||
// let addedIntDate = marketInt?.added?.split(" ")[0];
|
||||
let expireIntDate = marketInt?.expire?.split(" ")[0];
|
||||
|
||||
return (
|
||||
<ModalCom action={onClose} situation={situation} className="edit-popup">
|
||||
<div className="logout-modal-wrapper md:w-[750px] md:h-[700px] h-full bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px]">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
{details.offer_code}
|
||||
</h1>
|
||||
<CloseIcon onClose={onClose} />
|
||||
</div>
|
||||
|
||||
<div className="md:flex bg-white rounded-lg">
|
||||
<div className="p-4 w-full md:w-3/4 md:border-r-1">
|
||||
<div className="min-h-[290px]">
|
||||
<h2 className="font-semibold text-slate-900 dark:text-black tracking-wide">
|
||||
{details?.title}
|
||||
</h2>
|
||||
|
||||
{/* INPUT SECTION */}
|
||||
{[
|
||||
{
|
||||
name: "Description",
|
||||
content: details.description,
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
content: {
|
||||
text: `Timeline: ${details.timeline_days} day(s) -- `,
|
||||
bold: `Budget: ${details.price} naira`,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Delivery Detail",
|
||||
content: details.job_description,
|
||||
danger: true,
|
||||
},
|
||||
].map(({ name, content, danger }, idx) => (
|
||||
<div className={`my-3 md:flex items-center`} key={idx}>
|
||||
<label className="w-full md:w-1/4 text-slate-900 tracking-wide font-semibold">
|
||||
{name}
|
||||
</label>
|
||||
<div
|
||||
className={`w-full md:w-3/4 text-slate-900 market-pop ${
|
||||
name !== "Delivery Detail"
|
||||
? " h-full max-h-28 flex items-center"
|
||||
: " overflow-y-auto max-h-[100px]"
|
||||
}`}
|
||||
>
|
||||
{danger ? (
|
||||
<p
|
||||
className={``}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: danger && content?.replace(/"/g, ""),
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<p className={`w-full md:w-3/4 text-slate-900`}>
|
||||
{name !== "Delivery Detail" ? (
|
||||
<>
|
||||
{typeof content !== "object" ? content : null}
|
||||
{typeof content === "object" && (
|
||||
<span className="flex items-center gap-2">
|
||||
{content?.text}
|
||||
<strong>{content?.bold}</strong>
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<hr />
|
||||
<div className="my-3 w-full flex flex-col gap-3">
|
||||
<div className="w-full">
|
||||
<label className="w-full text-slate-900 tracking-wide">
|
||||
If you have any questions about this task:
|
||||
</label>
|
||||
<textarea
|
||||
className={`p-1 w-full text-sm text-slate-900 outline-none border border-slate-300 rounded-md`}
|
||||
rows="5"
|
||||
style={{ resize: "none" }}
|
||||
placeholder="Enter message here ..."
|
||||
value={textValue}
|
||||
onChange={handleInputChange}
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
className="self-end w-[150px] h-[52px] rounded-md text-base bg-yellow-500 text-white"
|
||||
name="market-message"
|
||||
onClick={marketCalls}
|
||||
>
|
||||
{marketMsg.loading ? (
|
||||
<LoadingSpinner size={5} color="white" />
|
||||
) : !marketMsg.state ? (
|
||||
"Send Message"
|
||||
) : (
|
||||
"Message Sent"
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="w-full md:w-1/4 h-full ">
|
||||
<div className="w-[90%] mx-auto bg-[#f1f8ff] p-4 rounded-md md:min-h-[550px] flex flex-col justify-between">
|
||||
<div className="w-full flex flex-col justify-center py-4 gap-2">
|
||||
<p className="w-full text-slate-900 tracking-wide my-1">
|
||||
Interested in the task?
|
||||
</p>
|
||||
<hr />
|
||||
<button
|
||||
className="bg-[#57cd89] text-center text-lg font-semibold text-white py-2 px-4 rounded-md inline-flex flex-col items-center justify-center"
|
||||
name="market-interest"
|
||||
onClick={marketCalls}
|
||||
>
|
||||
{" "}
|
||||
<span>Send</span>
|
||||
<span>Interest</span>
|
||||
<span>Request</span>
|
||||
</button>
|
||||
<>
|
||||
{manageInt.loading ? (
|
||||
<p className="text-sm italic">please wait...</p>
|
||||
) : (
|
||||
<>
|
||||
{manageInt?.msg !== "" && (
|
||||
<p
|
||||
className={`text-sm italic ${
|
||||
manageInt?.state ? "text-green-500" : "text-red-500"
|
||||
}`}
|
||||
>
|
||||
{manageInt?.msg}
|
||||
</p>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
</div>
|
||||
|
||||
<div className="">
|
||||
<p className="flex items-center tracking-wide">
|
||||
Interest: <b className="ml-1">{details.interest_count}</b>
|
||||
</p>
|
||||
<hr />
|
||||
<p className="my-1">Expire: {expireIntDate}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* END OF ACTION SECTION */}
|
||||
</div>
|
||||
</div>
|
||||
</ModalCom>
|
||||
);
|
||||
};
|
||||
|
||||
export default MarketPopUp;
|
||||
|
||||
const CloseIcon = ({ onClose }) => (
|
||||
<button
|
||||
type="button"
|
||||
className="text-[#374557] dark:text-red-500"
|
||||
onClick={onClose}
|
||||
>
|
||||
<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>
|
||||
);
|
||||
@@ -31,7 +31,13 @@ export default function ActiveJobMessage({ activeJobMesList }) {
|
||||
<tbody>
|
||||
{currentActiveJobMesList.map((item, index) => (
|
||||
<tr key={index} className='text-slate-500'>
|
||||
<td className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></td>
|
||||
<td>
|
||||
<div className="msg_box">
|
||||
<div className="msg_header">{item.msg_date} {item.msg_firstname}</div>
|
||||
<span className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
@@ -48,7 +54,7 @@ export default function ActiveJobMessage({ activeJobMesList }) {
|
||||
:
|
||||
<tbody>
|
||||
<tr className='text-slate-500'>
|
||||
<td className="p-2" colSpan={4}>No Purchase History Found!</td>
|
||||
<td className="p-2" colSpan={4}>No Message Found!</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
}
|
||||
|
||||
@@ -1,27 +1,90 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { useEffect, useState, useRef, forwardRef } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import Layout from "../Partials/Layout";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import ActiveJobMessage from "./ActiveJobMessage";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import CountDown from "../Helpers/CountDown";
|
||||
import IndexJobActions from "./JobActions/IndexJobActions";
|
||||
import ModalCom from "../Helpers/ModalCom";
|
||||
import { useReactToPrint } from "react-to-print";
|
||||
|
||||
import usersService from "../../services/UsersService";
|
||||
|
||||
function ActiveJobs(props) {
|
||||
const ApiCall = new usersService()
|
||||
let navigate = useNavigate()
|
||||
|
||||
let { userDetails } = useSelector((state) => state.userDetails);
|
||||
let navigate = useNavigate()
|
||||
|
||||
let [passDue, setPassDue] = useState(new Date() > new Date(props.details?.delivery_date)) // STATE TO KNOW IF TASK IS PASSED DUE TIME
|
||||
|
||||
let [messageToSend, setMessageToSend] = useState('') // State to hold the value of message to be sent
|
||||
|
||||
let [filesToSend, setFilesToSend] = useState([]) // State to hold the value of files to be sent
|
||||
|
||||
let [tab, setTab] = useState('message')
|
||||
|
||||
let [requestStatus, setRequestStatus] = useState({loading: false, status: false, message: ''})
|
||||
|
||||
let [popUp, setPopUp] = useState(false) // STATE FOR POPOUT MODAL
|
||||
|
||||
const printRef = useRef();
|
||||
// to handle printing
|
||||
const handlePrint = useReactToPrint({
|
||||
content: () => printRef.current,
|
||||
});
|
||||
|
||||
const popUpHandler = () => { // FUNCTION TO HANDLE POPOUT
|
||||
setPopUp(prev => !prev)
|
||||
}
|
||||
|
||||
// FUNCTION TO HANDLE MESSAGE CHANGE
|
||||
const handleMessageChange = ({target:{value}}) => {
|
||||
setMessageToSend(value)
|
||||
}
|
||||
|
||||
// FUNCTION TO HANDLE FILE UPlOAD CHANGE
|
||||
const handleFileChange = ({target:{files}}) => {
|
||||
setRequestStatus({loading: false, status: false, message: ''}) // State to determine error state
|
||||
|
||||
if(!files[0]) { // IF NO FILE SELECTED RETURN
|
||||
return
|
||||
}
|
||||
if(files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)){
|
||||
setRequestStatus({loading: false, status: false, message: 'File must be <= 1mb'})
|
||||
setTimeout(()=>{
|
||||
setRequestStatus({loading: false, status: false, message: ''})
|
||||
}, 5000)
|
||||
return
|
||||
}
|
||||
if(filesToSend.length >= Number(process.env.REACT_APP_TOTAL_NUM_FILE)){
|
||||
setRequestStatus({loading: false, status: false, message: `Total number of attachment is ${Number(process.env.REACT_APP_TOTAL_NUM_FILE)}`})
|
||||
setTimeout(()=>{
|
||||
setRequestStatus({loading: false, status: false, message: ''})
|
||||
}, 5000)
|
||||
return
|
||||
}
|
||||
// INCLUDE FILE IF NO ERROR
|
||||
setFilesToSend(prev => ([...prev, files[0]]))
|
||||
}
|
||||
|
||||
// FUNCTION TO CLEAR ALL TYPED MESSAGE OR FILES
|
||||
const handleClearAll = ({target:{name}}) => {
|
||||
if(tab == 'message'){
|
||||
setMessageToSend('')
|
||||
}else if(tab=='files'){
|
||||
setFilesToSend([])
|
||||
}else{
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION TO REMOVE AND IMAGE
|
||||
const handleRemoveImage = (imageToDelete) => {
|
||||
setFilesToSend(prev => prev.filter(item => item.name != imageToDelete.name))
|
||||
}
|
||||
|
||||
// FUNCTION TO SEND TASK MESSAGE
|
||||
const sendTaskMessage = () => {
|
||||
let reqData={message: messageToSend, msg_type: 'TEXT', contract:props.details.contract}
|
||||
@@ -49,17 +112,90 @@ function ActiveJobs(props) {
|
||||
})
|
||||
}
|
||||
|
||||
// FUNCTION TO SEND FILES
|
||||
const sendFile = async () => {
|
||||
setRequestStatus({loading: true, status: false, message: ''})
|
||||
|
||||
if(!filesToSend.length){ // checks if file to send is empty
|
||||
setRequestStatus({loading: false, status: false, message: 'No File(s) selected'})
|
||||
return setTimeout(()=>{
|
||||
setRequestStatus({loading: false, status: false, message: ''})
|
||||
}, 5000)
|
||||
}
|
||||
|
||||
for(let i=0; i<=filesToSend.length-1; i++){ // Loops through files to send array and trigger upload API call
|
||||
|
||||
const fileToBase64 = async () =>{ // Converts file data to base64 string
|
||||
try {
|
||||
const base64String = await convertFileToBase64(filesToSend[i]);
|
||||
return base64String;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// if(await !fileToBase64()){
|
||||
// return
|
||||
// }
|
||||
|
||||
let reqData={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}
|
||||
|
||||
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
|
||||
let isPassedDue = () => {
|
||||
// console.log('TESTING',new Date() > new Date(props.details?.delivery_date) )
|
||||
if(new Date() > new Date(props.details?.delivery_date)){
|
||||
setPassDue(true)
|
||||
}else{
|
||||
setPassDue(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
if(!passDue){
|
||||
let passDueInterval = setInterval(()=>{
|
||||
isPassedDue()
|
||||
},1000)
|
||||
return ()=>{
|
||||
clearInterval(passDueInterval)
|
||||
}
|
||||
}
|
||||
},[passDue])
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
|
||||
<div className="p-4 lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0 rounded-lg shadow-lg bg-slate-100">
|
||||
<div className="w-full lg:w-1/2">
|
||||
<div className="py-[20px] bg-white px-4 rounded-md shadow-md">
|
||||
{/* back btn and title */}
|
||||
<div className="w-full flex justify-start space-x-3 items-center">
|
||||
<div className="py-[20px] bg-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-16">
|
||||
{/* job title */}
|
||||
<div className="w-full md:w-8/12">
|
||||
<div className="w-full flex justify-start space-x-3 items-start">
|
||||
<button
|
||||
type="button"
|
||||
className="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"
|
||||
onClick={() => navigate(props.details.pathname, {replace: true})}
|
||||
>
|
||||
<svg
|
||||
@@ -72,147 +208,350 @@ function ActiveJobs(props) {
|
||||
<path d="M19 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H19v-2z" />
|
||||
</svg>
|
||||
</button>
|
||||
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
<h1 className="text-xl lg:text-2xl font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
{props.details?.title && props.details.title}
|
||||
</h1>
|
||||
</div>
|
||||
{/* END of back btn and title */}
|
||||
|
||||
<div className="mt-2 w-full flex flex-col-reverse lg:flex-row lg:justify-between lg:items-start lg:space-x-2">
|
||||
<div className="w-full lg:w-2/3 my-2 lg:my-0">
|
||||
<p className="text-base text-slate-700 dark:text-black">
|
||||
{props.details?.contract && props.details.contract}
|
||||
</p>
|
||||
<p className="text-base text-slate-700 dark:text-black">
|
||||
<span className="font-semibold">Description: </span>
|
||||
{props.details?.description && props.details.description}
|
||||
</p>
|
||||
<p className="text-base text-sky-blue">Delivery Detail</p>
|
||||
<div className="">
|
||||
<p className="text-base text-slate-700 dark:text-black">
|
||||
<span className="font-semibold">Due: </span>
|
||||
{props.details?.delivery_date &&
|
||||
props.details.delivery_date.split(" ")[0]}
|
||||
</p>
|
||||
<p className="text-base text-slate-700 dark:text-black">
|
||||
{props.details?.delivery_date &&
|
||||
props.details.delivery_date.split(" ")[1]}
|
||||
</p>
|
||||
<p className="text-base text-slate-700 dark:text-black">
|
||||
{props.details?.timeline_days && props.details.timeline_days} day(s)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full lg:w-1/3 lg:text-center">
|
||||
<p className="text-base text-sky-blue">
|
||||
<div className="w-full my-2">
|
||||
<p className="w-full text-base text-right text-sky-blue">
|
||||
{userDetails.firstname && userDetails.firstname}
|
||||
</p>
|
||||
<div className="text-base text-slate-700 dark:text-black tracking-wide">
|
||||
<p className="font-semibold text-black">Description: </p>
|
||||
<p className="p-2 border border-sky-blue">{props.details?.description && props.details.description}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* end of job title */}
|
||||
|
||||
<div className="mt-5 bg-white p-4 rounded-md shadow-md">
|
||||
{/* job details */}
|
||||
<div className="w-full md:w-4/12">
|
||||
<p className="text-base text-sky-blue">Delivery Detail</p>
|
||||
{passDue ?
|
||||
(
|
||||
<div className="my-1">
|
||||
<p className="text-base text-slate-700 dark:text-black">
|
||||
<span className="font-semibold">Due: </span>
|
||||
{props.details?.delivery_date &&
|
||||
props.details.delivery_date.split(" ")[0]}
|
||||
</p>
|
||||
<p className="py-2 text-base text-slate-700 dark:text-black">
|
||||
{props.details?.delivery_date &&
|
||||
props.details.delivery_date.split(" ")[1]}
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
:
|
||||
(
|
||||
<div className="my-1 flex items-start gap-3">
|
||||
<p className="font-semibold">Due: </p>
|
||||
<div className="flex flex-col justify-between">
|
||||
<p className="text-base text-slate-700 dark:text-black tracking-wide">
|
||||
<CountDown lastDate={props.details.delivery_date} />
|
||||
</p>
|
||||
<div className="text-base text-slate-700 dark:text-black tracking-wide flex gap-[5px]">
|
||||
<span>Hrs</span>
|
||||
<span>Min</span>
|
||||
<span>Sec</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
<div className="my-1 text-base text-slate-700 dark:text-black tracking-wide flex items-center gap-3">
|
||||
<span className="font-semibold text-black">Duration: </span>
|
||||
<span className="">{props.details?.timeline_days && props.details.timeline_days} day(s)</span>
|
||||
</div>
|
||||
<div className="my-1 text-base text-slate-700 dark:text-black tracking-wide flex items-center gap-3">
|
||||
<span className="font-semibold text-black">No: </span>
|
||||
<span className="">{props.details?.contract && props.details.contract}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/* end of job details */}
|
||||
</div>
|
||||
|
||||
<div className="my-4 py-[20px] bg-white px-4 rounded-2xl shadow-md lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
|
||||
<div className="w-full lg:w-1/2">
|
||||
<div className="">
|
||||
<p className="relative py-2 my-2 text-lg font-bold text-slate-600 dark:text-black border-b-2 border-slate-300 tracking-wide after:absolute after:-bottom-0.5 after:content-[''] after:w-[100px] after:h-[2px] after:bg-sky-blue after:left-0">Message(s)</p>
|
||||
<textarea
|
||||
className="p-4 w-full text-base text-slate-600 border-y border-slate-300 outline-none"
|
||||
rows="10"
|
||||
style={{ resize: "none" }}
|
||||
name='message'
|
||||
onChange={handleMessageChange}
|
||||
value={messageToSend}
|
||||
/>
|
||||
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Actions</h1>
|
||||
{/* <p className="my-3 py-1 text-base">
|
||||
Waiting for the completion message from the client before you can approve.
|
||||
</p> */}
|
||||
<IndexJobActions details={props.details} />
|
||||
</div>
|
||||
|
||||
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||
<div className="w-full">
|
||||
{/* error or success display */}
|
||||
{requestStatus.message != "" &&
|
||||
(!requestStatus.status ? (
|
||||
<div
|
||||
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||
>
|
||||
{requestStatus.message}
|
||||
{/* TEXTAREA SECTION */}
|
||||
<div className="mt-5">
|
||||
<div className="">
|
||||
{/* <p className="relative py-2 my-2 text-lg font-bold text-slate-600 dark:text-black border-b-2 border-slate-300 tracking-wide after:absolute after:-bottom-0.5 after:content-[''] after:w-[100px] after:h-[2px] after:bg-sky-blue after:left-0">Message(s)</p> */}
|
||||
<div className="my-2 flex items-center border-b border-slate-300">
|
||||
<button
|
||||
name='message'
|
||||
onClick={(e) => setTab(e.target.name)}
|
||||
className={`p-2 text-lg font-bold text-slate-600 dark:text-black border ${tab == 'message'? 'border-sky-blue':'border-slate-300'} tracking-wide transition duration-200`}>
|
||||
Send Message
|
||||
</button>
|
||||
<button
|
||||
name='files'
|
||||
onClick={(e) => setTab(e.target.name)}
|
||||
className={`p-2 text-lg font-bold text-slate-600 dark:text-black border ${tab == 'files'? 'border-sky-blue':'border-slate-300'} tracking-wide transition duration-200`}>
|
||||
Send Files
|
||||
</button>
|
||||
</div>
|
||||
{tab == 'message' ?
|
||||
(
|
||||
<textarea
|
||||
className="p-4 w-full h-[300px] text-base text-slate-600 border border-slate-300 outline-none"
|
||||
// rows="10"
|
||||
style={{ resize: "none" }}
|
||||
name='message'
|
||||
onChange={handleMessageChange}
|
||||
value={messageToSend}
|
||||
/>
|
||||
)
|
||||
:
|
||||
<div className="p-4 w-full h-[300px] text-base text-slate-600 border border-slate-300">
|
||||
<div className="files">
|
||||
<label htmlFor="file" className="h-20 btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer">Select Files to Upload</label>
|
||||
<input type="file" id='file' accept="image/*" style={{display: 'none'}} onChange={handleFileChange}/>
|
||||
</div>
|
||||
<div className="selected_file my-2">
|
||||
{filesToSend.length > 0 &&
|
||||
filesToSend.map((item, index)=> (
|
||||
<p key={index} className="flex items-center space-x-2">
|
||||
<span>{item.name}</span>
|
||||
<button name='remove' onClick={()=>handleRemoveImage(item)} className="px-2 flex justify-center items-center rounded-full border border-red-500 text-red-500">x</button>
|
||||
</p>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
requestStatus.status && (
|
||||
}
|
||||
</div>
|
||||
|
||||
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||
<div className="w-full">
|
||||
{/* error or success display */}
|
||||
{requestStatus.message != "" &&
|
||||
(!requestStatus.status ? (
|
||||
<div
|
||||
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||
>
|
||||
{requestStatus.message}
|
||||
</div>
|
||||
)
|
||||
))}
|
||||
</div>
|
||||
{/* End of error or success display */}
|
||||
) : (
|
||||
requestStatus.status && (
|
||||
<div
|
||||
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||
>
|
||||
{requestStatus.message}
|
||||
</div>
|
||||
)
|
||||
))}
|
||||
</div>
|
||||
{/* End of error or success display */}
|
||||
|
||||
{/* Buttons Sections */}
|
||||
<div className="py-2 mb-8 sm:flex sm:justify-center sm:items-center">
|
||||
<div className="w-full sm:w-2/4 mb-5 sm:mb-0">
|
||||
<button
|
||||
onClick={()=>{console.log('working')}}
|
||||
type="button"
|
||||
className="btn-gradient text-base tracking-wide px-4 py-2 rounded-md flex justify-center items-center"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill='white'>
|
||||
<path d="M12 2L2 12h3v8h14v-8h3L12 2zm0 16v-6h-2v6H7l5-5 5 5h-3z"/>
|
||||
</svg>
|
||||
{/* Buttons Sections */}
|
||||
<div className="py-2 sm:flex sm:justify-end sm:items-center">
|
||||
<div className="w-full sm:w-2/4 flex justify-between items-center space-x-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleClearAll}
|
||||
className="border-gradient text-base tracking-wide px-4 py-3 rounded-full"
|
||||
>
|
||||
<span className="text-gradient">Clear</span>
|
||||
</button>
|
||||
{tab == 'files' ?
|
||||
(
|
||||
<button
|
||||
onClick={sendFile}
|
||||
type="button"
|
||||
className="btn-gradient text-base tracking-wide px-4 py-3 rounded-full flex justify-center items-center"
|
||||
>
|
||||
{requestStatus.loading ?
|
||||
<LoadingSpinner size='6' color='sky-blue' />
|
||||
:
|
||||
<>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill='white'>
|
||||
<path d="M12 2L2 12h3v8h14v-8h3L12 2zm0 16v-6h-2v6H7l5-5 5 5h-3z"/>
|
||||
</svg>
|
||||
|
||||
<span className="text-white">Upload Files</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="w-full sm:w-2/4 flex justify-between items-center space-x-2">
|
||||
<button
|
||||
type="button"
|
||||
className="bg-red-600 text-base text-white tracking-wide px-4 py-2 rounded-md hover:opacity-90"
|
||||
>
|
||||
<span className="text-white">Clear</span>
|
||||
</button>
|
||||
<button
|
||||
onClick={sendTaskMessage}
|
||||
type="button"
|
||||
className="btn-gradient text-base text-white tracking-wide px-4 py-2 rounded-md"
|
||||
>
|
||||
{requestStatus.loading ?
|
||||
<LoadingSpinner size='6' color='sky-blue' />
|
||||
<span className="text-white">Upload Files</span>
|
||||
</>
|
||||
}
|
||||
</button>
|
||||
)
|
||||
:
|
||||
<span className="text-white">Send</span>
|
||||
}
|
||||
</button>
|
||||
(
|
||||
<button
|
||||
onClick={sendTaskMessage}
|
||||
type="button"
|
||||
className="btn-gradient text-base text-white tracking-wide px-4 py-3 rounded-full"
|
||||
>
|
||||
{requestStatus.loading ?
|
||||
<LoadingSpinner size='6' color='sky-blue' />
|
||||
:
|
||||
<span className="text-white">Send</span>
|
||||
}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{/* end of Buttons Sections */}
|
||||
</div>
|
||||
{/* end of Buttons Sections */}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* ACTION SECTION */}
|
||||
<div className="w-full lg:w-1/2 h-full">
|
||||
<div className="py-[20px] bg-white px-4 rounded-md shadow-md">
|
||||
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Actions</h1>
|
||||
|
||||
<p className="my-3 py-1 text-base">
|
||||
Waiting for the completion message from the client before you can approve.
|
||||
</p>
|
||||
{/* END OF TEXTAREA */}
|
||||
</div>
|
||||
|
||||
<div className="mt-5 bg-white p-4 rounded-md shadow-md">
|
||||
<div className="">
|
||||
{/* MESSAGE SECTION */}
|
||||
<div className="w-full lg:w-1/2">
|
||||
<div className="flex justify-between items-center gap-5">
|
||||
<p className="text-lg font-bold text-dark-gray dark:text-black tracking-wide">Message</p>
|
||||
{props.activeJobMesList.loading ?
|
||||
<LoadingSpinner size='16' color='sky-blue' />
|
||||
:
|
||||
<ActiveJobMessage activeJobMesList={props.activeJobMesList} />
|
||||
}
|
||||
<button type="button" onClick={popUpHandler} className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
||||
view all
|
||||
</button>
|
||||
</div>
|
||||
{props.activeJobMesList.loading ?
|
||||
<LoadingSpinner size='16' color='sky-blue' />
|
||||
:
|
||||
<ActiveJobMessage activeJobMesList={props.activeJobMesList} />
|
||||
}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/* END OF MESSAGE */}
|
||||
</div>
|
||||
|
||||
{/* POPOUT SECTION */}
|
||||
{popUp &&
|
||||
<PopModal popUpHandler={popUpHandler} popUp={popUp} details={props.details} activeJobMesList={props.activeJobMesList} handlePrint={handlePrint} myRef={printRef} />
|
||||
}
|
||||
{/* END OF POPOUT SECTION */}
|
||||
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default ActiveJobs;
|
||||
|
||||
|
||||
function convertFileToBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
|
||||
reader.onload = () => {
|
||||
const base64String = reader.result.split(',')[1];
|
||||
resolve(base64String);
|
||||
};
|
||||
|
||||
reader.onerror = error => {
|
||||
reject(error);
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
}
|
||||
|
||||
//POPOUT COMPONENT FUNCTION
|
||||
const PopModal = ({popUpHandler, popUp, details, activeJobMesList, handlePrint, myRef}) => {
|
||||
return (
|
||||
<ModalCom action={popUpHandler} situation={popUp} className="edit-popup">
|
||||
<div ref={myRef} className="message-modal-wrapper min-w-[500px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||
<div className="message-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
{details?.contract}
|
||||
</h1>
|
||||
<button
|
||||
type="button"
|
||||
className="text-[#374557] dark:text-red-500"
|
||||
onClick={popUpHandler}
|
||||
>
|
||||
<svg
|
||||
width="36"
|
||||
height="36"
|
||||
viewBox="0 0 36 36"
|
||||
fill="none"
|
||||
className="fill-current"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
|
||||
fill=""
|
||||
fillOpacity="0.6"
|
||||
/>
|
||||
<path
|
||||
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
|
||||
fill="#"
|
||||
fillOpacity="0.6"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
|
||||
<div className="w-full flex flex-col items-center">
|
||||
{activeJobMesList.loading ?
|
||||
<LoadingSpinner size='16' color='sky-blue' />
|
||||
:
|
||||
<div className="message-table h-[500px] overflow-y-auto">
|
||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||
<thead className='border-b-2'>
|
||||
<tr className='text-slate-600'>
|
||||
<th className="p-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
{activeJobMesList?.data?.length ?
|
||||
(
|
||||
<tbody>
|
||||
{activeJobMesList?.data?.map((item, index) => (
|
||||
<tr key={index} className='text-slate-500'>
|
||||
<td>
|
||||
<div className="msg_box">
|
||||
<div className="msg_header">{item.msg_date} {item.msg_firstname}</div>
|
||||
<span className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
)
|
||||
:
|
||||
activeJobMesList.error ?
|
||||
(
|
||||
<tbody>
|
||||
<tr className='text-slate-500'>
|
||||
<td className="p-2" colSpan={4}>Opps! an error occurred. Please try again!</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
)
|
||||
:
|
||||
<tbody>
|
||||
<tr className='text-slate-500'>
|
||||
<td className="p-2" colSpan={4}>No Message Found!</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
{/* btn */}
|
||||
<div className='flex justify-end items-center'>
|
||||
<div className="py-3 w-full lg:w-1/2 flex justify-between items-center">
|
||||
<button onClick={handlePrint} type="button" className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
||||
<span className='text-white'>Print</span>
|
||||
</button>
|
||||
<button onClick={popUpHandler} type="button" className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white">
|
||||
<span className='text-gradient'>Cancel</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ModalCom>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import React from 'react'
|
||||
|
||||
function CurrentJobAction() {
|
||||
return (
|
||||
<div className='job-action'>
|
||||
<p className="my-3 py-1 text-base active-owner">
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
|
||||
<h1 className="text-xl text-dark-gray dark:text-white">
|
||||
Waiting for the completion message from the client before you can approve.
|
||||
</h1>
|
||||
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td className="text-right py-4 px-2">
|
||||
<div className="flex justify-center items-center">
|
||||
.
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default CurrentJobAction
|
||||
@@ -0,0 +1,182 @@
|
||||
import React, { useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
|
||||
import ModalCom from '../../Helpers/ModalCom'
|
||||
import LoadingSpinner from '../../Spinners/LoadingSpinner'
|
||||
|
||||
import usersService from '../../../services/UsersService'
|
||||
|
||||
function CurrentTaskAction({jobDetails}) {
|
||||
|
||||
const apiCall = new usersService()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const [checked, setChecked] = useState(false)
|
||||
|
||||
const [reqStatus, setReqStatus] = useState({loading:false, status: false, message: ''})
|
||||
|
||||
let [popUp, setPopUp] = useState(false)
|
||||
|
||||
const popUpHandler = () => {
|
||||
if(popUp){
|
||||
setChecked(false)
|
||||
}
|
||||
setPopUp(prev => !prev)
|
||||
}
|
||||
|
||||
// FUNCTION TO HANDLE WHEN USER CLICKS ON SEND FOR REVIEW AND ACCEPTANCE
|
||||
const taskCompletedSubmit = () => {
|
||||
setReqStatus({loading:true, status: false, message: ''}) // Sets loading spinner active
|
||||
let reqData = {
|
||||
contract: jobDetails.contract,
|
||||
contract_uid: jobDetails.contract_uid,
|
||||
job_action: 'NOTIFY_COMPLETE',
|
||||
}
|
||||
if(!checked){ // checks that checkbox is selected
|
||||
setReqStatus({loading:false, status: false, message: 'Please check the box above'})
|
||||
return setTimeout(()=>{
|
||||
setReqStatus({loading:false, status: false, message: ''})
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
// API CALL TO MARK TASK AS COMPLETED BY WORKER
|
||||
apiCall.taskCompleted(reqData).then((res)=>{
|
||||
if(res.status != 200 || res.data.internal_return < 0){
|
||||
setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
|
||||
return
|
||||
}
|
||||
setReqStatus({loading:false, status: true, message: 'Task marked completed successfully'})
|
||||
setTimeout(()=>{ // Sets popout to false and navigates user to /mytask after 3 seconds
|
||||
popUpHandler()
|
||||
navigate('/mytask', {replace: true})
|
||||
}, 3000)
|
||||
}).catch(err => {
|
||||
setReqStatus({loading:false, status: false, message: 'Opps! Network error. Try again'})
|
||||
}).finally(()=>{
|
||||
setTimeout(()=>{
|
||||
setReqStatus({loading:false, status: false, message: ''})
|
||||
}, 3000)
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='job-action'>
|
||||
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 active-worker">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
<h1 className="text-xl text-dark-gray dark:text-white">
|
||||
I completed this task and ready for review and acceptance.
|
||||
</h1>
|
||||
{/*<div className="flex flex-col flex-[0.9]">*/}
|
||||
|
||||
{/*</div>*/}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="flex justify-center items-center">
|
||||
<button onClick={popUpHandler} type="button" className="w-120 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
||||
Send of Review
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{popUp && (
|
||||
<ModalCom action={popUpHandler} situation={popUp}>
|
||||
<div className="logout-modal-wrapper lg:w-[460px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
Confirm Completion
|
||||
</h1>
|
||||
<button
|
||||
type="button"
|
||||
className="text-[#374557] dark:text-red-500"
|
||||
onClick={popUpHandler}
|
||||
>
|
||||
<svg
|
||||
width="36"
|
||||
height="36"
|
||||
viewBox="0 0 36 36"
|
||||
fill="none"
|
||||
className="fill-current"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
|
||||
fill=""
|
||||
fillOpacity="0.6"
|
||||
/>
|
||||
<path
|
||||
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
|
||||
fill="#"
|
||||
fillOpacity="0.6"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
|
||||
<div className="w-full flex flex-col items-center">
|
||||
<div className="mb-10 flex justify-center items-center gap-2">
|
||||
<input
|
||||
type='checkbox'
|
||||
checked={checked}
|
||||
onChange={()=>{setChecked(prev => !prev)}}
|
||||
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
|
||||
/>
|
||||
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>If you have completed this task</p>
|
||||
</div>
|
||||
|
||||
<div className="mb-10 flex justify-center items-center">
|
||||
{reqStatus.loading ?
|
||||
<LoadingSpinner color='sky-blue' size='10' />
|
||||
:
|
||||
<button type="button" onClick={taskCompletedSubmit} className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
||||
Send for Review & Acceptance
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
|
||||
{/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
|
||||
<div className="w-full">
|
||||
{reqStatus.message != "" &&
|
||||
(!reqStatus.status ? (
|
||||
<div
|
||||
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||
>
|
||||
{reqStatus.message}
|
||||
</div>
|
||||
) : (
|
||||
reqStatus.status && (
|
||||
<div
|
||||
className={`relative p-4 my-4 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||
>
|
||||
{reqStatus.message}
|
||||
</div>
|
||||
)
|
||||
))}
|
||||
</div>
|
||||
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
|
||||
</div>
|
||||
|
||||
{/* cancel btn */}
|
||||
<div className='flex justify-end items-center'>
|
||||
<button onClick={popUpHandler} type="button" className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white">
|
||||
<span className='text-gradient'>Cancel</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ModalCom>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default CurrentTaskAction
|
||||
@@ -0,0 +1,45 @@
|
||||
import React from 'react'
|
||||
|
||||
import CurrentJobAction from './CurrentJobAction'
|
||||
import CurrentTaskAction from './CurrentTaskAction'
|
||||
|
||||
import PastDueJobAction from './PastDueJobAction'
|
||||
import PastDueTaskAction from './PastDueTaskAction'
|
||||
|
||||
import ReviewJobAction from './ReviewJobAction'
|
||||
import ReviewTaskAction from './ReviewTaskAction'
|
||||
|
||||
function IndexJobActions({details}) { // FUNCTION TO RENDER SPECIFIC JOB ACTION DEPENDING ON OWNER STATUS & STATUS DESCRIPTION
|
||||
let owner = details.owner_status
|
||||
let description = details.status_description
|
||||
switch(owner) {
|
||||
case 'OWNER':
|
||||
return (()=>{
|
||||
if(description == 'ACTIVE'){
|
||||
return <CurrentJobAction jobDetails={details} />
|
||||
}else if(description == 'PASTDUE'){
|
||||
return <PastDueJobAction jobDetails={details} />
|
||||
}else if(description == 'REVIEW'){
|
||||
return <ReviewJobAction jobDetails={details} />
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
})()
|
||||
case 'WORKER':
|
||||
return (()=>{
|
||||
if(description == 'ACTIVE'){
|
||||
return <CurrentTaskAction jobDetails={details} />
|
||||
}else if(description == 'PASTDUE'){
|
||||
return <PastDueTaskAction jobDetails={details} />
|
||||
}else if(description == 'REVIEW'){
|
||||
return <ReviewTaskAction jobDetails={details} />
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
})()
|
||||
default:
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export default IndexJobActions
|
||||
@@ -0,0 +1,35 @@
|
||||
import React from 'react'
|
||||
|
||||
function PastDueJobAction() {
|
||||
return (
|
||||
<div className='job-action'>
|
||||
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 owner-pastdue">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
|
||||
<h1 className="text-xl text-dark-gray dark:text-white">
|
||||
Time allocated has passed
|
||||
</h1>
|
||||
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="flex justify-center items-center">
|
||||
<button type="button" className="w-120 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
||||
Cancel or Extend Timeline
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default PastDueJobAction
|
||||
@@ -0,0 +1,35 @@
|
||||
import React from 'react'
|
||||
|
||||
function PastDueTaskAction() {
|
||||
return (
|
||||
<div className='job-action'>
|
||||
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 worker-pastdue">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
|
||||
<h1 className="text-xl text-dark-gray dark:text-white">
|
||||
You have missed the allocated time
|
||||
</h1>
|
||||
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="flex justify-center items-center">
|
||||
<button type="button" className="w-120 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
||||
Request Extension
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default PastDueTaskAction
|
||||
@@ -0,0 +1,36 @@
|
||||
import React from 'react'
|
||||
|
||||
function ReviewJobAction() {
|
||||
return (
|
||||
<div className='job-action'>
|
||||
<p className="my-3 py-1 text-base">
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 review-owner">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
|
||||
<h1 className="text-xl text-dark-gray dark:text-white">
|
||||
This Job is Ready for your review
|
||||
</h1>
|
||||
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="flex justify-center items-center">
|
||||
<button type="button" className="w-120 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
||||
Reject or Accept
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ReviewJobAction
|
||||
@@ -0,0 +1,13 @@
|
||||
import React from 'react'
|
||||
|
||||
function ReviewTaskAction() {
|
||||
return (
|
||||
<div className='job-action'>
|
||||
<p className="my-3 py-1 text-base">
|
||||
Waiting for the completion message from the client before you can approve. Worker True & Review Job
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ReviewTaskAction
|
||||
@@ -28,7 +28,7 @@ export default function MyActiveJobTable({ MyJobList, className }) {
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
@@ -45,7 +45,7 @@ export default function MyActiveJobTable({ MyJobList, className }) {
|
||||
<>
|
||||
{MyJobList &&
|
||||
MyJobList?.result_list &&
|
||||
MyJobList.result_list.length > 0 &&
|
||||
MyJobList.result_list.length > 0 ?
|
||||
currentActiveJobList.map((value, index) => (
|
||||
<tr
|
||||
key={index}
|
||||
@@ -112,7 +112,14 @@ export default function MyActiveJobTable({ MyJobList, className }) {
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
))
|
||||
:
|
||||
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
<td className="p-2">
|
||||
No Active Task!
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import React, { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import Layout from "../Partials/Layout";
|
||||
import CommonHead from "../UserHeader/CommonHead";
|
||||
import MyActiveJobTable from "./MyActiveJobTable";
|
||||
|
||||
export default function MyPastDueJobs(props) {
|
||||
const [selectTab, setValue] = useState("today");
|
||||
const filterHandler = (value) => {
|
||||
setValue(value);
|
||||
};
|
||||
return (
|
||||
<Layout>
|
||||
<CommonHead
|
||||
commonHeadData={props.commonHeadData}
|
||||
/>
|
||||
<div className="notification-page w-full mb-10">
|
||||
<div className="notification-wrapper w-full">
|
||||
{/* heading */}
|
||||
<div className="sm:flex justify-between items-center mb-6">
|
||||
<div className="mb-5 sm:mb-0">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||
<span
|
||||
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||
>
|
||||
Pass Due Job(s)
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
<div className="slider-btns flex space-x-4">
|
||||
<div
|
||||
onClick={() => filterHandler("today")}
|
||||
className="relative"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<MyActiveJobTable MyJobList={props.MyJobList} />
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import React, { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import Layout from "../Partials/Layout";
|
||||
import CommonHead from "../UserHeader/CommonHead";
|
||||
import MyActiveJobTable from "./MyActiveJobTable";
|
||||
|
||||
export default function MyReviewDueJobs(props) {
|
||||
const [selectTab, setValue] = useState("today");
|
||||
const filterHandler = (value) => {
|
||||
setValue(value);
|
||||
};
|
||||
return (
|
||||
<Layout>
|
||||
<CommonHead
|
||||
commonHeadData={props.commonHeadData}
|
||||
/>
|
||||
<div className="notification-page w-full mb-10">
|
||||
<div className="notification-wrapper w-full">
|
||||
{/* heading */}
|
||||
<div className="sm:flex justify-between items-center mb-6">
|
||||
<div className="mb-5 sm:mb-0">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||
<span
|
||||
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||
>
|
||||
Review Due Job(s)
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
<div className="slider-btns flex space-x-4">
|
||||
<div
|
||||
onClick={() => filterHandler("today")}
|
||||
className="relative"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<MyActiveJobTable MyJobList={props.MyJobList} />
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
|
||||
|
||||
const CouponPopup = ({ popUpHandler, data }) => {
|
||||
return (
|
||||
<div className="logout-modal-wrapper lg:w-[460px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
Redeem Coupon
|
||||
</h1>
|
||||
<button
|
||||
type="button"
|
||||
className="text-[#374557] dark:text-red-500"
|
||||
onClick={popUpHandler}
|
||||
>
|
||||
<CloseIcon />
|
||||
</button>
|
||||
</div>
|
||||
<form className="logout-modal-body w-full flex flex-col items-center px-10 py-8 gap-4 border-b dark:border-[#5356fb29] border-light-purple">
|
||||
<div className="input-com mb-7 flex gap-1 items-center w-full">
|
||||
{/* Coupon */}
|
||||
<div className="flex items-center justify-between flex-[0.3]">
|
||||
<label
|
||||
className="input-label text-[#181c32] dark:text-white text-[15px] font-semibold"
|
||||
htmlFor="coupon-token"
|
||||
>
|
||||
Coupon:
|
||||
</label>
|
||||
</div>
|
||||
<div className=" flex-[0.7] max-w-[150px]">{data?.code}</div>
|
||||
</div>
|
||||
|
||||
<div className="input-com mb-7 flex gap-1 items-center w-full">
|
||||
{/* Amount */}
|
||||
<div className="flex items-center justify-between flex-[0.3]">
|
||||
<label
|
||||
className="input-label text-[#181c32] dark:text-white text-[15px] font-semibold"
|
||||
htmlFor="amount"
|
||||
>
|
||||
Amount:
|
||||
</label>
|
||||
</div>
|
||||
<div className=" flex-[0.7] max-w-[150px]">{`${data?.amount} Naira`}</div>
|
||||
</div>
|
||||
|
||||
<div className="signin-area w-full">
|
||||
<div className="flex justify-end">
|
||||
<button
|
||||
// type="button"
|
||||
className="text-white btn-gradient text-lg tracking-wide px-6 py-2 rounded-full"
|
||||
>
|
||||
{/* {loader ? (
|
||||
<div className="signup btn-loader"></div>
|
||||
) : (
|
||||
)} */}
|
||||
<span className="font-semibold tracking-wider">Redeem Now!</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div className="signin-area w-full px-5 py-4">
|
||||
<div className="flex justify-end">
|
||||
<button
|
||||
onClick={popUpHandler}
|
||||
className="border-gradient text-lg tracking-wide px-6 py-2 rounded-full"
|
||||
>
|
||||
<span>Cancel</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default CouponPopup;
|
||||
|
||||
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>
|
||||
);
|
||||
@@ -0,0 +1,110 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import PaginatedList from "../Pagination/PaginatedList";
|
||||
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
||||
import ModalCom from "../Helpers/ModalCom";
|
||||
import CouponPopup from "./CouponPopup";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
function CouponTable({ coupon }) {
|
||||
const [currentPage, setCurrentPage] = useState(0);
|
||||
const [couponPopup, setCouponPopup] = useState({ state: false, data: null });
|
||||
const indexOfFirstItem = Number(currentPage);
|
||||
const indexOfLastItem =
|
||||
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||
const currentCoupon = coupon?.data?.slice(indexOfFirstItem, indexOfLastItem);
|
||||
|
||||
const handlePagination = (e) => {
|
||||
handlePagingFunc(e, setCurrentPage);
|
||||
};
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleCouponPopUp = () =>
|
||||
setCouponPopup((prev) => ({ state: !prev.state }));
|
||||
|
||||
useEffect(() => {
|
||||
if (!coupon) navigate("/my-coupon", { replace: true });
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col justify-between h-full">
|
||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||
<thead className="border-b-2">
|
||||
<tr className="text-slate-600">
|
||||
<th className="p-2">Coupon</th>
|
||||
<th className="p-2 text-center">Amount</th>
|
||||
<th className="p-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
{coupon.data.length ? (
|
||||
<tbody>
|
||||
{currentCoupon.map((item, index) => (
|
||||
<tr key={index} className="text-slate-500">
|
||||
<td className="p-2 cursor-default">
|
||||
{item.added} <br /> {item.code}
|
||||
</td>
|
||||
<td className="p-2 text-center cursor-default">{`${item.amount} Naira`}</td>
|
||||
<td className="p-2 h-20 flex items-center justify-end">
|
||||
<button
|
||||
type="button"
|
||||
className="btn-gradient w-[116px] h-[46px] text-white rounded-full text-base bg-pink flex justify-center items-center"
|
||||
onClick={() => {
|
||||
setCouponPopup((prev) => ({
|
||||
state: !prev.state,
|
||||
data: item,
|
||||
}));
|
||||
}}
|
||||
>
|
||||
Redeem
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
) : coupon.error ? (
|
||||
<tbody>
|
||||
<tr className="text-slate-500">
|
||||
<td className="p-2" colSpan={4}>
|
||||
Opps! an error occurred. Please try again!
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
) : (
|
||||
<tbody>
|
||||
<tr className="text-slate-500">
|
||||
<td className="p-2" colSpan={4}>
|
||||
No Purchase History Found!
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
)}
|
||||
</table>
|
||||
|
||||
{/* PAGINATION BUTTON */}
|
||||
<PaginatedList
|
||||
onClick={handlePagination}
|
||||
prev={currentPage === 0 ? true : false}
|
||||
next={
|
||||
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
|
||||
coupon?.data?.length
|
||||
? true
|
||||
: false
|
||||
}
|
||||
data={coupon?.data}
|
||||
start={indexOfFirstItem}
|
||||
stop={indexOfLastItem}
|
||||
/>
|
||||
{/* END OF PAGINATION BUTTON */}
|
||||
|
||||
{couponPopup.state && (
|
||||
<ModalCom action={handleCouponPopUp} situation={couponPopup.state}>
|
||||
<CouponPopup
|
||||
data={couponPopup.data}
|
||||
popUpHandler={handleCouponPopUp}
|
||||
/>
|
||||
</ModalCom>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default CouponTable;
|
||||
@@ -0,0 +1,72 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import Layout from "../Partials/Layout";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import CouponTable from "./CouponTable";
|
||||
import usersService from "../../services/UsersService";
|
||||
|
||||
export default function MyCoupons() {
|
||||
const apiCall = new usersService();
|
||||
let [couponHistory, setCouponHistory] = useState({
|
||||
// FOR COUPON HISTORY
|
||||
loading: true,
|
||||
data: [],
|
||||
error: false,
|
||||
});
|
||||
|
||||
//FUNCTION TO GET COUPON HISTORY
|
||||
const getCouponHistory = () => {
|
||||
apiCall
|
||||
.getCouponPending()
|
||||
.then((res) => {
|
||||
if (res.data.internal_return < 0) {
|
||||
// success but no data
|
||||
setCouponHistory((prev) => ({ ...prev, loading: false }));
|
||||
return;
|
||||
}
|
||||
setCouponHistory((prev) => ({
|
||||
...prev,
|
||||
loading: false,
|
||||
data: res.data.result_list,
|
||||
}));
|
||||
})
|
||||
.catch((error) => {
|
||||
setCouponHistory((prev) => ({ ...prev, loading: false, error: true }));
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getCouponHistory();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Layout>
|
||||
<div className="my-wallet-wrapper w-full mb-10">
|
||||
{/* heading */}
|
||||
<div className="sm:flex justify-start items-center mb-6">
|
||||
<div className="mb-5 sm:mb-0">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||
Coupons
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
|
||||
{/* COUPON SECTION */}
|
||||
<div className="lg:w-4/4 w-full mb-10 lg:mb-0">
|
||||
<div className="wallet w-full md:p-8 p-4 h-full max-h-[500px] min-h-[500px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow coupon">
|
||||
{couponHistory.loading ? (
|
||||
<div className="w-full h-full flex justify-center items-center">
|
||||
<LoadingSpinner size="16" color="sky-blue" />
|
||||
</div>
|
||||
) : (
|
||||
<CouponTable coupon={couponHistory} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{/* END OF COUPON SECTION */}
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
@@ -102,7 +102,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
||||
<>
|
||||
{MyJobList &&
|
||||
MyJobList?.data?.result_list &&
|
||||
MyJobList.data?.result_list.length > 0 &&
|
||||
MyJobList.data?.result_list.length > 0 ?
|
||||
currentJobList.map((value, index) => (
|
||||
<tr
|
||||
key={index}
|
||||
@@ -181,7 +181,14 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
))
|
||||
:
|
||||
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
<td className="p-2">
|
||||
No Jobs Avaliable!
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</>
|
||||
) : selectedCategory === "Explore" ? (
|
||||
<></>
|
||||
|
||||
@@ -44,7 +44,6 @@ export default function MyJobs(props) {
|
||||
</div>
|
||||
<MyJobTable
|
||||
MyJobList={props.MyJobList}
|
||||
reloadJobList={props.reloadJobList}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,121 +24,128 @@ export default function MyPendingJobTable({ MyJobList, className }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
{MyJobList && MyJobList?.result_list && (
|
||||
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between h-full">
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<tbody>
|
||||
{/*<tr className="text-base text-thin-light-gray border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">*/}
|
||||
{/* <td className="py-4">All Product</td>*/}
|
||||
{/* <td className="py-4 text-right">.</td>*/}
|
||||
{/*</tr>*/}
|
||||
<div
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
{MyJobList && MyJobList?.result_list && (
|
||||
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between h-full">
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<tbody>
|
||||
{/*<tr className="text-base text-thin-light-gray border-b dark:border-[#5356fb29] default-border-b dark:border-[#5356fb29] ottom ">*/}
|
||||
{/* <td className="py-4">All Product</td>*/}
|
||||
{/* <td className="py-4 text-right">.</td>*/}
|
||||
{/*</tr>*/}
|
||||
|
||||
{
|
||||
<>
|
||||
{MyJobList &&
|
||||
MyJobList?.result_list &&
|
||||
MyJobList.result_list.length > 0 &&
|
||||
currentActiveJobList.map((value, index) => (
|
||||
<tr
|
||||
key={index}
|
||||
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
||||
>
|
||||
<td className=" py-4">
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] max-w-[60px]">
|
||||
<img
|
||||
src={dataImage2}
|
||||
alt="data"
|
||||
className="w-full h-full"
|
||||
/>
|
||||
{
|
||||
<>
|
||||
{MyJobList &&
|
||||
MyJobList?.result_list &&
|
||||
MyJobList.result_list.length > 0 ?
|
||||
currentActiveJobList.map((value, index) => (
|
||||
<tr
|
||||
key={index}
|
||||
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
||||
>
|
||||
<td className=" py-4">
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
<div className="w-full h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1] max-w-[60px]">
|
||||
<img
|
||||
src={dataImage2}
|
||||
alt="data"
|
||||
className="w-full h-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col flex-[0.9]">
|
||||
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
||||
{value.title}
|
||||
</h1>
|
||||
<div>{value.description}</div>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Price:{" "}
|
||||
<span className="text-purple">
|
||||
{value.price * 0.01}
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Duration:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{value.timeline_days} day(s)
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Expire:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{value.expire}
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Send to:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{value.job_to}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col flex-[0.9]">
|
||||
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
||||
{value.title}
|
||||
</h1>
|
||||
<div>{value.description}</div>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Price:{" "}
|
||||
<span className="text-purple">
|
||||
{value.price * 0.01}
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Duration:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{value.timeline_days} day(s)
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Expire:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{value.expire}
|
||||
</span>
|
||||
</span>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
Send to:{" "}
|
||||
<span className="text-purple">
|
||||
{" "}
|
||||
{value.job_to}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</td>
|
||||
|
||||
<td className="text-right py-4 px-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setJobPopout({ show: true, data: value });
|
||||
}}
|
||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
>
|
||||
View
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</>
|
||||
<td className="text-right py-4 px-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setJobPopout({ show: true, data: value });
|
||||
}}
|
||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
>
|
||||
View
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
:
|
||||
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
<td className="p-2">
|
||||
No Pending Task!
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
{/* PAGINATION BUTTON */}
|
||||
<PaginatedList
|
||||
onClick={handlePagination}
|
||||
prev={currentPage == 0 ? true : false}
|
||||
next={
|
||||
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
|
||||
MyJobList?.result_list.length
|
||||
? true
|
||||
: false
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
{/* PAGINATION BUTTON */}
|
||||
<PaginatedList
|
||||
onClick={handlePagination}
|
||||
prev={currentPage == 0 ? true : false}
|
||||
next={
|
||||
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
|
||||
MyJobList?.result_list.length
|
||||
? true
|
||||
: false
|
||||
}
|
||||
data={MyJobList?.result_list}
|
||||
start={indexOfFirstItem}
|
||||
stop={indexOfLastItem}
|
||||
/>
|
||||
{/* END OF PAGINATION BUTTON */}
|
||||
</div>
|
||||
)}
|
||||
data={MyJobList?.result_list}
|
||||
start={indexOfFirstItem}
|
||||
stop={indexOfLastItem}
|
||||
/>
|
||||
{/* END OF PAGINATION BUTTON */}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Active Job Popout */}
|
||||
{jobPopout.show && (
|
||||
<PendingJobsPopout
|
||||
details={jobPopout.data}
|
||||
onClose={() => {
|
||||
setJobPopout({ show: false, data: {} });
|
||||
}}
|
||||
situation={jobPopout.show}
|
||||
/>
|
||||
)}
|
||||
{/* End of Active Job Popout */}
|
||||
</div>
|
||||
{/* Active Job Popout */}
|
||||
{jobPopout.show && (
|
||||
<PendingJobsPopout
|
||||
details={jobPopout.data}
|
||||
onClose={() => {
|
||||
setJobPopout({ show: false, data: {} });
|
||||
}}
|
||||
situation={jobPopout.show}
|
||||
/>
|
||||
)}
|
||||
{/* End of Active Job Popout */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,60 +1,55 @@
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useState } from "react";
|
||||
import dataImage1 from "../../assets/images/data-table-user-1.png";
|
||||
|
||||
import PaginatedList from "../Pagination/PaginatedList";
|
||||
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
||||
import usersService from "../../services/UsersService";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import { useNavigate, useLocation } from "react-router-dom";
|
||||
|
||||
import {useNavigate, useLocation} from 'react-router-dom'
|
||||
const noTasksBg = require("../../assets/images/no-task-background.jpg");
|
||||
|
||||
export default function MyJobTable({ className, ActiveJobList }) {
|
||||
let navigate = useNavigate()
|
||||
let {pathname} = useLocation()
|
||||
|
||||
// const [tasksData, setTasksData] = useState(null);
|
||||
// const [loader, setLoader] = useState(false);
|
||||
|
||||
// let apiCall = useMemo(() => new usersService(), []);
|
||||
|
||||
// const displayTasks = useCallback(async () => {
|
||||
// try {
|
||||
// const res = await apiCall.getMyActiveTaskList();
|
||||
// let {
|
||||
// data: { result_list },
|
||||
// internal_return,
|
||||
// statusText,
|
||||
// } = await res;
|
||||
// if (internal_return < 0 || statusText !== "OK") return;
|
||||
// setTasksData(result_list);
|
||||
// setLoader(false);
|
||||
// } catch (error) {
|
||||
// throw new Error(error);
|
||||
// }
|
||||
// }, [apiCall]);
|
||||
|
||||
// useEffect(() => {
|
||||
// displayTasks();
|
||||
// }, []);
|
||||
let navigate = useNavigate();
|
||||
let { pathname } = useLocation();
|
||||
|
||||
const [currentPage, setCurrentPage] = useState(0);
|
||||
const indexOfFirstItem = Number(currentPage);
|
||||
const indexOfLastItem =
|
||||
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||
const currentTask = ActiveJobList?.data?.slice(indexOfFirstItem, indexOfLastItem);
|
||||
const currentTask = ActiveJobList?.data?.slice(
|
||||
indexOfFirstItem,
|
||||
indexOfLastItem
|
||||
);
|
||||
|
||||
const handlePagination = (e) => {
|
||||
handlePagingFunc(e, setCurrentPage);
|
||||
};
|
||||
|
||||
// To navigate to task
|
||||
const [btnLoader, setBtnLoader] = useState(false);
|
||||
const navigateMarket = () => {
|
||||
setBtnLoader(true);
|
||||
setTimeout(() => {
|
||||
navigate("/market", { replace: true });
|
||||
setBtnLoader(false);
|
||||
}, 2500);
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${
|
||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] relative ${
|
||||
className || ""
|
||||
}`}
|
||||
} bg-cover bg-center`}
|
||||
style={{
|
||||
backgroundImage: !ActiveJobList?.data.length
|
||||
? `url('${noTasksBg}')`
|
||||
: "none",
|
||||
}}
|
||||
>
|
||||
{!ActiveJobList?.data.length && (
|
||||
<div class="absolute inset-0 bg-black opacity-30"></div>
|
||||
)}
|
||||
{ActiveJobList.loading ? (
|
||||
<div className="w-full h-[500px] flex items-center justify-center">
|
||||
<div className="w-full h-[520px] flex items-center justify-center">
|
||||
<LoadingSpinner size="16" color="sky-blue" />
|
||||
</div>
|
||||
) : (
|
||||
@@ -117,7 +112,7 @@ export default function MyJobTable({ className, ActiveJobList }) {
|
||||
type="button"
|
||||
onClick={() => {
|
||||
navigate("/manage-active-job", {
|
||||
state: {...task, pathname},
|
||||
state: { ...task, pathname },
|
||||
});
|
||||
}}
|
||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
@@ -127,23 +122,27 @@ export default function MyJobTable({ className, ActiveJobList }) {
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
)
|
||||
:
|
||||
(
|
||||
ActiveJobList.status ?
|
||||
<div className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
<div className="p-2">
|
||||
No Tasks!
|
||||
) : ActiveJobList.status ? (
|
||||
<div className="flex flex-col items-center justify-center gap-9 my-5">
|
||||
<div className="p-2 font-bold text-3xl text-white whitespace-nowrap">
|
||||
You currently have "0" task
|
||||
</div>
|
||||
<button
|
||||
className="w-[115px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
onClick={navigateMarket}
|
||||
>
|
||||
{btnLoader ? (
|
||||
<div className="signup btn-loader"></div>
|
||||
) : (
|
||||
"Find Task"
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
:
|
||||
<div className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
<p className="p-2">
|
||||
Error Occurred! Unable to display Tasks!
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
) : (
|
||||
<div className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
<p className="p-2">Error Occurred! Unable to display Tasks!</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* PAGINATION BUTTON */}
|
||||
@@ -166,5 +165,3 @@ export default function MyJobTable({ className, ActiveJobList }) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/* */
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function MyOffersTable({ className, MyActiveOffersList}) {
|
||||
const settings = {
|
||||
arrows: false,
|
||||
dots: false,
|
||||
infinite: true,
|
||||
infinite: MyActiveOffersList?.result_list?.length > 4,
|
||||
autoplay: true,
|
||||
slidesToShow: 4,
|
||||
slidesToScroll: 1,
|
||||
@@ -25,6 +25,7 @@ export default function MyOffersTable({ className, MyActiveOffersList}) {
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1,
|
||||
infinite: MyActiveOffersList?.result_list?.length > 2,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -6,7 +6,11 @@ import CommonHead from "../UserHeader/CommonHead";
|
||||
import TopSellerTopBuyerSliderSection from "../Home/TopSellerTopBuyerSliderSection";
|
||||
import MyOffersTable from "./MyOffersTable";
|
||||
|
||||
export default function MyTasks({MyActiveOffersList, ActiveJobList, commonHeadData}) {
|
||||
export default function MyTasks({
|
||||
MyActiveOffersList,
|
||||
ActiveJobList,
|
||||
commonHeadData,
|
||||
}) {
|
||||
const [selectTab, setValue] = useState("today");
|
||||
const filterHandler = (value) => {
|
||||
setValue(value);
|
||||
@@ -34,9 +38,13 @@ export default function MyTasks({MyActiveOffersList, ActiveJobList, commonHeadDa
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<MyOffersTable
|
||||
MyActiveOffersList={MyActiveOffersList}
|
||||
className="mb-10" />
|
||||
{MyActiveOffersList &&
|
||||
MyActiveOffersList?.result_list?.length >= 0 && (
|
||||
<MyOffersTable
|
||||
MyActiveOffersList={MyActiveOffersList}
|
||||
className="mb-10"
|
||||
/>
|
||||
)}
|
||||
<MyJobTable ActiveJobList={ActiveJobList} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,13 +8,24 @@ import LoadingSpinner from '../Spinners/LoadingSpinner'
|
||||
function Balance({wallet, coupon}) {
|
||||
return (
|
||||
<div className="content-wrapper">
|
||||
{/* heading */}
|
||||
<div className="sm:flex justify-between items-center mb-6">
|
||||
<div className="mb-5 sm:mb-0">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||
Wallet
|
||||
</h1>
|
||||
</div>
|
||||
<div className="slider-btns flex space-x-4">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'>
|
||||
{/* WALLET SECTION */}
|
||||
<div className="lg:w-3/4 w-full mb-10 lg:mb-0">
|
||||
<div className="wallet w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white rounded-2xl shadow">
|
||||
<div className="lg:w-4/4 w-full mb-10 lg:mb-0">
|
||||
<div className="wallet w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white rounded-2xl shadow min-h-[520px]">
|
||||
<div className='flex items-baseline justify-between'>
|
||||
<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Wallet</h2>
|
||||
<p className='text-base text-slate-500 dark:text-white'>Add New Wallet</p>
|
||||
{/*<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Wallet</h2>*/}
|
||||
{/*<p className='text-base text-slate-500 dark:text-white'>Add New Wallet</p>*/}
|
||||
</div>
|
||||
{/* wallet balance */}
|
||||
{wallet.loading ?
|
||||
@@ -26,7 +37,7 @@ function Balance({wallet, coupon}) {
|
||||
<div className='text-slate-900 w-full md:w-1/2 flex space-x-3 items-start justify-start'>
|
||||
<div className='balance-info'>
|
||||
<p className='py-2'></p>
|
||||
<span className='text-base'>{item.description}</span>
|
||||
<span className='text-xl text-dark-gray dark:text-white'>{item.description}</span>
|
||||
<p className='text-base text-slate-500'>{item.symbol}</p>
|
||||
</div>
|
||||
<div className='balance-info'>
|
||||
@@ -43,10 +54,10 @@ function Balance({wallet, coupon}) {
|
||||
{
|
||||
item.action_type != 'AC_AD_FD_ONLY' ?
|
||||
<Link to='transfer-fund' className='lg:flex hidden user-balance cursor-pointer lg:w-[152px] w-[150px] h-[48px]
|
||||
items-center rounded-full relative bg-purple pr-1.5 pl-4'>Transfer</Link>:''
|
||||
items-center rounded-full relative bg-purple pr-1.5 pl-4 lg:text-xl text-lg font-bold text-white'>Transfer</Link>:''
|
||||
}
|
||||
<Link to='add-fund' className='lg:flex hidden user-balance cursor-pointer lg:w-[152px] w-[150px] h-[48px]
|
||||
items-center rounded-full relative bg-purple pr-1.5 pl-4'>+Add Credit</Link>
|
||||
items-center rounded-full relative bg-purple pr-1.5 pl-4 lg:text-xl text-lg font-bold text-white'>+Add Credit</Link>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
@@ -73,22 +84,22 @@ function Balance({wallet, coupon}) {
|
||||
|
||||
</div>
|
||||
|
||||
<div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'>
|
||||
{/*<div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'>*/}
|
||||
|
||||
{/* COUPON SECTION */}
|
||||
<div className="lg:w-3/4 w-full mb-10 lg:mb-0">
|
||||
<div className="wallet w-full md:p-8 p-4 h-full max-h-[500px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
|
||||
<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Coupons</h2>
|
||||
{coupon.loading ?
|
||||
<LoadingSpinner size='16' color='sky-blue' />
|
||||
:
|
||||
<CouponTable coupon={coupon} />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
{/* END OF COUPON SECTION */}
|
||||
{/* /!* COUPON SECTION *!/*/}
|
||||
{/* <div className="lg:w-3/4 w-full mb-10 lg:mb-0">*/}
|
||||
{/* <div className="wallet w-full md:p-8 p-4 h-full max-h-[500px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">*/}
|
||||
{/* <h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Coupons</h2>*/}
|
||||
{/* {coupon.loading ?*/}
|
||||
{/* <LoadingSpinner size='16' color='sky-blue' />*/}
|
||||
{/* :*/}
|
||||
{/* <CouponTable coupon={coupon} />*/}
|
||||
{/* }*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* /!* END OF COUPON SECTION *!/*/}
|
||||
|
||||
</div>
|
||||
{/*</div>*/}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -20,9 +20,6 @@ function Wallet() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const WalletRoutes = () => {
|
||||
const apiCall = new usersService()
|
||||
|
||||
@@ -38,18 +35,6 @@ const WalletRoutes = () => {
|
||||
error: false
|
||||
})
|
||||
|
||||
let [purchaseHistory, setPurchaseHistory] = useState({ // FOR PURCHASE HISTORY
|
||||
loading: true,
|
||||
data: [],
|
||||
error: false
|
||||
})
|
||||
|
||||
let [couponHistory, setCouponHistory] = useState({ // FOR COUPON HISTORY
|
||||
loading: true,
|
||||
data: [],
|
||||
error: false
|
||||
})
|
||||
|
||||
//FUNCTION TO GET WALLET LIST
|
||||
const getWalletList = ()=>{
|
||||
apiCall.getUserWallets(null).then((res)=>{
|
||||
@@ -76,38 +61,9 @@ const WalletRoutes = () => {
|
||||
})
|
||||
}
|
||||
|
||||
//FUNCTION TO GET PURCHASE HISTORY
|
||||
const getPurchaseHistory = ()=>{
|
||||
apiCall.getPurchaseHx().then((res)=>{
|
||||
if(res.data.internal_return < 0){ // success but no data
|
||||
setPurchaseHistory(prev => ({...prev, loading: false}))
|
||||
return
|
||||
}
|
||||
// console.log('purchase',res.data)
|
||||
setPurchaseHistory(prev => ({...prev, loading: false, data: res.data.result_list}))
|
||||
}).catch((error)=>{
|
||||
setPurchaseHistory(prev => ({...prev, loading: false, error: true}))
|
||||
})
|
||||
}
|
||||
|
||||
//FUNCTION TO GET COUPON HISTORY
|
||||
const getCouponHistory = ()=>{
|
||||
apiCall.getCouponHx().then((res)=>{
|
||||
if(res.data.internal_return < 0){ // success but no data
|
||||
setCouponHistory(prev => ({...prev, loading: false}))
|
||||
return
|
||||
}
|
||||
setCouponHistory(prev => ({...prev, loading: false, data: res.data.result_list}))
|
||||
}).catch((error)=>{
|
||||
setCouponHistory(prev => ({...prev, loading: false, error: true}))
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
getWalletList()
|
||||
getPaymentHistory()
|
||||
getPurchaseHistory()
|
||||
getCouponHistory()
|
||||
}, [])
|
||||
return (
|
||||
<Routes>
|
||||
@@ -115,7 +71,7 @@ const WalletRoutes = () => {
|
||||
<Route path='add-fund' element={<AddFund payment={paymentHistory} />} />
|
||||
<Route path='add-fund/confirm-add-fund' element={<ConfirmAddFund payment={paymentHistory} />} />
|
||||
<Route path='transfer-fund' element={<TransferFund payment={paymentHistory} wallet={walletList} />} />
|
||||
<Route index element={<Balance coupon={couponHistory} wallet={walletList} />} />
|
||||
<Route index element={<Balance wallet={walletList} />} />
|
||||
<Route path='transfer-fund/add-recipient' element={<AddRecipient />} />
|
||||
<Route path='transfer-fund/confirm-transfer' element={<ConfirmTransfer payment={paymentHistory} wallet={walletList} />} />
|
||||
<Route path='*' element={<Navigate to='/' />} />
|
||||
|
||||
@@ -1,54 +1,60 @@
|
||||
import React from 'react';
|
||||
import { createRoutesFromChildren } from 'react-router-dom';
|
||||
|
||||
const PaginatedList = ({ onClick, prev, next, data, start, stop }) => {
|
||||
|
||||
if(data.length > process.env.REACT_APP_ITEM_PER_PAGE){
|
||||
if (data.length > process.env.REACT_APP_ITEM_PER_PAGE) {
|
||||
return (
|
||||
<div className='p-3 flex justify-center items-center space-x-2 border-t-2'>
|
||||
<div className="p-3 flex justify-center items-center min-h-[70px] space-x-2 border-t-2">
|
||||
{/* Render pagination buttons */}
|
||||
{!prev &&
|
||||
<button
|
||||
className={`p-2 ${prev ? 'border' : null}`}
|
||||
name='prev'
|
||||
onClick={onClick}
|
||||
>
|
||||
<><</>
|
||||
</button>
|
||||
}
|
||||
{!prev && (
|
||||
<button
|
||||
className={`p-2 border ${
|
||||
prev ? "border-black" : "border-transparent"
|
||||
} btn-shine rounded-full h-11 w-11`}
|
||||
name="prev"
|
||||
onClick={onClick}
|
||||
>
|
||||
<><</>
|
||||
</button>
|
||||
)}
|
||||
|
||||
{
|
||||
data.map((item, index)=>{
|
||||
if(index%process.env.REACT_APP_ITEM_PER_PAGE == 0 && index >= start && index <= stop){
|
||||
return (
|
||||
<button
|
||||
key={index}
|
||||
value={index}
|
||||
className={`p-2 ${index==start ? 'border' : null}`}
|
||||
onClick={onClick}
|
||||
name='page_num'
|
||||
disabled={index == start}
|
||||
>
|
||||
{index <= 0 ? index+1 : (index/process.env.REACT_APP_ITEM_PER_PAGE)+1}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
{!next &&
|
||||
{data.map((item, index) => {
|
||||
if (
|
||||
index % process.env.REACT_APP_ITEM_PER_PAGE == 0 &&
|
||||
index >= start &&
|
||||
index <= stop
|
||||
) {
|
||||
return (
|
||||
<button
|
||||
className={`p-2 ${next ? 'border' : null}`}
|
||||
name='next'
|
||||
key={index}
|
||||
value={index}
|
||||
className={`p-2 border ${
|
||||
index === start ? "border-black" : "border-transparent"
|
||||
} btn-shine rounded-full h-11 w-11`}
|
||||
onClick={onClick}
|
||||
name="page_num"
|
||||
disabled={index === start}
|
||||
>
|
||||
<>></>
|
||||
{index <= 0
|
||||
? index + 1
|
||||
: index / process.env.REACT_APP_ITEM_PER_PAGE + 1}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}else{
|
||||
return null
|
||||
);
|
||||
}
|
||||
})}
|
||||
|
||||
{!next && (
|
||||
<button
|
||||
className={`p-2 border ${
|
||||
next ? "border-black" : "border-transparent"
|
||||
} btn-shine rounded-full h-11 w-11`}
|
||||
name="next"
|
||||
onClick={onClick}
|
||||
>
|
||||
<>></>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
||||
|
||||
// User Profile
|
||||
let { firstname, lastname, email, profile_pic } = userDetails;
|
||||
let userEmail = email.split("@")[0];
|
||||
let userEmail = email?.split("@")[0];
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -14,6 +14,7 @@ import usersService from "../../services/UsersService";
|
||||
|
||||
export default function Layout({ children }) {
|
||||
const { drawer } = useSelector((state) => state.drawer);
|
||||
const {userJobList} = useSelector((state) => state.userJobList)
|
||||
const dispatch = useDispatch();
|
||||
const [MobileSideBar, setMobileSidebar] = useToggle(false);
|
||||
const [logoutModal, setLogoutModal] = useState(false);
|
||||
@@ -35,29 +36,24 @@ export default function Layout({ children }) {
|
||||
|
||||
//---------------------------------------
|
||||
/* LET U DEAL WITH JOB LIST - we need to centralize this list */
|
||||
const {jobListTable} = useSelector((state) => state.tableReload)
|
||||
const [MyJobList, setMyJobList] = useState({loading: true, data:[]});
|
||||
const api = new usersService();
|
||||
// const {jobListTable} = useSelector((state) => state.tableReload)
|
||||
// const [myJobList, setMyJobList] = useState({loading: true, data:[]});
|
||||
// const api = new usersService();
|
||||
|
||||
const getMyJobList = async () => {
|
||||
setMyJobList({loading: true, data:[]})
|
||||
try {
|
||||
const res = await api.getMyJobList();
|
||||
setMyJobList({loading: false, data:res.data})
|
||||
// setMyJobList(res.data);
|
||||
} catch (error) {
|
||||
setMyJobList({loading: false, data:[]})
|
||||
console.log("Error getting mode");
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
getMyJobList();
|
||||
}, [jobListTable]);
|
||||
// const getJobList = ()=>{
|
||||
// let jobLists = useSelector((state) => state.jobLists);
|
||||
// return jobLists;
|
||||
// }
|
||||
//---------------------------------------
|
||||
// const getMyJobList = async () => {
|
||||
// setMyJobList({loading: true, data:[]})
|
||||
// try {
|
||||
// const res = await api.getMyJobList();
|
||||
// setMyJobList({loading: false, data:res.data})
|
||||
// // setMyJobList(res.data);
|
||||
// } catch (error) {
|
||||
// setMyJobList({loading: false, data:[]})
|
||||
// console.log("Error getting mode");
|
||||
// }
|
||||
// };
|
||||
// useEffect(() => {
|
||||
// getMyJobList();
|
||||
// }, [jobListTable]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -75,6 +71,7 @@ export default function Layout({ children }) {
|
||||
logoutModalHandler={logoutModalHandler}
|
||||
sidebar={drawer}
|
||||
action={() => dispatch(drawerToggle())}
|
||||
myJobList={userJobList}
|
||||
/>
|
||||
</div>
|
||||
{MobileSideBar && (
|
||||
@@ -92,6 +89,7 @@ export default function Layout({ children }) {
|
||||
logoutModalHandler={logoutModalHandler}
|
||||
sidebar={MobileSideBar}
|
||||
action={() => setMobileSidebar.toggle()}
|
||||
myJobList={userJobList}
|
||||
/>
|
||||
</div>
|
||||
{/* end sidebar */}
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||
import Icons from "../Helpers/Icons";
|
||||
|
||||
export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
||||
export default function MobileSidebar({ sidebar, action, logoutModalHandler, myJobList }) {
|
||||
let { userDetails } = useSelector((state) => state.userDetails);
|
||||
const darkMode = useContext(DarkModeContext);
|
||||
|
||||
@@ -76,7 +76,7 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
||||
{/* menu and settings item */}
|
||||
<div className="menu-setting-items mb-11">
|
||||
{/* menus item */}
|
||||
<div className="menu-item transition-all duration-300 ease-in-out mb-14">
|
||||
<div className="menu-item transition-all duration-300 ease-in-out mb-5">
|
||||
<div className="heading mb-5 active">
|
||||
<h1 className="title text-xl font-bold text-purple">Menu</h1>
|
||||
</div>
|
||||
@@ -110,20 +110,17 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
||||
|
||||
{/* menu and settings item */}
|
||||
{userDetails?.account_type !== "FAMILY" && (
|
||||
|
||||
<div className="menu-setting-items mb-11">
|
||||
{/* menus item */}
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||
sidebar ? "mb-14" : ""
|
||||
sidebar ? "mb-5" : "mb-2"
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
Family
|
||||
</h1>
|
||||
</div>
|
||||
<div className="items">
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
Family
|
||||
</h1>
|
||||
</div>
|
||||
<ul className="flex flex-col space-y-6">
|
||||
<ListItem
|
||||
title="Family Corner"
|
||||
@@ -134,25 +131,22 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{userDetails?.account_type !== "FAMILY" && (
|
||||
<>
|
||||
{!userDetails?.post_jobs ? (
|
||||
<div className="menu-setting-items mb-11">
|
||||
{/* menus item */}
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out bg-pink dark:bg-dark-white rounded-2xl p-3 ${
|
||||
sidebar ? "mb-14" : "rounded-none p-0"
|
||||
sidebar ? "mb-5" : "mb-2 rounded-none p-0"
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
Job Post
|
||||
</h1>
|
||||
</div>
|
||||
<div className="items">
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
Job Post
|
||||
</h1>
|
||||
</div>
|
||||
<ul className="flex flex-col space-y-6">
|
||||
<li className="item group">
|
||||
<NavLink
|
||||
@@ -179,9 +173,12 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : jobLists?.result_list?.length ? (
|
||||
<div className="setting-item">
|
||||
) : myJobList?.data?.result_list?.length ? (
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||
sidebar ? "mb-5" : "mb-2"
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
My Jobs
|
||||
@@ -214,7 +211,11 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) {
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="setting-item">
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||
sidebar ? "mb-5" : "mb-2"
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
My Jobs
|
||||
|
||||
@@ -51,24 +51,11 @@ export default function RightSideBar() {
|
||||
<div className="item flex space-x-3 items-center mb-4">
|
||||
{/* image */}
|
||||
<div className="w-8 h-8 rounded-full">
|
||||
<svg
|
||||
width="40"
|
||||
height="41"
|
||||
viewBox="0 0 40 41"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<ellipse
|
||||
cx="20"
|
||||
cy="20.5745"
|
||||
rx="20"
|
||||
ry="19.9392"
|
||||
fill="#FDD903"
|
||||
/>
|
||||
<path
|
||||
d="M30.0432 20.1565C29.8181 20.2625 29.8101 20.5908 30.0328 20.7018C31.565 21.4629 32.3814 22.7261 32.4556 24.4068C32.5245 25.8708 32.4715 27.3349 32.4821 28.7989C32.4821 29.0738 32.3973 29.1636 32.1216 29.1636C30.0169 29.153 27.907 29.153 25.8023 29.1636C25.4524 29.1636 25.4471 28.9945 25.4471 28.7408C25.4524 27.5569 25.4524 26.3782 25.4471 25.1943C25.4418 23.91 24.9169 23.318 23.6287 23.3022C20.8825 23.2705 18.1417 23.2916 15.3955 23.2757C15.0615 23.2757 15.035 23.4237 15.035 23.688C15.0456 25.3476 15.0297 27.0072 15.0456 28.6668C15.0509 29.0526 14.9608 29.1742 14.5526 29.1689C12.5327 29.1478 10.5182 29.1478 8.49834 29.1689C8.09543 29.1742 8 29.0632 8 28.6668C8.0106 23.2123 8.0106 17.7578 8.0053 12.3034C8.0053 11.9757 8.03181 11.8013 8.44532 11.8013C14.1444 11.8171 19.8488 11.8066 25.5478 11.833C27.0216 11.8383 28.4901 11.9968 29.842 12.6469C31.5279 13.4609 32.3125 14.8562 32.2117 16.7748C32.1332 18.3693 31.4419 19.4977 30.0432 20.1565ZM19.6208 18.6035C20.909 18.6035 22.2026 18.6088 23.4909 18.5982C23.7877 18.5982 24.0952 18.5824 24.3868 18.5242C24.7791 18.4449 24.9965 18.186 25.0018 17.7737C25.0071 17.3509 24.8109 17.0549 24.3815 16.9809C24.0899 16.9281 23.7877 16.9016 23.4855 16.9016C21.084 16.8963 18.6771 16.8963 16.2756 16.8963C15.0191 16.8963 15.035 16.8963 15.0297 18.1701C15.0297 18.5295 15.1464 18.6088 15.4804 18.6035C16.864 18.5929 18.2424 18.6035 19.6208 18.6035Z"
|
||||
fill="#020200"
|
||||
/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="history">
|
||||
<g data-name="14"><circle cx="9" cy="14" r="7" fill="#ffd54f"></circle>
|
||||
<path fill="#ef6c00" d="M21 9H17a1 1 0 0 1 0-2h4a1 1 0 0 1 0 2zM21 5H3A1 1 0 0 1 3 3H21a1 1 0 0 1 0 2zM21 13H19a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2zM21 17H19a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2zM21 21H17a1 1 0 0 1 0-2h4a1 1 0 0 1 0 2z"></path><path fill="#ff8f00" d="M10,10a1,1,0,0,0-2,0v3.59L6.29,15.29a1,1,0,1,0,1.41,1.41l2-2A1,1,0,0,0,10,14Z">
|
||||
</path>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
{/* name */}
|
||||
@@ -83,37 +70,8 @@ export default function RightSideBar() {
|
||||
<div className="item flex space-x-3 items-center mb-4">
|
||||
{/* image */}
|
||||
<div className="w-8 h-8 rounded-full">
|
||||
<svg
|
||||
width="40"
|
||||
height="41"
|
||||
viewBox="0 0 40 41"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<ellipse
|
||||
cx="20"
|
||||
cy="20.4043"
|
||||
rx="20"
|
||||
ry="19.9392"
|
||||
fill="url(#paint0_linear_249_2794)"
|
||||
/>
|
||||
<path
|
||||
d="M16.7403 14.4243C17.8836 14.4243 19.0272 14.4261 20.1705 14.4233C20.5666 14.4226 20.9612 14.4431 21.3489 14.5184C22.272 14.698 23.0864 15.0843 23.742 15.7545C23.8172 15.8312 23.8625 15.8401 23.9512 15.7762C24.8988 15.091 25.9527 14.6419 27.1244 14.484C27.8811 14.3821 28.6353 14.4115 29.3836 14.5947C30.3403 14.829 31.1613 15.277 31.8103 16.0013C32.413 16.674 32.7934 17.4511 32.9361 18.3386C33.054 19.0731 32.9989 19.7955 32.8499 20.5197C32.6718 21.3867 32.5167 22.2578 32.3477 23.1265C32.1933 23.92 32.0337 24.7123 31.8768 25.5054C31.7749 26.0202 31.6807 26.5367 31.5694 27.0493C31.5198 27.2772 31.3745 27.371 31.1365 27.3713C29.9446 27.3727 28.7528 27.3742 27.561 27.3745C27.2971 27.3745 27.1996 27.273 27.2463 27.0252C27.3872 26.2776 27.5365 25.5313 27.6807 24.7844C27.8136 24.095 27.9428 23.4052 28.076 22.7158C28.2148 21.9976 28.356 21.2798 28.4958 20.5616C28.5601 20.2311 28.6272 19.9038 28.5196 19.5662C28.3527 19.0422 27.8877 18.7075 27.3171 18.667C26.2023 18.5882 25.2894 19.4682 25.1459 20.415C25.0269 21.2017 24.844 21.9788 24.6918 22.7609C24.5703 23.386 24.4546 24.0126 24.3319 24.6378C24.1727 25.4483 24.0125 26.2587 23.8446 27.0674C23.8026 27.2694 23.65 27.3749 23.4365 27.3752C22.2322 27.377 21.028 27.3774 19.8237 27.3763C19.5956 27.3759 19.4854 27.2393 19.5292 27.0142C19.6609 26.3365 19.7956 25.6591 19.9278 24.9814C20.0869 24.1649 20.2446 23.3481 20.4031 22.5312C20.5549 21.7495 20.7017 20.9671 20.8604 20.1868C21.013 19.4359 20.4038 18.7124 19.6179 18.6688C18.5688 18.6102 17.6843 19.3695 17.4934 20.2162C17.3587 20.8144 17.2583 21.42 17.1415 22.0225C16.9389 23.0648 16.7359 24.1067 16.5322 25.1486C16.4114 25.7681 16.2895 26.3873 16.1683 27.0067C16.1187 27.2602 15.9832 27.3798 15.7197 27.3802C13.4145 27.3816 11.1097 27.3816 8.8045 27.3795C8.47305 27.3791 8.20621 27.1083 8.20548 26.7866C8.20475 26.471 8.48911 26.192 8.82823 26.1902C9.56414 26.186 10.3 26.1916 11.0359 26.1863C11.4995 26.1828 11.7854 25.749 11.5864 25.3581C11.5003 25.1888 11.3524 25.0904 11.1641 25.0503C11.0078 25.0169 10.8491 25.0304 10.6914 25.0301C9.77293 25.029 8.85451 25.0304 7.93645 25.0287C7.58712 25.0279 7.36408 24.893 7.27063 24.636C7.12754 24.242 7.42395 23.8444 7.87878 23.8323C8.18869 23.8241 8.49897 23.8305 8.80925 23.8305C9.95253 23.8302 11.0962 23.8312 12.2395 23.8287C12.5326 23.828 12.7702 23.6388 12.8148 23.3814C12.867 23.0807 12.7301 22.839 12.4494 22.7243C12.3493 22.6835 12.2468 22.6885 12.1442 22.6885C11.2805 22.687 10.4169 22.687 9.55318 22.6863C9.25933 22.686 9.03557 22.5749 8.91766 22.3001C8.76471 21.944 8.9998 21.5713 9.39257 21.5209C10.0653 21.4346 10.7403 21.5028 11.4138 21.4793C11.5171 21.4758 11.6207 21.4804 11.7237 21.4719C12.0642 21.4435 12.2891 21.206 12.2814 20.8886C12.2741 20.5943 12.0037 20.3351 11.6861 20.3277C11.4127 20.3213 11.1385 20.3316 10.8651 20.3231C10.5895 20.3142 10.3292 20.098 10.2884 19.8601C10.2362 19.5556 10.365 19.3056 10.633 19.1849C10.7487 19.1327 10.871 19.1402 10.9914 19.1398C11.7211 19.1367 12.4512 19.1388 13.1809 19.1342C13.5488 19.1317 13.7376 19.0099 13.8482 18.7444C13.9891 18.4064 13.6992 18.0148 13.3919 17.9829C13.1791 17.9609 12.967 17.9687 12.7549 17.9683C11.8124 17.9673 10.8699 17.9729 9.92734 17.9744C9.65539 17.9747 9.39002 17.6992 9.37468 17.4074C9.35899 17.1096 9.62181 16.8153 9.93318 16.7865C10.0117 16.7794 10.0912 16.7826 10.1701 16.7826C11.5689 16.7823 12.9677 16.783 14.3665 16.7819C14.6666 16.7816 14.8754 16.6342 14.9535 16.3754C15.0312 16.1184 14.9316 15.8546 14.702 15.7112C14.5728 15.6303 14.4264 15.625 14.28 15.6246C13.8055 15.6235 13.3313 15.6285 12.8567 15.6221C12.4822 15.6171 12.2252 15.4088 12.1876 15.0964C12.1435 14.7271 12.4253 14.4282 12.8359 14.4254C13.5963 14.4204 14.3563 14.4236 15.1167 14.4236C15.658 14.4236 16.1993 14.4236 16.7407 14.4236C16.7403 14.424 16.7403 14.424 16.7403 14.4243Z"
|
||||
fill="white"
|
||||
/>
|
||||
<defs>
|
||||
<linearGradient
|
||||
id="paint0_linear_249_2794"
|
||||
x1="3"
|
||||
y1="16.4165"
|
||||
x2="26.9783"
|
||||
y2="26.4379"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#E100C5" />
|
||||
<stop offset="1" stopColor="#FF812B" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="add-user">
|
||||
<path fill="#9bcb5b" d="M12 13.4c-2 0-3.7-1.6-3.7-3.6s1.6-3.7 3.6-3.7 3.7 1.6 3.7 3.6-1.6 3.6-3.6 3.7zm0-6.2c-1.4 0-2.6 1.1-2.6 2.6 0 1.4 1.1 2.6 2.6 2.6s2.6-1.1 2.6-2.6c-.1-1.5-1.2-2.6-2.6-2.6z"></path><path fill="#9bcb5b" d="M16.6 17.9c-.3 0-.5-.2-.6-.5 0-2.2-1.8-4-4-4s-4 1.8-4 4c0 .3-.3.5-.6.5-.2 0-.4-.2-.5-.5 0-2.8 2.3-5.1 5.1-5.1s5.1 2.3 5.1 5.1c0 .3-.2.5-.5.5z"></path><path fill="#0376bc" d="M12 23.7C5.5 23.7.3 18.4.3 12 .3 5.5 5.6.3 12 .3c2.6 0 5.1.9 7.2 2.5.2.2.2.6 0 .8-.2.2-.4.2-.7.1-1.9-1.4-4.1-2.2-6.5-2.2C6.2 1.4 1.4 6.2 1.4 12S6.2 22.6 12 22.6 22.6 17.8 22.6 12c0-2.4-.8-4.6-2.2-6.5-.2-.3-.1-.6.2-.8.2-.1.5-.1.7.1 1.6 2 2.5 4.6 2.4 7.2 0 6.4-5.3 11.7-11.7 11.7z"></path><circle cx="20.2" cy="20.3" r="2.4" fill="#fff"></circle><path fill="#9bcb5b" d="M18 18.1c.6-.6 1.4-.9 2.2-.9.8 0 1.6.3 2.2.9s1 1.4.9 2.2c0 .8-.3 1.6-.9 2.2s-1.4 1-2.2.9c-.8 0-1.6-.3-2.2-.9s-1-1.4-.9-2.2c-.1-.8.3-1.7.9-2.2zm3.8 2.5V20h-1.3v-1.3h-.6V20h-1.3v.6h1.3v1.3h.6v-1.3h1.3z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{/* name */}
|
||||
@@ -130,29 +88,9 @@ export default function RightSideBar() {
|
||||
<div className="item flex space-x-3 items-center mb-4">
|
||||
{/* image */}
|
||||
<div className="w-8 h-8 rounded-full">
|
||||
<svg
|
||||
width="40"
|
||||
height="41"
|
||||
viewBox="0 0 40 41"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<ellipse
|
||||
cx="20"
|
||||
cy="20.2341"
|
||||
rx="20"
|
||||
ry="19.9392"
|
||||
fill="#5165FF"
|
||||
/>
|
||||
<path
|
||||
d="M26.1647 27.2085C22.5316 27.2448 19.3317 24.2111 19.3359 20.2195C19.3402 16.4128 22.3393 13.2525 26.1704 13.2554C30.0813 13.2583 33.012 16.5264 33.0006 20.2501C32.9892 24.1456 29.8505 27.2492 26.1647 27.2085Z"
|
||||
fill="white"
|
||||
/>
|
||||
<path
|
||||
d="M20.5815 27.1983C20.5217 27.2245 20.4405 27.207 20.3607 27.207C16.0039 27.2085 11.647 27.2085 7.29019 27.2085C7.25742 27.2085 7.22465 27.2099 7.1933 27.2085C7.01094 27.2026 7.00951 27.2026 7.00381 27.0076C7.00239 26.9581 7.00381 26.9086 7.00381 26.8576C7.00381 22.4395 7.00381 18.0214 7.00381 13.6033C7.00381 13.5072 6.99099 13.4082 7.01236 13.334C11.5373 17.9559 16.0566 22.5749 20.5815 27.1983Z"
|
||||
fill="white"
|
||||
/>
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" id="InternationalUser">
|
||||
<path fill="#e6e7f9" d="M38.5 31.1c2.1-1.1 3.9-2.5 5.4-4.4h-3.2c-.6 1.6-1.3 3.1-2.2 4.4zm-5.8 1.4c2-.7 3.7-2.8 4.9-5.8h-4.9v5.8zm8.8-8.6h4.2c.9-1.8 1.5-3.7 1.7-5.8h-5.1c-.1 2-.4 4-.8 5.8zm2.4-17.3c-1.5-1.8-3.3-3.3-5.4-4.4.8 1.2 1.6 2.7 2.2 4.4h3.2zm-5.3 2.9h-5.9v5.8h6.7c-.1-2.1-.4-4.1-.8-5.8zm3.7 5.8h5.1c-.2-2.1-.8-4-1.7-5.8h-4.2c.4 1.8.7 3.7.8 5.8zM32.7.8v5.8h4.9c-1.2-2.9-2.9-5.1-4.9-5.8zm6.7 17.3h-6.7v5.8h5.9c.4-1.8.7-3.8.8-5.8zM25 6.6h4.9V.8c-2 .7-3.7 2.9-4.9 5.8zm-1.8 8.7h6.7V9.5H24c-.4 1.7-.7 3.7-.8 5.8zm6.7 17.2v-5.8H25c1.2 3 2.9 5.1 4.9 5.8zM24.1 2.3c-2.1 1.1-3.9 2.5-5.4 4.4H22c.5-1.7 1.3-3.2 2.1-4.4zM24 23.9h5.9v-5.8h-6.7c.1 2 .4 4 .8 5.8z" className="colorc1e5ff svgShape"></path><path fill="#ff6699" d="M3.7 44.7c0 1.6 1.2 2.8 2.8 2.8 1.3 0 2.4-.9 2.7-2.2.3 1.3 1.4 2.2 2.7 2.2 1.5 0 2.8-1.3 2.8-2.8V30.1h3.1V18.8c0-4.2-3.3-7.5-7.4-7.5H8c-4.1 0-7.4 3.4-7.4 7.5v11.3h3.1v14.6z" className="colorff99b0 svgShape"></path><path fill="#998da0" d="M9.2 10.3c2.4 0 4.4-2.2 4.4-4.9S11.6.5 9.2.5C6.8.5 4.8 2.7 4.8 5.4s2 4.9 4.4 4.9z" className="colorffd499 svgShape"></path><path fill="#e6e7f9" d="M16.9 9.5c-.3.6-.5 1.2-.8 1.8 1.3 1 2.3 2.4 2.9 4h1.3c.1-2 .3-4 .8-5.8h-4.2zm2.9 9.3v5.1h1.4c-.4-1.8-.7-3.8-.8-5.8h-.6c-.1.2 0 .4 0 .7zm2.2 7.9h-2.2v1.2c1.3 1.3 2.7 2.4 4.4 3.2-.9-1.3-1.7-2.8-2.2-4.4z" className="colorc1e5ff svgShape"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{/* name */}
|
||||
<div>
|
||||
|
||||
@@ -8,11 +8,10 @@ import {
|
||||
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||
import Icons from "../Helpers/Icons";
|
||||
|
||||
export default function Sidebar({ sidebar, action, logoutModalHandler }) {
|
||||
export default function Sidebar({ sidebar, action, logoutModalHandler, myJobList }) {
|
||||
const darkMode = useContext(DarkModeContext);
|
||||
|
||||
let { userDetails } = useSelector((state) => state.userDetails);
|
||||
console.log('user-details for job',userDetails);
|
||||
//const jobLists = getJobList(); // pass from upper - we need in a lot of places
|
||||
let { jobLists } = useSelector((state) => state.jobLists);
|
||||
const marketData = jobLists?.result_list;
|
||||
@@ -96,7 +95,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
|
||||
{/* menus item */}
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||
sidebar ? "mb-14" : ""
|
||||
sidebar ? "mb-5" : "mb-2"
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
@@ -132,19 +131,17 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
|
||||
|
||||
{/* menu and settings item */}
|
||||
{userDetails?.account_type !== "FAMILY" && (
|
||||
<div className="menu-setting-items mb-11">
|
||||
{/* menus item */}
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||
sidebar ? "mb-14" : ""
|
||||
sidebar ? "my-5" : ""
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
Family
|
||||
</h1>
|
||||
</div>
|
||||
<div className="items">
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
Family
|
||||
</h1>
|
||||
</div>
|
||||
<ul className="flex flex-col space-y-6">
|
||||
<ListItem
|
||||
title="Family Corner"
|
||||
@@ -155,92 +152,94 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) {
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{userDetails?.account_type !== "FAMILY" && (
|
||||
<>
|
||||
{!userDetails?.post_jobs ? (
|
||||
<div className="menu-setting-items mb-11">
|
||||
{/* menus item */}
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out bg-pink dark:bg-dark-white rounded-2xl p-3 ${
|
||||
sidebar ? "mb-14" : "rounded-none p-0"
|
||||
}`}
|
||||
>
|
||||
<div className="items">
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
Job Post
|
||||
</h1>
|
||||
</div>
|
||||
<ul className="flex flex-col space-y-6">
|
||||
<li className="item group">
|
||||
<NavLink
|
||||
to="/start-job"
|
||||
className={`nav-item flex items-center ${
|
||||
((navData) => (navData.isActive ? "active" : ""),
|
||||
sidebar
|
||||
? "justify-start space-x-3.5"
|
||||
: "justify-center")
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out bg-pink dark:bg-dark-white rounded-2xl p-3 ${
|
||||
sidebar ? "mb-5" : "mb-2 rounded-none p-0"
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
Job Post
|
||||
</h1>
|
||||
</div>
|
||||
<div className="items">
|
||||
<ul className="flex flex-col space-y-6">
|
||||
<li className="item group">
|
||||
<NavLink
|
||||
to="/start-job"
|
||||
className={`nav-item flex items-center ${
|
||||
((navData) => (navData.isActive ? "active" : ""),
|
||||
sidebar
|
||||
? "justify-start space-x-3.5"
|
||||
: "justify-center")
|
||||
}`}
|
||||
>
|
||||
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white dark:text-lighter-gray">
|
||||
<Icons name="people-two" />
|
||||
</span>
|
||||
<span
|
||||
className={`item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium ${
|
||||
sidebar ? "active flex-1" : "w-0"
|
||||
}`}
|
||||
>
|
||||
<span className="item-icon group-hover:bg-purple group-hover:text-white w-8 h-8 flex justify-center items-center transition-all duration-300 ease-in-out bg-light-purple dark:bg-dark-light-purple rounded-full text-dark-gray dark:text-white dark:text-lighter-gray">
|
||||
<Icons name="people-two" />
|
||||
</span>
|
||||
<span
|
||||
className={`item-content group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray relative font-medium ${
|
||||
sidebar ? "active flex-1" : "w-0"
|
||||
}`}
|
||||
>
|
||||
Enable Job Post
|
||||
</span>
|
||||
</NavLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
Enable Job Post
|
||||
</span>
|
||||
</NavLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
) : jobLists?.result_list?.length ? (
|
||||
<>
|
||||
<div className="setting-item">
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
My Jobs
|
||||
</h1>
|
||||
</div>
|
||||
<div className="items">
|
||||
<ul className="flex flex-col space-y-6">
|
||||
{[
|
||||
{
|
||||
name: "List",
|
||||
path: "/myjobs",
|
||||
iconName: "people-two",
|
||||
},
|
||||
{
|
||||
name: "Pending",
|
||||
path: "/my-pending-jobs",
|
||||
iconName: "people-two",
|
||||
},
|
||||
{
|
||||
name: "Active",
|
||||
path: "/my-active-jobs",
|
||||
iconName: "people-two",
|
||||
},
|
||||
].map(({ name, path, iconName }, idx) => (
|
||||
<ListItem
|
||||
key={idx}
|
||||
title={name}
|
||||
route={path}
|
||||
sidebar={sidebar}
|
||||
iconName={iconName}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
) : myJobList?.data?.result_list?.length ? (
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||
sidebar ? "mb-5" : "mb-2"
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
My Jobs
|
||||
</h1>
|
||||
</div>
|
||||
</>
|
||||
<div className="items">
|
||||
<ul className="flex flex-col space-y-6">
|
||||
{[
|
||||
{
|
||||
name: "List",
|
||||
path: "/myjobs",
|
||||
iconName: "people-two",
|
||||
},
|
||||
{
|
||||
name: "Pending",
|
||||
path: "/my-pending-jobs",
|
||||
iconName: "people-two",
|
||||
},
|
||||
{
|
||||
name: "Active",
|
||||
path: "/my-active-jobs",
|
||||
iconName: "people-two",
|
||||
},
|
||||
].map(({ name, path, iconName }, idx) => (
|
||||
<ListItem
|
||||
key={idx}
|
||||
title={name}
|
||||
route={path}
|
||||
sidebar={sidebar}
|
||||
iconName={iconName}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="setting-item">
|
||||
<div
|
||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||
sidebar ? "mb-5" : "mb-2"
|
||||
}`}
|
||||
>
|
||||
<div className="heading mb-5">
|
||||
<h1 className="title text-xl font-bold text-purple">
|
||||
My Jobs
|
||||
|
||||
@@ -1,34 +1,35 @@
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import RecomendedSliders from "./RecomendedSliders";
|
||||
|
||||
export default function CommonHead({ className,commonHeadData }) {
|
||||
const vvv= commonHeadData();
|
||||
console.log("UUUUUUUU-",vvv);
|
||||
return (
|
||||
<div
|
||||
className={`create-nft w-full lg:h-[140px] shadow lg:flex rounded-lg justify-between items-center md:p-9 p-4 bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] -2 border-pink mb-10 ${
|
||||
className={`create-nft w-full lg:h-[140px] shadow lg:flex rounded-lg justify-between items-center md:p-2 p-2 bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] -2 border-pink mb-10 ${
|
||||
className || ""
|
||||
}`}
|
||||
>
|
||||
<div className="lg:w-8/12 w-full mb-8 lg:mb-0">
|
||||
<h1 className="text-2xl text-dark-gray dark:text-white font-bold mb-2">
|
||||
This is common head which will appear as needed , will take many shape
|
||||
</h1>
|
||||
<p className="text-base text-thin-light-gray tracking-wide">
|
||||
some space for extra texts here
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex-1 flex lg:justify-end">
|
||||
<div className="flex items-center space-x-5">
|
||||
<Link
|
||||
to="/mytask"
|
||||
className="w-40 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
>
|
||||
View Task
|
||||
</Link>
|
||||
{commonHeadData?.length > 0 && <RecomendedSliders bannerData={commonHeadData} /> }
|
||||
{/*<div className="lg:w-8/12 w-full mb-8 lg:mb-0">*/}
|
||||
{/* /!*<h1 className="text-2xl text-dark-gray dark:text-white font-bold mb-2">*!/*/}
|
||||
{/* /!* This is common head which will appear as needed , will take many shape*!/*/}
|
||||
{/* /!*</h1>*!/*/}
|
||||
{/* /!*<p className="text-base text-thin-light-gray tracking-wide">*!/*/}
|
||||
{/* /!* some space for extra texts here*!/*/}
|
||||
{/* /!*</p>*!/*/}
|
||||
{/* */}
|
||||
{/*</div>*/}
|
||||
{/*<div className="flex-1 flex lg:justify-end">*/}
|
||||
{/* <div className="flex items-center space-x-5">*/}
|
||||
{/* <Link*/}
|
||||
{/* to="/mytask"*/}
|
||||
{/* className="w-40 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"*/}
|
||||
{/* >*/}
|
||||
{/* View Task*/}
|
||||
{/* </Link>*/}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/* </div>*/}
|
||||
{/*</div>*/}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
import React, { useRef } from "react";
|
||||
import top from "../../assets/images/top-buyer-1png.png";
|
||||
import top2 from "../../assets/images/top-buyer-2.png";
|
||||
import top3 from "../../assets/images/top-buyer-3.png";
|
||||
import top4 from "../../assets/images/top-buyer-4.png";
|
||||
import Icons from "../Helpers/Icons";
|
||||
import SliderCom from "../Helpers/SliderCom";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
export default function RecomendedSliders({ className,bannerData }) {
|
||||
const settings = {
|
||||
arrows: false,
|
||||
dots: false,
|
||||
infinite: bannerData.length > 4 ? true : false,
|
||||
autoplay: true,
|
||||
slidesToShow: bannerData.length > 4 ? 4 : bannerData.length,
|
||||
slidesToScroll: 1,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 426,
|
||||
settings: {
|
||||
infinite: bannerData.length > 2 ? true : false,
|
||||
slidesToShow: bannerData.length > 2 ? 2 : bannerData.length,
|
||||
slidesToScroll: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
const sellSlider = useRef(null);
|
||||
const buySlider = useRef(null);
|
||||
const prevHandler = (value) => {
|
||||
if (value === "sell") {
|
||||
sellSlider.current.slickPrev();
|
||||
}
|
||||
if (value === "buy") {
|
||||
buySlider.current.slickPrev();
|
||||
}
|
||||
};
|
||||
const nextHandler = (value) => {
|
||||
if (value === "sell") {
|
||||
sellSlider.current.slickNext();
|
||||
}
|
||||
if (value === "buy") {
|
||||
buySlider.current.slickNext();
|
||||
}
|
||||
};
|
||||
return (
|
||||
<>
|
||||
{/*<div className="heading flex justify-between items-center mb-4">*/}
|
||||
{/* <h1 className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">*/}
|
||||
{/* Top Seller*/}
|
||||
{/* </h1>*/}
|
||||
{/* <div className="slider-btns flex space-x-4">*/}
|
||||
{/* <button*/}
|
||||
{/* onClick={() => nextHandler("sell")}*/}
|
||||
{/* type="button"*/}
|
||||
{/* className="transform rotate-180 text-dark-gray dark:text-white dark:opacity-25"*/}
|
||||
{/* >*/}
|
||||
{/* <Icons name="arrows" />*/}
|
||||
{/* </button>*/}
|
||||
{/* <button*/}
|
||||
{/* onClick={() => prevHandler("sell")}*/}
|
||||
{/* type="button"*/}
|
||||
{/* className="transform rotate-180"*/}
|
||||
{/* >*/}
|
||||
{/* <div className=" text-dark-gray dark:text-white">*/}
|
||||
{/* <svg*/}
|
||||
{/* width="11"*/}
|
||||
{/* height="19"*/}
|
||||
{/* viewBox="0 0 11 19"*/}
|
||||
{/* fill="none"*/}
|
||||
{/* xmlns="http://www.w3.org/2000/svg"*/}
|
||||
{/* >*/}
|
||||
{/* <path*/}
|
||||
{/* d="M9.09766 1.1499L1.13307 9.11449L9.09766 17.0791"*/}
|
||||
{/* stroke="url(#paint0_linear_220_23410)"*/}
|
||||
{/* strokeWidth="2"*/}
|
||||
{/* strokeLinecap="round"*/}
|
||||
{/* strokeLinejoin="round"*/}
|
||||
{/* />*/}
|
||||
{/* <defs>*/}
|
||||
{/* <linearGradient*/}
|
||||
{/* id="paint0_linear_220_23410"*/}
|
||||
{/* x1="9.09766"*/}
|
||||
{/* y1="1.1499"*/}
|
||||
{/* x2="-4.2474"*/}
|
||||
{/* y2="7.96749"*/}
|
||||
{/* gradientUnits="userSpaceOnUse"*/}
|
||||
{/* >*/}
|
||||
{/* <stop stopColor="#F539F8" />*/}
|
||||
{/* <stop offset="0.416763" stopColor="#C342F9" />*/}
|
||||
{/* <stop offset="1" stopColor="#5356FB" />*/}
|
||||
{/* </linearGradient>*/}
|
||||
{/* </defs>*/}
|
||||
{/* </svg>*/}
|
||||
{/* </div>*/}
|
||||
{/* </button>*/}
|
||||
{/* </div>*/}
|
||||
{/*</div>*/}
|
||||
<div className="slider-content">
|
||||
<SliderCom settings={settings} selector={sellSlider}>
|
||||
{bannerData.map((item, index) => (
|
||||
<Link key={index} to={`/${item.link_path}`}>
|
||||
<div className="item">
|
||||
<div className={`commonHeaderSliderItem flex flex-col justify-between items-center ${item.short_style}`}>
|
||||
{/* title */}
|
||||
<div className="flex justify-center">
|
||||
<p className="text-base font-bold text-dark-gray dark:text-white">
|
||||
{item.short_title}
|
||||
</p>
|
||||
</div>
|
||||
{/* username */}
|
||||
<div className="flex justify-center mb-1">
|
||||
<p className="text-xs text-thin-light-gray">
|
||||
{item.short_description}
|
||||
</p>
|
||||
</div>
|
||||
{/* items */}
|
||||
<div className="flex justify-center">
|
||||
<div className="flex space-x-1 items-center text-purple text-xs">
|
||||
<span>{item.short_button_text}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</SliderCom>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import ModalCom from "../Helpers/ModalCom";
|
||||
import { Form, Formik } from "formik";
|
||||
import { Field, Form, Formik } from "formik";
|
||||
import * as Yup from "yup";
|
||||
import InputCom from "../Helpers/Inputs/InputCom";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
@@ -245,20 +245,34 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
|
||||
</div>
|
||||
|
||||
<div className="field w-full mb-6">
|
||||
<InputCom
|
||||
fieldClass="px-6"
|
||||
label="Timeline"
|
||||
labelClass="tracking-wide"
|
||||
inputBg="bg-slate-100"
|
||||
inputClass=" input-curve lg border border-[#dce4e9]"
|
||||
type="text"
|
||||
name="timeline_days"
|
||||
spanTag=" - Expected duration of this task"
|
||||
// placeholder="Please Enter Detail Description of Job"
|
||||
value={props.values.timeline_days}
|
||||
inputHandler={props.handleChange}
|
||||
blurHandler={props.handleBlur}
|
||||
/>
|
||||
<div className={`flex items-center justify-between mb-2.5`}>
|
||||
<label
|
||||
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
|
||||
htmlFor="timeline_days"
|
||||
>
|
||||
Timeline
|
||||
<span className="text-green-700 text-sm tracking-wide">
|
||||
- Expected duration of this task
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<Field
|
||||
component="select"
|
||||
name="timeline_days"
|
||||
className="input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none"
|
||||
value={props.values.timeline_days}
|
||||
>
|
||||
<option value="">Select Duration</option>
|
||||
{publicArray.map(({ name, duration }, idx) => (
|
||||
<option
|
||||
className="text-slate-500 text-lg"
|
||||
value={duration}
|
||||
>
|
||||
{name}
|
||||
</option>
|
||||
))}
|
||||
</Field>
|
||||
{props.errors.timeline_days &&
|
||||
props.touched.timeline_days && (
|
||||
<p className="text-sm text-red-500">
|
||||
@@ -316,3 +330,16 @@ const EditJobPopOut = ({ details, onClose, situation, country }) => {
|
||||
};
|
||||
|
||||
export default EditJobPopOut;
|
||||
|
||||
const publicArray = [
|
||||
{ duration: 1, name: "1 day" },
|
||||
{ duration: 2, name: "2 days" },
|
||||
{ duration: 3, name: "3 days" },
|
||||
{ duration: 4, name: "4 days" },
|
||||
{ duration: 5, name: "5 days" },
|
||||
{ duration: 6, name: "6 days" },
|
||||
{ duration: 7, name: "1 week" },
|
||||
{ duration: 14, name: "2 weeks" },
|
||||
{ duration: 21, name: "3 weeks" },
|
||||
{ duration: 28, name: "4 weeks" },
|
||||
];
|
||||
|
||||
@@ -69,28 +69,49 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
};
|
||||
|
||||
let [textArea, setTextArea] = useState(details?.job_detail);
|
||||
const [errMsg, setErrMsg] = useState("")
|
||||
const [errMsg, setErrMsg] = useState({
|
||||
deliveryDetail: "",
|
||||
jobFields: {
|
||||
family: "",
|
||||
public: "",
|
||||
individual: "",
|
||||
group: "",
|
||||
},
|
||||
});
|
||||
|
||||
const handleInputChange = ({ target: { value } }) => {
|
||||
setTextArea(value);
|
||||
};
|
||||
|
||||
const errorHandler = ({target: {name}}) => {
|
||||
|
||||
}
|
||||
const errorHandler = ({ target: { name } }) => {
|
||||
try {
|
||||
if (name === "family")
|
||||
setErrMsg({ jobFields: { family: "please select a family member" } });
|
||||
else if (name === "public")
|
||||
setErrMsg({ jobFields: { public: "please select duration" } });
|
||||
else if (name === "individual")
|
||||
setErrMsg({ jobFields: { individual: "please enter email" } });
|
||||
else if (name === "group")
|
||||
setErrMsg({ jobFields: { group: "please select a family member" } });
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
setErrMsg({ jobFields: "" });
|
||||
}, 3000);
|
||||
}
|
||||
};
|
||||
|
||||
const jobFieldHandler = async (values, helpers) => {
|
||||
let { job_id, job_uid } = details;
|
||||
|
||||
if(!textArea) {
|
||||
setErrMsg("delivery detail is required!")
|
||||
return
|
||||
if (!textArea) {
|
||||
setErrMsg({ deliveryDetail: "delivery detail is required!" });
|
||||
return;
|
||||
}
|
||||
|
||||
let jobReq = {
|
||||
job_id,
|
||||
job_uid,
|
||||
job_description: textArea
|
||||
job_description: textArea,
|
||||
};
|
||||
let reqData;
|
||||
|
||||
@@ -131,8 +152,7 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
};
|
||||
setLoader({ jobFields: { group: true } });
|
||||
} else {
|
||||
setErrMsg("err herre")
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -148,7 +168,7 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalCom action={onClose} situation={situation} className="edit-popup">
|
||||
<ModalCom action={onClose} situation={situation} className="job-popup">
|
||||
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
||||
<h1 className="text-base md:text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
@@ -218,7 +238,7 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
value={textArea}
|
||||
onChange={handleInputChange}
|
||||
/>
|
||||
{/* <p>{errMsg}</p> */}
|
||||
<p>{errMsg.deliveryDetail}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -231,7 +251,7 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
>
|
||||
{(props) => {
|
||||
return (
|
||||
<Form>
|
||||
<Form className="mb-4">
|
||||
{/* Assign to Family */}
|
||||
<JobFieldInput
|
||||
label="Assign to family"
|
||||
@@ -242,8 +262,14 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
btnText="Assign to family"
|
||||
optionText="Select Family"
|
||||
loader={loader?.jobFields.family}
|
||||
errorHandler={errorHandler}
|
||||
/>
|
||||
{/* <p>{errMsg}</p> */}
|
||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||
{" "}
|
||||
{props?.values.family === "" && (
|
||||
<span>{errMsg.jobFields.family}</span>
|
||||
)}
|
||||
</p>{" "}
|
||||
</Form>
|
||||
);
|
||||
}}
|
||||
@@ -256,7 +282,7 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
>
|
||||
{(props) => {
|
||||
return (
|
||||
<Form>
|
||||
<Form className="mb-4">
|
||||
{/* Offer this job to public input */}
|
||||
<JobFieldInput
|
||||
label="Offer this job to public"
|
||||
@@ -267,8 +293,14 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
btnText="Show Task to Public"
|
||||
optionText="Select Duration"
|
||||
loader={loader?.jobFields.public}
|
||||
errorHandler={errorHandler}
|
||||
/>
|
||||
{/* <p>{errMsg}</p> */}
|
||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||
{" "}
|
||||
{props?.values.public === "" && (
|
||||
<span>{errMsg.jobFields.public}</span>
|
||||
)}
|
||||
</p>{" "}
|
||||
</Form>
|
||||
);
|
||||
}}
|
||||
@@ -281,7 +313,7 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
>
|
||||
{(props) => {
|
||||
return (
|
||||
<Form>
|
||||
<Form className="mb-4">
|
||||
{/* Offer this job to individual input */}
|
||||
<JobFieldInput
|
||||
label="Offer this job to individual"
|
||||
@@ -292,8 +324,14 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
inputHandler={props?.handleChange}
|
||||
btnText="Send Offer to Individual"
|
||||
loader={loader?.jobFields.individual}
|
||||
errorHandler={errorHandler}
|
||||
/>
|
||||
{/* <p>{errMsg}</p> */}
|
||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||
{" "}
|
||||
{props?.values.individual === "" && (
|
||||
<span>{errMsg.jobFields.individual}</span>
|
||||
)}
|
||||
</p>{" "}
|
||||
</Form>
|
||||
);
|
||||
}}
|
||||
@@ -306,7 +344,7 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
>
|
||||
{(props) => {
|
||||
return (
|
||||
<Form>
|
||||
<Form className="mb-4">
|
||||
{/* Offer this job to your group input */}
|
||||
<JobFieldInput
|
||||
label="Offer this job to your Group"
|
||||
@@ -316,13 +354,18 @@ function JobListPopout({ details, onClose, situation }) {
|
||||
btnText="Send Order to Group"
|
||||
optionText="Group"
|
||||
loader={loader?.jobFields.group}
|
||||
errorHandler={errorHandler}
|
||||
/>
|
||||
{/* <p>{errMsg}</p> */}
|
||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||
{" "}
|
||||
{props?.values.group === "" && (
|
||||
<span>{errMsg.jobFields.group}</span>
|
||||
)}
|
||||
</p>
|
||||
</Form>
|
||||
);
|
||||
}}
|
||||
</Formik>
|
||||
|
||||
</div>
|
||||
{/* END OF ACTION SECTION */}
|
||||
</div>
|
||||
@@ -346,11 +389,12 @@ const JobFieldInput = ({
|
||||
btnText,
|
||||
parentClass,
|
||||
optionText,
|
||||
errorHandler,
|
||||
loader,
|
||||
data,
|
||||
}) => {
|
||||
return (
|
||||
<div className="field w-full p-3 mb-6 bg-red-50 rounded-md">
|
||||
<div className="field w-full p-3 mb-2 bg-red-50 rounded-md">
|
||||
{select && (
|
||||
<>
|
||||
<div className={`input-com ${parentClass}`}>
|
||||
@@ -407,7 +451,7 @@ const JobFieldInput = ({
|
||||
fieldClass="px-6"
|
||||
label={label}
|
||||
labelClass="tracking-wide"
|
||||
type="text"
|
||||
type="email"
|
||||
name={inputName}
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
@@ -421,6 +465,7 @@ const JobFieldInput = ({
|
||||
<button
|
||||
type="submit"
|
||||
name={inputName}
|
||||
onClick={errorHandler}
|
||||
className="px-2 py-1 text-sm text-white btn-gradient tracking-wide rounded-md"
|
||||
>
|
||||
{loader ? <LoadingSpinner size={5} /> : btnText}
|
||||
|
||||
@@ -43,7 +43,7 @@ function OfferJobPopout({details, onClose, situation}) {
|
||||
setRequestStatus({loading: false, status: true, message: `Offer ${name}ed Successfully`, trigger: ''})
|
||||
setTimeout(()=>{
|
||||
onClose()
|
||||
dispatch(tableReload({type:'JOBTABLE'}))
|
||||
dispatch(tableReload({type:'MYTASKTABLE'}))
|
||||
navigate('/mytask', {replace:true})
|
||||
setRequestStatus({loading: false, status: false, message: '', trigger: ''})
|
||||
},2000)
|
||||
|
||||
@@ -1,12 +1,64 @@
|
||||
import React from 'react'
|
||||
import Detail from './popoutcomponent/Detail'
|
||||
import ModalCom from '../Helpers/ModalCom'
|
||||
import React, { useCallback, useMemo, useState } from "react";
|
||||
import Detail from "./popoutcomponent/Detail";
|
||||
import ModalCom from "../Helpers/ModalCom";
|
||||
import usersService from "../../services/UsersService";
|
||||
import { toast } from "react-toastify";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
|
||||
const showSuccessToast = (message) => {
|
||||
toast.success(message, {
|
||||
autoClose: 3000,
|
||||
hideProgressBar: true,
|
||||
});
|
||||
};
|
||||
|
||||
function PendingJobsPopout({ details, onClose, situation }) {
|
||||
const [pendingJobLoader, setPendingJobLoader] = useState({
|
||||
extend: false,
|
||||
offer: false,
|
||||
});
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
|
||||
const handlePendingJobsBtn = useCallback(
|
||||
async ({ target: { name } }) => {
|
||||
let { job_uid, offer_code } = details;
|
||||
|
||||
let reqData;
|
||||
|
||||
let pendingData = { job_uid, offer_code };
|
||||
|
||||
try {
|
||||
if (name === "extend") {
|
||||
setPendingJobLoader({ extend: true });
|
||||
reqData = { ...pendingData };
|
||||
// let { data } =
|
||||
await apiCall.pendingJobExtend(reqData);
|
||||
// console.log("This is for extend", data);
|
||||
showSuccessToast("Job has been extended by a week!");
|
||||
} else if (name === "offer") {
|
||||
setPendingJobLoader({ offer: true });
|
||||
reqData = { ...pendingData };
|
||||
// let { data } =
|
||||
await apiCall.pendingJobSendTome(reqData);
|
||||
// console.log("This is for offer", data);
|
||||
showSuccessToast("Offer sent, check your email");
|
||||
} else return;
|
||||
|
||||
setTimeout(() => {
|
||||
setPendingJobLoader({ extend: false, offer: false });
|
||||
onClose();
|
||||
}, 2700);
|
||||
} catch (error) {
|
||||
setPendingJobLoader({ extend: false, offer: false });
|
||||
throw new Error(error);
|
||||
}
|
||||
},
|
||||
[onClose, apiCall, details]
|
||||
);
|
||||
|
||||
function PendingJobsPopout({details, onClose, situation}) {
|
||||
return (
|
||||
<ModalCom action={onClose} situation={situation}>
|
||||
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||
<ModalCom action={onClose} situation={situation} className="edit-popup">
|
||||
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
Manage Pending Item
|
||||
@@ -37,93 +89,131 @@ function PendingJobsPopout({details, onClose, situation}) {
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div className='md:flex bg-white rounded-lg shadow-lg'>
|
||||
<div className='p-4 w-full md:w-3/4 md:border-r-2'>
|
||||
<p className='text-base font-semibold text-slate-900 tracking-wide'>{details.title}</p>
|
||||
<div className='my-2 p-2 flex justify-start items-center space-x-2 bg-red-100 border-2 border-red-300'>
|
||||
<span className='w-8 h-8 text-center text-sm rounded-full flex justify-center items-center text-red-300 bg-yellow-100'>!</span>
|
||||
<div className=''>
|
||||
<p className='text-sm'>This Job have been sent to public view</p>
|
||||
<p className='text-sm text-slate-600'>This Job will expire</p>
|
||||
<div className="md:flex bg-white rounded-lg shadow-lg">
|
||||
<div className="p-4 w-full md:w-3/4 md:border-r-2">
|
||||
<p className="text-base font-semibold text-slate-900 tracking-wide">
|
||||
{details.title}
|
||||
</p>
|
||||
<div className="my-2 p-2 flex justify-start items-center space-x-2 bg-red-100 border-2 border-red-300">
|
||||
<span className="w-8 h-8 text-center text-sm rounded-full flex justify-center items-center text-red-300 bg-yellow-100">
|
||||
!
|
||||
</span>
|
||||
<div className="">
|
||||
<p className="text-sm">
|
||||
This Job have been sent to public view
|
||||
</p>
|
||||
<p className="text-sm text-slate-600">This Job will expire</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{/* INPUT SECTION */}
|
||||
<div className='my-2 md:flex'>
|
||||
<Detail
|
||||
label='Date Added'
|
||||
value={details.offer_added || 'default'}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='my-2 md:flex'>
|
||||
<Detail
|
||||
label='Description'
|
||||
value={details.description}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='my-2 md:flex'>
|
||||
<Detail
|
||||
label='Offer Expire'
|
||||
value={details.expire && `${details.expire.split(' ')[0]} ${details.expire.split(' ')[1].split('.')[0]}`}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='my-2 md:flex'>
|
||||
<Detail
|
||||
label='Price'
|
||||
value={`${details.price*0.01} ${details.currency}`}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='my-2 md:flex'>
|
||||
<Detail
|
||||
label='Duration'
|
||||
value={`${details.timeline_days} day(s)`}
|
||||
<div className="my-2 md:flex">
|
||||
<Detail
|
||||
label="Date Added"
|
||||
value={details.offer_added || "default"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='my-2 md:flex'>
|
||||
<Detail
|
||||
label='Detail'
|
||||
value={details.job_description || details.description}
|
||||
<div className="my-2 md:flex">
|
||||
<Detail label="Description" value={details.description} />
|
||||
</div>
|
||||
|
||||
<div className="my-2 md:flex">
|
||||
<Detail
|
||||
label="Offer Expire"
|
||||
value={
|
||||
details.expire &&
|
||||
`${details.expire.split(" ")[0]} ${
|
||||
details.expire.split(" ")[1].split(".")[0]
|
||||
}`
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='my-2 md:flex'>
|
||||
<Detail
|
||||
label='Public Link'
|
||||
value='https://work.wrenchboard.com/plb/viewjob/218B4BWB83'
|
||||
bg='bg-slate-200'
|
||||
<div className="my-2 md:flex">
|
||||
<Detail
|
||||
label="Price"
|
||||
value={`${details.price * 0.01} ${details.currency}`}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="my-2 md:flex">
|
||||
<Detail
|
||||
label="Duration"
|
||||
value={`${details.timeline_days} day(s)`}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="my-2 md:flex">
|
||||
<Detail
|
||||
label="Detail"
|
||||
value={details.job_description || details.description}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="my-2 md:flex">
|
||||
<Detail
|
||||
label="Public Link"
|
||||
value="https://work.wrenchboard.com/plb/viewjob/218B4BWB83"
|
||||
bg="bg-slate-200"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{/* ACTION SECTION */}
|
||||
<div className='p-4 w-full md:w-1/4 h-full'>
|
||||
<p className='mb-6 text-sm'>Actions</p>
|
||||
|
||||
<div className='mb-3'>
|
||||
<p className='px-2 py-1 text-sm bg-slate-100'>Job sent to public view</p>
|
||||
<div className="p-4 w-full md:w-1/4 h-full">
|
||||
<p className="mb-6 text-sm">Actions</p>
|
||||
|
||||
<div className="mb-3">
|
||||
<p className="px-2 py-1 text-sm bg-slate-100">
|
||||
Job sent to public view
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className='my-3'>
|
||||
<button className='px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white'>Extend by a week</button>
|
||||
|
||||
<div className="my-3">
|
||||
<button
|
||||
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
onClick={handlePendingJobsBtn}
|
||||
name="extend"
|
||||
>
|
||||
{pendingJobLoader.extend ? (
|
||||
<div className="w-[136px] flex justify-center items-center h-full">
|
||||
<LoadingSpinner size={5} color="sky-blue" />
|
||||
</div>
|
||||
) : (
|
||||
"Extend by a week"
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className='my-3'>
|
||||
<button className='px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white'>Send to me</button>
|
||||
|
||||
<div className="my-3">
|
||||
<button
|
||||
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
onClick={handlePendingJobsBtn}
|
||||
name="offer"
|
||||
>
|
||||
{pendingJobLoader.offer ? (
|
||||
<div className="w-[96px] flex justify-center items-center h-full">
|
||||
<LoadingSpinner size={5} color="sky-blue" />
|
||||
</div>
|
||||
) : (
|
||||
"Send to me"
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className='mt-10 md:mt-32 md:flex md:justify-center'>
|
||||
<button className='px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white'>Cancel Offer</button>
|
||||
|
||||
<div className="mt-10 md:mt-32 md:flex md:justify-center">
|
||||
<button
|
||||
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||
onClick={onClose}
|
||||
>
|
||||
Cancel Offer
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* close button */}
|
||||
{/* close button */}
|
||||
<div className="p-6 flex justify-center">
|
||||
<button
|
||||
onClick={onClose}
|
||||
@@ -134,9 +224,9 @@ function PendingJobsPopout({details, onClose, situation}) {
|
||||
</button>
|
||||
</div>
|
||||
{/* end of close button */}
|
||||
</div>
|
||||
</ModalCom>
|
||||
)
|
||||
</div>
|
||||
</ModalCom>
|
||||
);
|
||||
}
|
||||
|
||||
export default PendingJobsPopout
|
||||
export default PendingJobsPopout;
|
||||
+90
-3
@@ -10,6 +10,62 @@
|
||||
src: url("./assets/fonts/Product Sans Bold.ttf");
|
||||
}
|
||||
|
||||
|
||||
|
||||
.job-action{
|
||||
background-color: lightgoldenrodyellow;
|
||||
height: 100px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.msg_box{
|
||||
background-color: aliceblue;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
.msg_header{
|
||||
background-color: #1a3544;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
.siderCardHeader{
|
||||
margin: 40px 40px 10px 40px;
|
||||
font-size: 24px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.siderCardDescription{
|
||||
margin: 20px 45px 10px 45px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.siderCardButton{
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.commonHeaderSliderItem{
|
||||
background-color: aliceblue;
|
||||
border-radius: 10px;
|
||||
margin: 0px 5px 0px 5px;
|
||||
height: 95px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.short_style{
|
||||
background-color: transparent;
|
||||
}
|
||||
.lr{
|
||||
background-color: #e1cace;
|
||||
}
|
||||
.lg{
|
||||
background-color: #a7dca7;
|
||||
}
|
||||
.lb{
|
||||
background-color: #b3ccd7;
|
||||
}
|
||||
.ly{
|
||||
background-color: #eeee67;
|
||||
}
|
||||
.offer-slide-item{
|
||||
background: rgb(2,0,36);
|
||||
background: radial-gradient(circle, rgba(2,0,36,1) 0%, rgba(3,51,2,0.782125350140056) 0%, rgba(0,212,255,0.07904411764705888) 0%, rgba(153,182,201,1) 99%);
|
||||
@@ -565,6 +621,20 @@ input[type="text"][dir="rtl"] {
|
||||
.modal-com {
|
||||
transition: all 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body .modal-com{
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.job-action-modal-body button, .message-modal-header button {
|
||||
display: none;
|
||||
}
|
||||
.message-modal-wrapper .message-table{
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
}
|
||||
/* TODO: =================================modal end================================= */
|
||||
/* TODO: =================================login ================================= */
|
||||
.btn-login {
|
||||
@@ -762,18 +832,22 @@ TODO: Responsive ===========================
|
||||
}
|
||||
|
||||
/* Update table scrollbar */
|
||||
.update-table::-webkit-scrollbar-track, .update-table > *::-webkit-scrollbar-track{
|
||||
.update-table::-webkit-scrollbar-track, .update-table > *::-webkit-scrollbar-track,
|
||||
.market-pop::-webkit-scrollbar-track,
|
||||
.wallet.coupon::-webkit-scrollbar-track{
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
|
||||
background-color: transparent;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.update-table::-webkit-scrollbar, .update-table > *::-webkit-scrollbar {
|
||||
.update-table::-webkit-scrollbar, .update-table > *::-webkit-scrollbar,
|
||||
.market-pop::-webkit-scrollbar,
|
||||
.wallet.coupon::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.update-table::-webkit-scrollbar-thumb, .update-table > *::-webkit-scrollbar-thumb {
|
||||
.update-table::-webkit-scrollbar-thumb, .update-table > *::-webkit-scrollbar-thumb, .wallet.coupon::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
border-top-right-radius: 50px;
|
||||
border-bottom-right-radius: 50px;
|
||||
@@ -781,10 +855,23 @@ TODO: Responsive ===========================
|
||||
background: linear-gradient(134.38deg, #f539f8 0%, #c342f9 43.55%, #5356fb 104.51%);
|
||||
}
|
||||
|
||||
.market-pop::-webkit-scrollbar-thumb {
|
||||
border-radius: 100px;
|
||||
|
||||
/* background-color: #fafafa; */
|
||||
/* background: linear-gradient(134.38deg, #f539f8 0%, #c342f9 43.55%, #5356fb 104.51%); */
|
||||
background: rgb(236,237,241);
|
||||
background: linear-gradient(90deg, rgba(236,237,241,1) 0%, rgba(252,252,252,1) 31%, rgba(255,255,255,0.9416141456582633) 41%, rgba(255,255,255,0.9752275910364145) 61%, rgba(252,252,252,1) 71%, rgba(236,237,241,1) 100%);
|
||||
}
|
||||
|
||||
.input-curve.lg{
|
||||
border-radius: 35px !important;
|
||||
}
|
||||
|
||||
.edit-popup{
|
||||
top: 75px;
|
||||
}
|
||||
|
||||
.job-popup{
|
||||
top: 55px;
|
||||
}
|
||||
@@ -1,4 +1,2 @@
|
||||
export default function localImgLoad(location) {
|
||||
const img = require(`../assets/${location}`);
|
||||
return img;
|
||||
}
|
||||
const localImgLoad = (location) => require(`../assets/${location}`);
|
||||
export default localImgLoad
|
||||
@@ -5,27 +5,44 @@ import LoadingSpinner from "../components/Spinners/LoadingSpinner";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { updateUserDetails } from "../store/UserDetails";
|
||||
import { updateJobs } from "../store/jobLists";
|
||||
import { updateUserJobList } from "../store/userJobList";
|
||||
import { commonHeadBanner } from "../store/CommonHeadBanner";
|
||||
|
||||
const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
const dispatch = useDispatch();
|
||||
const [lastActivityTime, setLastActivityTime] = useState(Date.now());
|
||||
const [isLogin, setIsLogin] = useState({ loading: true, status: false });
|
||||
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
|
||||
const navigate = useNavigate();
|
||||
|
||||
|
||||
const { jobListTable } = useSelector((state) => state.tableReload);
|
||||
|
||||
useEffect(() => {
|
||||
//Removing Data stored at localStorage after session expires
|
||||
const expireSession = () => {
|
||||
localStorage.clear();
|
||||
localStorage.removeItem("uid");
|
||||
localStorage.removeItem("member_id");
|
||||
localStorage.removeItem("session_token");
|
||||
navigate("/login", { replace: true }); // redirects user to login page after session expires
|
||||
};
|
||||
|
||||
const checkInactivity = setInterval(() => {
|
||||
if (
|
||||
Date.now() - lastActivityTime >
|
||||
process.env.REACT_APP_SESSION_EXPIRE_MINUTES
|
||||
) {
|
||||
expireSession();
|
||||
let { account_type } = loadProfileDetails;
|
||||
if (account_type === "FAMILY") {
|
||||
if (
|
||||
Date.now() - lastActivityTime >
|
||||
process.env.REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY
|
||||
) {
|
||||
expireSession();
|
||||
}
|
||||
} else {
|
||||
if (
|
||||
Date.now() - lastActivityTime >
|
||||
process.env.REACT_APP_SESSION_EXPIRE_MINUTES
|
||||
) {
|
||||
expireSession();
|
||||
}
|
||||
}
|
||||
}, process.env.REACT_APP_SESSION_EXPIRE_CHECKER); // Checks for inactivity every minute
|
||||
|
||||
@@ -62,6 +79,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
setIsLogin({ loading: false, status: false });
|
||||
return;
|
||||
}
|
||||
setLoadProfileDetails(res.data);
|
||||
dispatch(updateUserDetails(res.data));
|
||||
setIsLogin({ loading: false, status: true });
|
||||
})
|
||||
@@ -73,6 +91,23 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const getMyJobList = async () => {
|
||||
dispatch(updateUserJobList({ loading: true, data: [] }));
|
||||
try {
|
||||
const res = await apiCall.getMyJobList();
|
||||
// setMyJobList({loading: false, data:res.data})
|
||||
// setMyJobList(res.data);
|
||||
dispatch(updateUserJobList({ loading: false, data: res.data }));
|
||||
} catch (error) {
|
||||
dispatch(updateUserJobList({ loading: false, data: [] }));
|
||||
// setMyJobList({loading: false, data:[]})
|
||||
console.log("Error getting mode");
|
||||
}
|
||||
};
|
||||
getMyJobList();
|
||||
}, [jobListTable]);
|
||||
|
||||
useEffect(() => {
|
||||
// Getting market data
|
||||
const getMarketActiveJobList = async () => {
|
||||
@@ -86,6 +121,19 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
getMarketActiveJobList();
|
||||
}, [apiCall, dispatch]);
|
||||
|
||||
//FUNCTION TO GET COMMON HEAD DATA
|
||||
useEffect(()=>{
|
||||
apiCall.getHeroJBanners().then((res) => {
|
||||
if (res.data.internal_return < 0) {
|
||||
return;
|
||||
}
|
||||
dispatch(commonHeadBanner(res.data));
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('ERROR ', error)
|
||||
});
|
||||
},[])
|
||||
|
||||
return isLogin.loading ? (
|
||||
<LoadingSpinner size="32" color="sky-blue" height="h-screen" />
|
||||
) : // Stills needs fixing
|
||||
|
||||
@@ -16,9 +16,10 @@ class usersService {
|
||||
return this.postAuxEnd("/completesignuplink", reqData);
|
||||
}
|
||||
|
||||
// FUNCTION TO GET USER CURRENT TASK DUE TIME
|
||||
getHomeDate() {
|
||||
var postData = {
|
||||
uuid: localStorage.getItem("uid"),
|
||||
// uuid: localStorage.getItem("uid"),
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
@@ -212,6 +213,21 @@ class usersService {
|
||||
return this.postAuxEnd("/familymanage", postData);
|
||||
}
|
||||
|
||||
// Family Tasks
|
||||
ManageTasks(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
job_mode: "ACTIVE",
|
||||
limit: 30,
|
||||
offset: 0,
|
||||
action: 13008,
|
||||
...reqData
|
||||
};
|
||||
return this.postAuxEnd("/jobmanageractive", postData);
|
||||
}
|
||||
|
||||
// Task for the person doing the job
|
||||
getMyActiveTaskList() {
|
||||
var postData = {
|
||||
@@ -229,6 +245,32 @@ class usersService {
|
||||
uuid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
job_mode: "ACTIVE",
|
||||
page: 0,
|
||||
offset: 0,
|
||||
limit: 100,
|
||||
};
|
||||
return this.postAuxEnd("/jobmanageractive", postData);
|
||||
}
|
||||
|
||||
getMyPastDueJobList() {
|
||||
var postData = {
|
||||
uuid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
job_mode: "PASTDUE",
|
||||
page: 0,
|
||||
offset: 0,
|
||||
limit: 100,
|
||||
};
|
||||
return this.postAuxEnd("/jobmanageractive", postData);
|
||||
}
|
||||
getMyReviewDueJobList() {
|
||||
var postData = {
|
||||
uuid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
job_mode: "REVIEW",
|
||||
page: 0,
|
||||
offset: 0,
|
||||
limit: 100,
|
||||
@@ -452,6 +494,31 @@ class usersService {
|
||||
return this.postAuxEnd("/accounttypes", postData);
|
||||
}
|
||||
|
||||
// Manage Interest
|
||||
MarketInterest(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
msg_type: 'JOB',
|
||||
action: 13033,
|
||||
...reqData
|
||||
};
|
||||
return this.postAuxEnd("/marketinterest", postData);
|
||||
}
|
||||
|
||||
MarketMessage(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
msg_type: 'JOB',
|
||||
action: 13036,
|
||||
...reqData
|
||||
};
|
||||
return this.postAuxEnd("/marketmessage", postData);
|
||||
}
|
||||
|
||||
// END POINT TO ACCEPT TERMS AND AGREEMENT
|
||||
jobManagerAgree() {
|
||||
var postData = {
|
||||
@@ -486,6 +553,30 @@ class usersService {
|
||||
return this.postAuxEnd("/jobmanagerupdatejob", postData);
|
||||
}
|
||||
|
||||
pendingJobExtend(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
extend_days: 7,
|
||||
action: 13041,
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/pendingjobextend", postData);
|
||||
}
|
||||
|
||||
pendingJobSendTome(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
mode: 200,
|
||||
action: 13042,
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/pendingjobsendtome", postData);
|
||||
}
|
||||
|
||||
// FUNCTION TO GET ACTIVE JOB MESSAGE LIST
|
||||
activeJobMesList(reqData) {
|
||||
var postData = {
|
||||
@@ -512,6 +603,24 @@ class usersService {
|
||||
return this.postAuxEnd("/sendtaskmessage", postData);
|
||||
}
|
||||
|
||||
// FUNCTION TO SEND FILE UPLOAD
|
||||
sendFiles(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 14010,
|
||||
...reqData,
|
||||
};
|
||||
const formData = new FormData();
|
||||
for (let data in postData) {
|
||||
formData.append(data, postData[data]);
|
||||
}
|
||||
// return this.postAuxEnd("/uploads", formData);
|
||||
|
||||
return this.postAuxEnd("/uploads", postData);
|
||||
}
|
||||
|
||||
// END POINT TO DELETE A JOB
|
||||
deleteJob(reqData) {
|
||||
var postData = {
|
||||
@@ -544,6 +653,18 @@ class usersService {
|
||||
return this.postAuxEnd("/offersresponse", postData);
|
||||
}
|
||||
|
||||
// END POINT FOR WORKER TO MARK TASK AS COMPLETED
|
||||
taskCompleted(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 14015,
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/activetaskstatus", postData);
|
||||
}
|
||||
|
||||
/*
|
||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
|
||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
commonHeadBanner: {}
|
||||
};
|
||||
|
||||
export const commonHeadBannerSlice = createSlice({
|
||||
name: "commonHeadBanner",
|
||||
initialState,
|
||||
reducers: {
|
||||
commonHeadBanner: (state,action) => {
|
||||
state.commonHeadBanner = {...action.payload}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Action creators are generated for each case reducer function
|
||||
export const { commonHeadBanner } = commonHeadBannerSlice.actions;
|
||||
|
||||
export default commonHeadBannerSlice.reducer;
|
||||
@@ -2,7 +2,8 @@ import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
jobListTable: false,
|
||||
pendingListTable: false
|
||||
pendingListTable: false,
|
||||
myTaskTable: false
|
||||
};
|
||||
|
||||
export const tableReloadSlice = createSlice({
|
||||
@@ -17,6 +18,9 @@ export const tableReloadSlice = createSlice({
|
||||
case 'PENDINGTABLE' :
|
||||
state.pendingListTable = !state.pendingListTable;
|
||||
return
|
||||
case 'MYTASKTABLE' :
|
||||
state.myTaskTable = !state.myTaskTable;
|
||||
return
|
||||
default:
|
||||
return state
|
||||
}
|
||||
|
||||
+5
-1
@@ -4,12 +4,16 @@ import drawerReducer from "./drawer";
|
||||
import userDetailReducer from "./UserDetails";
|
||||
import jobReducer from "./jobLists";
|
||||
import tableReloadReducer from "./TableReloads";
|
||||
import userJobListReducer from './userJobList'
|
||||
import commonHeadBannerReducer from './CommonHeadBanner'
|
||||
|
||||
export default configureStore({
|
||||
reducer: {
|
||||
drawer: drawerReducer,
|
||||
userDetails: userDetailReducer,
|
||||
jobLists: jobReducer,
|
||||
tableReload: tableReloadReducer
|
||||
tableReload: tableReloadReducer,
|
||||
userJobList: userJobListReducer,
|
||||
commonHeadBanner: commonHeadBannerReducer
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
userJobList: {loading: true, data: []}
|
||||
};
|
||||
|
||||
export const userSlice = createSlice({
|
||||
name: "userJobList",
|
||||
initialState,
|
||||
reducers: {
|
||||
updateUserJobList: (state,action) => {
|
||||
state.userJobList = {...action.payload}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Action creators are generated for each case reducer function
|
||||
export const { updateUserJobList } = userSlice.actions;
|
||||
|
||||
export default userSlice.reducer;
|
||||
@@ -0,0 +1,13 @@
|
||||
import React, { useContext, useState, useEffect } from "react";
|
||||
import BlogItem from "../components/Blogs";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function BlogPage() {
|
||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
|
||||
return (
|
||||
<>
|
||||
<BlogItem commonHeadData={commonHeadBanner.result_list} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
+5
-17
@@ -1,29 +1,17 @@
|
||||
import React, {useState, useEffect} from 'react'
|
||||
import Home from "../components/Home";
|
||||
import usersService from "../services/UsersService";
|
||||
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
export default function HomePages() {
|
||||
|
||||
// const [marketActiveJobList, setMarketActiveJobList] = useState([]);
|
||||
const [bannerList, setBannerList] = useState([]);
|
||||
const api = new usersService();
|
||||
|
||||
const getHeroJBannersList = async () => {
|
||||
try {
|
||||
const res = await api.getHeroJBanners();
|
||||
// console.log("BANNERS->",res.data);
|
||||
setBannerList(res.data?.result_list);
|
||||
} catch (error) {
|
||||
console.log("Error getting BANNERS....");
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
getHeroJBannersList();
|
||||
}, []);
|
||||
const {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Home
|
||||
bannerList={bannerList}
|
||||
bannerList={commonHeadBanner?.result_list}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import MarketPlace from "../components/MarketPlace";
|
||||
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function MarketPlacePage() {
|
||||
|
||||
const commonHeadData =()=>{
|
||||
console.log("COMMON HEAD DATA ----------------=====---------------------");
|
||||
return 0;
|
||||
}
|
||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
|
||||
return (
|
||||
<>
|
||||
<MarketPlace
|
||||
commonHeadData={commonHeadData} />
|
||||
commonHeadData={commonHeadBanner?.result_list} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@ import React, { useContext,useState, useEffect } from "react";
|
||||
import usersService from "../services/UsersService";
|
||||
//import MyJobs from "../components/MyJobs";
|
||||
import MyActiveJobs from "../components/MyActiveJobs";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function MyActiveJobsPage() {
|
||||
const commonHeadData =()=>{
|
||||
console.log("COMMON HEAD DATA ----------------=====---------------------");
|
||||
return 0;
|
||||
}
|
||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
const [MyJobList, setMyJobList] = useState([]);
|
||||
const api = new usersService();
|
||||
//TARGET ENDPOINT[POST]http://10.204.5.100:9083/en/wrench/api/v1/jobmanageractive
|
||||
@@ -28,7 +26,7 @@ export default function MyActiveJobsPage() {
|
||||
<>
|
||||
<MyActiveJobs
|
||||
MyJobList={MyJobList}
|
||||
commonHeadData={commonHeadData}
|
||||
commonHeadData={commonHeadBanner.result_list}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import React from "react";
|
||||
import WalletRoutes from "../components/MyWallet/Wallet";
|
||||
import MyCoupons from "../components/MyCoupons/MyCoupons";
|
||||
|
||||
export default function MyCouponPage() {
|
||||
return (
|
||||
<>
|
||||
<WalletRoutes />
|
||||
</>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<MyCoupons />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
+21
-23
@@ -7,37 +7,35 @@ import MyJobs from "../components/MyJobs";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function MyJobsPage() {
|
||||
const commonHeadData = () => {
|
||||
console.log("COMMON HEAD DATA ----------------=====---------------------");
|
||||
return 0;
|
||||
};
|
||||
|
||||
const { jobListTable } = useSelector((state) => state.tableReload);
|
||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
|
||||
const {userJobList} = useSelector((state) => state.userJobList)
|
||||
|
||||
// const { jobListTable } = useSelector((state) => state.tableReload);
|
||||
// const userApi = new usersService();
|
||||
// const activeJobList = userApi.getMyJobList();
|
||||
const [MyJobList, setMyJobList] = useState({ loading: true, data: [] });
|
||||
const api = new usersService();
|
||||
// const [myJobList, setMyJobList] = useState({ loading: true, data: [] });
|
||||
// const api = new usersService();
|
||||
|
||||
const getMyJobList = async () => {
|
||||
setMyJobList({ loading: true, data: [] });
|
||||
try {
|
||||
const res = await api.getMyJobList();
|
||||
setMyJobList({ loading: false, data: res.data });
|
||||
// setMyJobList(res.data);
|
||||
} catch (error) {
|
||||
setMyJobList({ loading: false, data: [] });
|
||||
console.log("Error getting mode");
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
getMyJobList();
|
||||
}, [jobListTable]);
|
||||
// const getMyJobList = async () => {
|
||||
// setMyJobList({ loading: true, data: [] });
|
||||
// try {
|
||||
// const res = await api.getMyJobList();
|
||||
// setMyJobList({ loading: false, data: res.data });
|
||||
// // setMyJobList(res.data);
|
||||
// } catch (error) {
|
||||
// setMyJobList({ loading: false, data: [] });
|
||||
// console.log("Error getting mode");
|
||||
// }
|
||||
// };
|
||||
// useEffect(() => {
|
||||
// getMyJobList();
|
||||
// }, [jobListTable]);
|
||||
|
||||
// debugger;
|
||||
return (
|
||||
<>
|
||||
<MyJobs MyJobList={MyJobList} commonHeadData={commonHeadData} />
|
||||
<MyJobs MyJobList={userJobList} commonHeadData={commonHeadBanner.result_list} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import React, { useContext,useState, useEffect } from "react";
|
||||
import usersService from "../services/UsersService";
|
||||
//import MyJobs from "../components/MyJobs";
|
||||
//import MyActiveJobs from "../components/MyActiveJobs";
|
||||
import MyPastDueJobs from "../components/MyActiveJobs/MyPastDueJobs";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function MyPastDueJobsPage() {
|
||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
const [MyJobList, setMyJobList] = useState([]);
|
||||
const api = new usersService();
|
||||
//TARGET ENDPOINT[POST]http://10.204.5.100:9083/en/wrench/api/v1/jobmanageractive
|
||||
const getMyJobList = async () => {
|
||||
try {
|
||||
const res = await api.getMyPastDueJobList();
|
||||
setMyJobList(res.data);
|
||||
} catch (error) {
|
||||
console.log("Error getting mode");
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
getMyJobList();
|
||||
}, []);
|
||||
|
||||
// debugger;
|
||||
return (
|
||||
<>
|
||||
<MyPastDueJobs
|
||||
MyJobList={MyJobList}
|
||||
commonHeadData={commonHeadBanner?.result_list}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -3,12 +3,10 @@ import usersService from "../services/UsersService";
|
||||
//import MyJobs from "../components/MyJobs";
|
||||
import MyActiveJobs from "../components/MyActiveJobs";
|
||||
import MyPendingJobs from "../components/MyPendingJobs";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function MyPendingJobsPage() {
|
||||
const commonHeadData =()=>{
|
||||
console.log("COMMON HEAD DATA ----------------=====---------------------");
|
||||
return 0;
|
||||
}
|
||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
const [MyJobList, setMyJobList] = useState([]);
|
||||
const api = new usersService();
|
||||
|
||||
@@ -29,7 +27,7 @@ export default function MyPendingJobsPage() {
|
||||
<>
|
||||
<MyPendingJobs
|
||||
MyJobList={MyJobList}
|
||||
commonHeadData={commonHeadData}
|
||||
commonHeadData={commonHeadBanner.result_list}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import React, { useContext,useState, useEffect } from "react";
|
||||
import usersService from "../services/UsersService";
|
||||
import MyReviewDueJobs from "../components/MyActiveJobs/MyReviewDueJobs";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function MyReviewDueJobsPage() {
|
||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
const [MyJobList, setMyJobList] = useState([]);
|
||||
const api = new usersService();
|
||||
const getMyJobList = async () => {
|
||||
try {
|
||||
const res = await api.getMyReviewDueJobList();
|
||||
setMyJobList(res.data);
|
||||
} catch (error) {
|
||||
console.log("Error getting mode");
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
getMyJobList();
|
||||
}, []);
|
||||
|
||||
// debugger;
|
||||
return (
|
||||
<>
|
||||
<MyReviewDueJobs
|
||||
MyJobList={MyJobList}
|
||||
commonHeadData={commonHeadBanner.result_list}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
+47
-40
@@ -1,4 +1,4 @@
|
||||
import React, { useContext,useState, useEffect } from "react";
|
||||
import React, { useContext, useState, useEffect } from "react";
|
||||
import MyTasks from "../components/MyTasks";
|
||||
// import UsersService from "../services/UsersService";
|
||||
import usersService from "../services/UsersService";
|
||||
@@ -6,46 +6,53 @@ import usersService from "../services/UsersService";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function MyTaskPage() {
|
||||
const {jobListTable} = useSelector((state) => state.tableReload)
|
||||
const { myTaskTable } = useSelector((state) => state.tableReload);
|
||||
|
||||
const [MyActiveJobList, setMyActiveJobList] = useState({loading: true, status:false, data:[]});
|
||||
const [MyActiveOffersList, setMyActiveOffersList] = useState([]);
|
||||
const api = new usersService();
|
||||
const commonHeadData =()=>{
|
||||
console.log("COMMON HEAD DATA ----------------=====---------------------");
|
||||
return 0;
|
||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
|
||||
const [MyActiveJobList, setMyActiveJobList] = useState({
|
||||
loading: true,
|
||||
status: false,
|
||||
data: [],
|
||||
});
|
||||
const [MyActiveOffersList, setMyActiveOffersList] = useState([]);
|
||||
const api = new usersService();
|
||||
|
||||
const getMyActiveJobList = async () => {
|
||||
setMyActiveJobList({ loading: true, status: false, data: [] });
|
||||
try {
|
||||
const res = await api.getMyActiveTaskList();
|
||||
setMyActiveJobList({
|
||||
loading: false,
|
||||
status: true,
|
||||
data: res.data.result_list,
|
||||
});
|
||||
} catch (error) {
|
||||
setMyActiveJobList({ loading: false, status: false, data: [] });
|
||||
console.log("Error getting tasks");
|
||||
}
|
||||
const getMyActiveJobList = async () => {
|
||||
setMyActiveJobList({loading: true, status:false, data:[]});
|
||||
try {
|
||||
const res = await api.getMyActiveTaskList();
|
||||
setMyActiveJobList({loading: false, status:true, data:res.data.result_list});
|
||||
} catch (error) {
|
||||
setMyActiveJobList({loading: false, status:false, data:[]});
|
||||
console.log("Error getting tasks");
|
||||
}
|
||||
};
|
||||
const getMyActiveOffersList = async () => {
|
||||
// setMyActiveOffersList({loading: true, status:false, data:[]});
|
||||
try {
|
||||
const res = await api.getOffersList();
|
||||
setMyActiveOffersList(res.data);
|
||||
} catch (error) {
|
||||
// setMyActiveOffersList({loading: false, status:false, data:[]});
|
||||
console.log("Error getting offers");
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
getMyActiveJobList();
|
||||
getMyActiveOffersList();
|
||||
}, [jobListTable]);
|
||||
};
|
||||
const getMyActiveOffersList = async () => {
|
||||
// setMyActiveOffersList({loading: true, status:false, data:[]});
|
||||
try {
|
||||
const res = await api.getOffersList();
|
||||
setMyActiveOffersList(res.data);
|
||||
} catch (error) {
|
||||
// setMyActiveOffersList({loading: false, status:false, data:[]});
|
||||
console.log("Error getting offers");
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
getMyActiveJobList();
|
||||
getMyActiveOffersList();
|
||||
}, [myTaskTable]);
|
||||
|
||||
//debugger;
|
||||
return (
|
||||
<>
|
||||
<MyTasks ActiveJobList={MyActiveJobList}
|
||||
MyActiveOffersList={MyActiveOffersList}
|
||||
commonHeadData={commonHeadData}/>
|
||||
</>
|
||||
);
|
||||
//debugger;
|
||||
return (
|
||||
<MyTasks
|
||||
ActiveJobList={MyActiveJobList}
|
||||
MyActiveOffersList={MyActiveOffersList}
|
||||
commonHeadData={commonHeadBanner?.result_list}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import React, { useContext, useState, useEffect } from "react";
|
||||
import BlogItem from "../components/Blogs";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function OffersInterestPage() {
|
||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
|
||||
return (
|
||||
<>
|
||||
<BlogItem commonHeadData={commonHeadBanner.result_list} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user