Compare commits

...

33 Commits

Author SHA1 Message Date
victorAnumudu 5c223ba641 margin added to offer interest table 2023-06-18 08:20:29 +01:00
victorAnumudu cc0e2c2c6b offer interest process API added 2023-06-18 08:14:22 +01:00
ameye 3df97c0760 Merge branch 'return-to-wallet-fixed' of WrenchBoard/Users-Wrench into master 2023-06-17 22:29:15 +00:00
ameye 6d742e92b5 Merge branch 'wallet-add-icon' of WrenchBoard/Users-Wrench into master 2023-06-17 22:29:08 +00:00
victorAnumudu 44090c94a1 return to wallet added and add fund style fixed 2023-06-17 23:06:46 +01:00
victorAnumudu 63f4658449 Icon padding fixed 2023-06-17 22:19:57 +01:00
CHIEFSOFT\ameye 552224c489 refer banner 2023-06-17 12:45:17 -04:00
CHIEFSOFT\ameye 134be6a1f0 Add fund page 2023-06-17 08:55:12 -04:00
CHIEFSOFT\ameye fcca050ff6 Add crerdikt style 2023-06-17 08:01:14 -04:00
ameye 197dc2e0bc Merge branch 'interest-page-reformat' of WrenchBoard/Users-Wrench into master 2023-06-17 09:45:35 +00:00
ameye e0f8e8df12 Merge branch 'Move-AddJob-to-Popup' of WrenchBoard/Users-Wrench into master 2023-06-17 09:45:24 +00:00
victorAnumudu b5625ab799 margin adjusted 2023-06-17 08:01:52 +01:00
victorAnumudu 9dc8acc584 manage offer interest reformat 2023-06-17 07:55:26 +01:00
Ebube 6d51fdfc19 popup closes 2023-06-17 06:33:08 +01:00
Ebube 800c62d76f Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into Move-AddJob-to-Popup 2023-06-17 06:21:49 +01:00
Ebube ae23195e0e Changed add job to modal 2023-06-17 06:20:09 +01:00
ameye 4ef9b2f20e Merge branch 'Family-page-Tasks-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-16 14:06:58 +00:00
ameye 709b8ea8f2 Merge branch 'coupon-page-cleanup' of WrenchBoard/Users-Wrench into master 2023-06-16 14:06:51 +00:00
ameye 549af89a43 Merge branch 'faq-page' of WrenchBoard/Users-Wrench into master 2023-06-16 14:06:30 +00:00
Ebube 123ed2056a Family page Tasks 2023-06-16 14:23:54 +01:00
Ebube f04f4c713e . 2023-06-16 13:04:51 +01:00
victorAnumudu 6d16e7f63f faq content add from API 2023-06-16 12:15:08 +01:00
ameye 153bc7ab7d Merge branch 'refferal-style' of WrenchBoard/Users-Wrench into master 2023-06-15 20:37:21 +00:00
victorAnumudu 054688af8b referral layout and style fixed 2023-06-15 21:02:49 +01:00
CHIEFSOFT\ameye 9994ccc26a History page 2023-06-15 12:11:06 -04:00
ameye f5c24ffb0c Merge branch 'other-interest-amendment' of WrenchBoard/Users-Wrench into master 2023-06-15 15:43:20 +00:00
victorAnumudu d5ce5d758a Others interested offer table modified to show only list of persons interest in an offer 2023-06-15 16:31:28 +01:00
ameye 0b14c7675b Merge branch 'pagination-dark-mode' of WrenchBoard/Users-Wrench into master 2023-06-15 10:34:23 +00:00
victorAnumudu 6a3662d69e dark mode style changed for pagination and manage active job 2023-06-15 07:01:41 +01:00
CHIEFSOFT\ameye 8a6c8badbe home banner 2023-06-14 21:19:23 -04:00
ameye 99be0961a9 Merge branch 'interest-processing-page' of WrenchBoard/Users-Wrench into master 2023-06-14 20:00:06 +00:00
victorAnumudu 22bfcbf0c6 interest processing page added 2023-06-14 20:54:14 +01:00
ameye 7975bd3d11 Merge branch 'client-name' of WrenchBoard/Users-Wrench into master 2023-06-14 16:40:19 +00:00
42 changed files with 1048 additions and 404 deletions
+2
View File
@@ -44,6 +44,7 @@ import MyPastDueJobsPage from "./views/MyPastDueJobsPage";
import BlogPage from "./views/BlogPage";
import MyReviewDueJobsPage from "./views/MyReviewDueJobsPage";
import OffersInterestPage from "./views/OffersInterestPage";
import ManageInterestOfferPage from './views/ManageInterestOfferPage'
export default function Routers() {
return (
@@ -99,6 +100,7 @@ export default function Routers() {
<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="/manage-offer" element={<ManageInterestOfferPage />} />
<Route
Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

+7 -33
View File
@@ -1,12 +1,12 @@
import React, { useState, useEffect } from "react";
import { Link, useNavigate } from "react-router-dom";
import { Link } from "react-router-dom";
import InputCom from "../Helpers/Inputs/InputCom";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import usersService from "../../services/UsersService";
import { useSelector, useDispatch } from "react-redux";
import { tableReload } from '../../store/TableReloads'
import { tableReload } from "../../store/TableReloads";
import { Field, Form, Formik } from "formik";
import * as Yup from "yup";
@@ -38,16 +38,12 @@ const validationSchema = Yup.object().shape({
.required("Timeline is required"),
});
function AddJob() {
function AddJob({ popUpHandler }) {
const ApiCall = new usersService();
const navigate = useNavigate();
let dispatch = useDispatch()
let dispatch = useDispatch();
let { userDetails } = useSelector((state) => state.userDetails);
let [pageLoading, setPageLoading] = useState(true); // State used for knowing when the page is mounting
let [country, setCountry] = useState({
loading: true,
status: false,
@@ -109,8 +105,8 @@ function AddJob() {
message: "Job Added Successfully",
});
setTimeout(() => {
dispatch(tableReload({type:'JOBTABLE'}))
navigate("/myjobs", { replace: true });
dispatch(tableReload({ type: "JOBTABLE" }));
popUpHandler()
}, 1000);
})
.catch((err) => {
@@ -129,16 +125,9 @@ function AddJob() {
useEffect(() => {
getUserCountry();
setPageLoading(false);
}, []);
return pageLoading.loading ? (
<div className="personal-info-tab w-full flex flex-col justify-between">
<div className="p-3">
<LoadingSpinner size="32" color="sky-blue" />
</div>
</div>
) : (
return (
<div className="add-job p-5 w-full bg-white rounded-md flex flex-col justify-between">
<Formik
initialValues={initialValues}
@@ -148,27 +137,12 @@ function AddJob() {
{(props) => {
return (
<Form>
<h1 className="py-2 my-4 text-lg md:text-xl font-bold tracking-wide">
Create New Job
</h1>
<div className="flex flex-col-reverse sm:flex-row">
<div className="fields w-full">
{/* inputs starts here */}
{/* country */}
<div className="xl:flex xl:space-x-7 mb-6">
<div className="field w-full mb-6 xl:mb-0">
{/* <InputCom
fieldClass="px-6 cursor-not-allowed"
label="Country"
labelClass='tracking-wide'
inputBg = 'bg-slate-100'
type="text"
name="country"
disable={true}
value={country.loading ? 'loading' : country.data ? country.data : 'no country found!'}
inputHandler={(e)=> setCountry((prev) => ({...prev, data:e.target.value}))}
/> */}
<label
htmlFor="country"
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
+1 -1
View File
@@ -131,7 +131,7 @@ export default function Login() {
ux_mode:'redirect',
redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
onSuccess: async (codeResponse) => {
console.log(codeResponse);
console.log("GOOGLE LOGIN GOOD --- ",codeResponse);
},
onError: (errorResponse) => console.log(errorResponse),
});
@@ -27,7 +27,7 @@ export default function HomeBannerOffersCard(props) {
<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}</>
<span className="heroSilderTitle">{props.itemData.title}</span>
</h1>
</div>
{/*<SelectBox datas={filterDatas} action={dataSetHandler} />*/}
@@ -117,7 +117,7 @@ export default function FamilyManageTabs({
return (
<div
className={`update-table w-full bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow min-h-[520px] max-h-[600px] ${
className={`w-full bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow min-h-[520px] max-h-[600px] ${
className || ""
}`}
>
+35 -31
View File
@@ -5,16 +5,12 @@ import { handlePagingFunc } from "../../Pagination/HandlePagination";
import PaginatedList from "../../Pagination/PaginatedList";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import Icons from "../../Helpers/Icons";
import { PriceFormatter } from "../../Helpers/PriceFormatter";
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 =
@@ -24,10 +20,7 @@ export default function FamilyTasks({ familyData, className, loader }) {
indexOfLastItem
);
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
const handlePagination = (e) => handlePagingFunc(e, setCurrentPage);
return (
<div
@@ -52,8 +45,14 @@ export default function FamilyTasks({ familyData, className, loader }) {
familyData?.result_list &&
familyData.result_list.length > 0 &&
currentTask.map((value, index) => {
// find due date
const dueDate = value?.delivery_date.split(" ")[0]
// find due date
const dueDate = value?.delivery_date.split(" ")[0];
// the price
let thePrice = PriceFormatter(
value?.price * 0.01,
value?.currency_code,
value?.currency
);
return (
<tr
key={index}
@@ -73,37 +72,42 @@ export default function FamilyTasks({ familyData, className, loader }) {
{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 className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{thePrice}
</span>
</span>
</span>
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
<span className="text-sm text-thin-light-gray">
Duration:{" "}
<span className="text-purple">
{" "}
{value.timeline_days} day(s)
</span>
</span>
</span>
<span className="text-sm text-thin-light-gray">
Due Date:{" "}
<span className="text-purple">
{" "}
{dueDate}
<span className="text-sm text-thin-light-gray">
Due Date:{" "}
<span className="text-purple">
{" "}
{dueDate}
</span>
</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 },
state: {
...value,
pathname,
dueDate,
thePrice,
},
});
}}
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
@@ -112,7 +116,7 @@ export default function FamilyTasks({ familyData, className, loader }) {
</button>
</td>
</tr>
)
);
})}
</>
}
+2 -2
View File
@@ -10,7 +10,7 @@ export default function Accordion({ datas }) {
<>
<div className="accordion-item overflow-hidden relative z-[1]">
<div
className="accordion-title-bar flex items-center space-x-3 py-5 border-b border-light-purple dark:border-[#5356fb29] "
className="accordion-title-bar flex items-center space-x-3 py-5 border-b border-light-purple dark:border-[#5356fb29] cursor-pointer"
onClick={accordionHandler}
>
<div className="accordion-title-icon relative">
@@ -36,7 +36,7 @@ export default function Accordion({ datas }) {
<div className="w-[3px] h-auto bg-purple rounded-[28px]"></div>
<div className="flex-1">
<p className="text-base text-thin-light-gray tracking-wide">
{datas.content}
{datas.msg}
</p>
</div>
</div>
@@ -68,13 +68,13 @@ export default function InputCom({
)}
</div>
<div
className={`input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-full rounded-[0.475rem] h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base ${inputClass}`}
className={`input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base ${inputClass}`}
>
<input
placeholder={placeholder}
value={value}
onChange={inputHandler}
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${
className={`input-field placeholder:text-base text-dark-gray w-full h-full tracking-wide ${
inputBg ? inputBg : "bg-[#FAFAFA]"
} dark:bg-[#11131F] focus:ring-0 focus:outline-none ${fieldClass}`}
type={type}
+1 -1
View File
@@ -241,7 +241,7 @@ export default function History() {
</div>
{/* END OF RECENT ACTIVITY SECTION */}
</div>
<HistoryTable />
{/*<HistoryTable />*/}
</div>
</div>
</Layout>
+16 -16
View File
@@ -250,7 +250,7 @@ function ActiveJobs(props) {
return (
<Layout>
<div className="py-[20px] bg-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-16">
<div className="py-[20px] bg-white dark:bg-black dark:text-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-16">
{/* job title */}
<div className="w-full md:w-8/12">
<div className="w-full flex justify-start space-x-3 items-start">
@@ -280,8 +280,8 @@ function ActiveJobs(props) {
<p className="w-full text-base text-right text-sky-blue">
{props.details.job_to && props.details.job_to}
</p>
<div className="text-base text-slate-700 dark:text-black tracking-wide">
<p className="font-semibold text-black">Description: </p>
<div className="text-base text-slate-700 dark:text-white tracking-wide">
<p className="font-semibold text-black dark:text-white">Description: </p>
<p className="p-2 border border-sky-blue">
{props.details?.description && props.details.description}
</p>
@@ -295,12 +295,12 @@ function ActiveJobs(props) {
<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">
<p className="text-base text-slate-700">
<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">
<p className="py-2 text-base text-slate-700">
{props.details?.delivery_date &&
props.details.delivery_date.split(" ")[1]}
</p>
@@ -309,10 +309,10 @@ function ActiveJobs(props) {
<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">
<p className="text-base text-slate-700 tracking-wide">
<CountDown lastDate={props.details.delivery_date} />
</p>
<div className="text-base text-slate-700 dark:text-black tracking-wide flex gap-[5px]">
<div className="text-base text-slate-700 tracking-wide flex gap-[5px]">
<span>Hrs</span>
<span>Min</span>
<span>Sec</span>
@@ -321,15 +321,15 @@ function ActiveJobs(props) {
</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>
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
<span className="font-semibold text-black dark:text-white">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>
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
<span className="font-semibold text-black dark:text-white">No: </span>
<span className="">
{props.details?.contract && props.details.contract}
</span>
@@ -338,7 +338,7 @@ function ActiveJobs(props) {
{/* 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="my-4 py-[20px] bg-white dark:bg-black px-4 rounded-2xl shadow-md lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
<div className="w-full lg:w-1/2">
<div className="">
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
@@ -358,7 +358,7 @@ function ActiveJobs(props) {
<button
name="message"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-black border ${
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "message" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
@@ -367,7 +367,7 @@ function ActiveJobs(props) {
<button
name="files"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-black border ${
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "files" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
@@ -376,7 +376,7 @@ function ActiveJobs(props) {
</div>
{tab == "message" ? (
<textarea
className="p-4 w-full h-[300px] text-base text-slate-600 border border-slate-300 outline-none"
className="p-4 w-full h-[300px] text-base text-slate-600 dark:text-white bg-white dark:bg-black border border-slate-300 outline-none"
// rows="10"
style={{ resize: "none" }}
name="message"
@@ -498,7 +498,7 @@ function ActiveJobs(props) {
{/* 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">
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
Message
</p>
<button
@@ -2,9 +2,9 @@ import React from 'react'
function CurrentJobAction() {
return (
<div className='job-action'>
<div className='job-action bg-white dark:bg-black'>
<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">
<table className="w-full text-sm text-left text-gray-500">
<tbody>
<tr>
<td>
@@ -60,9 +60,9 @@ function CurrentTaskAction({jobDetails}) {
}
return (
<div className='job-action'>
<div className='job-action bg-white dark:bg-black'>
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 active-worker">
<table className="w-full text-sm text-left text-gray-500 active-worker">
<tbody>
<tr>
<td>
@@ -101,9 +101,9 @@ function PastDueJobAction({jobDetails}) {
}
return (
<div className='job-action'>
<div className='job-action bg-white dark:bg-black'>
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 owner-pastdue">
<table className="w-full text-sm text-left text-gray-500 owner-pastdue">
<tbody>
<tr>
<td>
@@ -2,9 +2,9 @@ import React from 'react'
function PastDueTaskAction() {
return (
<div className='job-action'>
<div className='job-action bg-white dark:bg-black'>
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 worker-pastdue">
<table className="w-full text-sm text-left text-gray-500 worker-pastdue">
<tbody>
<tr>
<td>
@@ -90,9 +90,9 @@ function ReviewJobAction({jobDetails}) {
})
}
return (
<div className='job-action'>
<div className='job-action bg-white dark:bg-black'>
<div className="my-3 py-1 text-base">
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 review-owner">
<table className="w-full text-sm text-left text-gray-500 review-owner">
<tbody>
<tr>
<td>
@@ -2,8 +2,8 @@ import React from 'react'
function ReviewTaskAction() {
return (
<div className='job-action'>
<p className="my-3 py-1 text-base">
<div className='job-action bg-white dark:bg-black'>
<p className="my-3 py-1 text-base text-dark-gray dark:text-white">
Waiting for the completion message from the client before you can approve. Worker True & Review Job
</p>
</div>
+37 -19
View File
@@ -1,10 +1,17 @@
import { useMemo, useState } from "react";
import { toast } from "react-toastify";
import usersService from "../../services/UsersService";
import { useDispatch } from "react-redux";
import { tableReload } from "../../store/TableReloads";
const CouponPopup = ({ popUpHandler, data }) => {
const [loader, setLoader] = useState(false);
const apiCall = useMemo(() => new usersService(), []);
const [statusMsg, setStatusMsg] = useState({
success: "",
error: "",
});
const dispatch = useDispatch();
const redeemCouponHandler = async () => {
setLoader(true);
@@ -14,28 +21,34 @@ const CouponPopup = ({ popUpHandler, data }) => {
const reqData = { code_id: Number(coupon_id), code };
const res = await apiCall.getCouponRedeem(reqData);
if (res.statusText === "OK") {
toast.success("Great news! Your coupon has been redeemed.", {
autoClose: 3000,
hideProgressBar: true,
});
}
if (res.data?.internal_return < 0)
setStatusMsg({ error: "An error occurred" });
else setStatusMsg({ success: res.data?.status_text });
dispatch(tableReload({ type: "COUPONTABLE" }));
setTimeout(() => {
popUpHandler();
setLoader(false);
}, 3000);
throw new Response(res);
}, 10000);
} catch (error) {
// error &&
// toast.warn("An error occurred while processing your coupon.", {
// autoClose: 3000,
// hideProgressBar: true,
// });
setLoader(false);
console.log(error);
return;
// throw new Error(error);
if (error?.status !== 200)
setStatusMsg({
error: {
status: true,
msg:
error?.statusText !== ""
? error?.statusText
: "An error occurred",
},
});
throw new Error(error);
} finally {
setStatusMsg({
success: "",
error: "",
});
}
};
@@ -77,9 +90,8 @@ const CouponPopup = ({ popUpHandler, data }) => {
Amount:
</label>
</div>
<div className=" flex-[0.7] max-w-[150px]">{`${data?.amount} Naira`}</div>
<div className=" flex-[0.7] max-w-[150px]">{data?.thePrice}</div>
</div>
<div className="signin-area w-full">
<div className="flex justify-end">
<button
@@ -96,6 +108,12 @@ const CouponPopup = ({ popUpHandler, data }) => {
)}
</button>
</div>
{statusMsg.success && (
<p className="text-sm text-green-500 italic">{statusMsg.success}</p>
)}
{statusMsg.error && (
<p className="text-sm text-red-500 italic">{statusMsg.error}</p>
)}
</div>
</form>
<div className="signin-area w-full px-5 py-4">
+11 -4
View File
@@ -4,6 +4,7 @@ import { handlePagingFunc } from "../Pagination/HandlePagination";
import ModalCom from "../Helpers/ModalCom";
import CouponPopup from "./CouponPopup";
import { useNavigate } from "react-router-dom";
import { PriceFormatter } from "../Helpers/PriceFormatter";
function CouponTable({ coupon }) {
const [currentPage, setCurrentPage] = useState(0);
@@ -38,12 +39,18 @@ function CouponTable({ coupon }) {
</thead>
{coupon.data.length ? (
<tbody>
{currentCoupon.map((item, index) => (
{currentCoupon.map((item, index) => {
let thePrice = PriceFormatter(
item?.amount * 0.01,
item?.currency_code,
item?.currency
);
return(
<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 text-center cursor-default">{thePrice}</td>
<td className="p-2 h-20 flex items-center justify-end">
<button
type="button"
@@ -51,7 +58,7 @@ function CouponTable({ coupon }) {
onClick={() => {
setCouponPopup((prev) => ({
state: !prev.state,
data: item,
data: {...item, thePrice},
}));
}}
>
@@ -59,7 +66,7 @@ function CouponTable({ coupon }) {
</button>
</td>
</tr>
))}
)})}
</tbody>
) : coupon.error ? (
<tbody>
+8 -6
View File
@@ -1,11 +1,13 @@
import React, { useEffect, useState } from "react";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import Layout from "../Partials/Layout";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import CouponTable from "./CouponTable";
import usersService from "../../services/UsersService";
import { useSelector } from "react-redux";
export default function MyCoupons() {
const apiCall = new usersService();
const apiCall = useMemo(() => new usersService(), []);
const {couponTable} = useSelector(state => state.tableReload)
let [couponHistory, setCouponHistory] = useState({
// FOR COUPON HISTORY
loading: true,
@@ -14,7 +16,7 @@ export default function MyCoupons() {
});
//FUNCTION TO GET COUPON HISTORY
const getCouponHistory = () => {
const getCouponHistory = useCallback(() => {
apiCall
.getCouponPending()
.then((res) => {
@@ -32,11 +34,11 @@ export default function MyCoupons() {
.catch((error) => {
setCouponHistory((prev) => ({ ...prev, loading: false, error: true }));
});
};
}, [apiCall]);
useEffect(() => {
getCouponHistory();
}, []);
}, [couponTable]);
return (
<>
@@ -59,7 +61,7 @@ export default function MyCoupons() {
<LoadingSpinner size="16" color="sky-blue" />
</div>
) : (
<CouponTable coupon={couponHistory} />
<CouponTable coupon={couponHistory} />
)}
</div>
</div>
+15 -10
View File
@@ -11,6 +11,7 @@ import usersService from "../../services/UsersService";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
import EditJobPopOut from "../jobPopout/EditJobPopout";
import { PriceFormatter } from "../Helpers/PriceFormatter";
export default function MyJobTable({ MyJobList, reloadJobList, className }) {
const [myCountry, setCountries] = useState("");
@@ -101,9 +102,15 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
{selectedCategory === "All Categories" ? (
<>
{MyJobList &&
MyJobList?.data?.result_list &&
MyJobList.data?.result_list.length > 0 ?
currentJobList.map((value, index) => (
MyJobList?.data?.result_list &&
MyJobList.data?.result_list.length > 0 ? (
currentJobList.map((value, index) => {
let thePrice = PriceFormatter(
value?.price * 0.01,
value?.currency_code,
value?.currency
);
return(
<tr
key={index}
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
@@ -126,7 +133,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
<span className="text-sm text-thin-light-gray">
Price:{" "}
<span className="text-purple">
{value.price * 0.01}
{thePrice}
</span>
</span>
<span className="text-sm text-thin-light-gray">
@@ -181,14 +188,12 @@ 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>
<td className="p-2">No Jobs Avaliable!</td>
</tr>
}
)}
</>
) : selectedCategory === "Explore" ? (
<></>
+17 -26
View File
@@ -3,50 +3,41 @@ import { Link } from "react-router-dom";
import Layout from "../Partials/Layout";
import MyJobTable from "./MyJobTable";
import CommonHead from "../UserHeader/CommonHead";
import AddJobPage from "../../views/AddJobPage";
export default function MyJobs(props) {
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
const [popUp, setPopUp] = useState(false);
const popUpHandler = () => {
setPopUp((prev) => !prev);
};
return (
<Layout>
<CommonHead
commonHeadData={props.commonHeadData}
/>
<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="sm:flex items-center mb-6">
<div className="mb-5 sm:mb-0">
<h1 className="text-26 font-bold flex items-center space-x-1 text-dark-gray dark:text-white gap-2">
<span
className={`${selectTab === "today" ? "block" : "hidden"}`}
>
My Jobs
</span>
<span>My Jobs</span>
<Link
to="/add-job"
<button
className="text-white btn-gradient text-lg tracking-wide px-5 py-2 rounded-full"
onClick={popUpHandler}
>
Add Job
</Link>
</button>
</h1>
</div>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
</div>
</div>
<MyJobTable
MyJobList={props.MyJobList}
/>
<MyJobTable MyJobList={props.MyJobList} />
</div>
</div>
{/* Add Job List Popout */}
{popUp && <AddJobPage action={popUpHandler} situation={popUp} />}
{/* End of Add Job List Popout */}
</Layout>
);
}
}
+76 -40
View File
@@ -2,6 +2,7 @@ import React, {useState} from 'react'
import RecentActivityTable from './WalletComponent/RecentActivityTable'
import LoadingSpinner from '../Spinners/LoadingSpinner'
import { useNavigate } from 'react-router-dom'
import InputCom from '../Helpers/Inputs/InputCom'
function AddFund({payment}) {
@@ -36,49 +37,84 @@ function AddFund({payment}) {
setInput('')
}
return (
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className='md:p-8 p-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Add Credit with Account Deposit</h2>
<hr />
<form className='md:p-8 p-4 add-fund-info'>
<div className='md:flex items-center'>
<label className='w-full md:w-2/4 text-slate-600 text-lg'>Amount(Naira) <span className='text-red-500'>*</span></label>
<input className='w-full md:w-2/4 p-3 text-lg text-right bg-slate-100 rounded-md outline-0 placeholder:text-slate-500 placeholder:text-lg'
value={input}
name='amount'
type="text"
placeholder='Amount'
required
onChange={handleChange}
/>
</div>
{inputError && <p className='text-base text-red-500'>{inputError}</p>}
</form>
<hr />
<div className='md:p-8 p-4 add-fund-btn flex justify-end items-center py-4'>
<button onClick={handleSubmit} className='text-lg text-white bg-sky-blue px-4 py-2 hover:opacity-90 rounded-md'>Continue</button>
</div>
<div>
{/* heading */}
<div className="sm:flex justify-between items-center mb-6">
<div className="w-full flex justify-start space-x-3 items-center">
<button
type="button"
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
onClick={() =>
navigate('/my-wallet', { replace: true })
}
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="35"
height="35"
viewBox="0 0 24 24"
fill="skyblue"
>
<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-26 font-bold inline-flex gap-3 text-dark-gray dark:text-white items-center">
Add Credit
</h1>
</div>
<div className="add-fund py-4 my-2 w-full bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className='md:px-8 px-4 py-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Add Credit with Account Deposit</h2>
<hr />
<p className='md:px-8 px-4 py-2 text-slate-600 dark:text-white text-base lg:text-xl font-medium'>Transfer fund to WrenchBoard GTB Account 0250869867</p>
<p className='md:px-8 px-4 py-2 text-slate-500 dark:text-white text-sm lg:text-base font-medium'>
Make sure you add your account username in the notes part of the transfer for prompt processing. When the transfer is complete notify here <a className='text-sky-blue' href='#'>Contact us</a>
</p>
<div className="slider-btns flex space-x-4">
<div
onClick={() => filterHandler("today")}
className="relative"
></div>
</div>
</div>
<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-[590px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
<h2 className='text-gray-900 dark:text-white text-xl lg:text-2xl font-medium'>Recent Activity</h2>
{/* <p className='text-base text-gray-600 dark:text-white'>Activity Report</p> */}
{payment.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<RecentActivityTable payment={payment}/>
}
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="add-fund w-full bg-white dark:bg-dark-white rounded-2xl shadow">
{/*<h2 className='md:p-8 p-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Add Credit with Account Deposit</h2>*/}
{/*<hr />*/}
<form className='md:p-8 p-4 add-fund-info'>
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
label="Amount(Naira)"
type="text"
name="amount"
placeholder="Amount"
value={input}
inputHandler={handleChange}
// blurHandler={props.handleBlur}
/>
{inputError && <p className='text-base text-red-500'>{inputError}</p>}
</div>
</form>
<hr />
<div className='md:p-8 p-4 add-fund-btn flex justify-end items-center py-4'>
<button
onClick={handleSubmit}
type="button"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Continue</span>
</button>
</div>
</div>
</div>
</div>
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full min-h-[590px] bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className='text-gray-900 dark:text-white text-xl lg:text-2xl font-medium'>Recent Activity</h2>
{/* <p className='text-base text-gray-600 dark:text-white'>Activity Report</p> */}
{payment.loading ?
<LoadingSpinner size='16' color='sky-blue' />
:
<RecentActivityTable payment={payment}/>
}
</div>
</div>
</div>
</div>
+31 -24
View File
@@ -33,32 +33,39 @@ function Balance({wallet, coupon}) {
:
wallet.data.length ?
wallet.data.map((item, index)=> (
<div key={index} className="md:flex items-center flex-wrap my-3 border-t-2 border-slate-400">
<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-xl text-dark-gray dark:text-white'>{item.description}</span>
<p className='text-base text-slate-500'>{item.symbol}</p>
<div key={index} className="p-3 md:flex items-center flex-wrap my-3 border-t-2 border-slate-400 wallet-box">
<div className='text-slate-900 w-full md:w-1/2 flex space-x-3 items-start justify-start'>
<div className='balance-info bal-col1'>
<p className='py-2'></p>
<span className='text-xl text-dark-gray dark:text-white'><b>{item.description}</b></span>
<p className='text-base text-slate-500'>{item.symbol}</p>
</div>
<div className='balance-info'>
<p className='py-2'>Balance</p>
<span className='py-1 px-2 bg-green-100 text-green-500 rounded-lg'>{item.symbol}{(item.amount*0.01).toFixed(2)}</span>
</div>
<div className='balance-info'>
<p className='py-2'>Escrow</p>
<span className='py-1 px-2 bg-red-100 text-red-500 rounded-lg'>{item.symbol}{(item.escrow*0.01).toFixed(2)}</span>
</div>
</div>
<div className='balance-info'>
<p className='py-2'>Balance</p>
<span className='text-sm py-1 px-2 bg-green-100 text-green-500 rounded-lg'>{item.symbol}{(item.amount*0.01).toFixed(2)}</span>
</div>
<div className='balance-info'>
<p className='py-2'>Escrow</p>
<span className='text-sm py-1 px-2 bg-red-100 text-red-500 rounded-lg'>{item.symbol}{(item.escrow*0.01).toFixed(2)}</span>
</div>
</div>
<div className='w-full my-2 md:my-0 md:w-1/2 flex space-x-2 items-center justify-start md:justify-end'>
{
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 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 lg:text-xl text-lg font-bold text-white'>+Add Credit</Link>
</div>
<div className='w-full my-2 md:my-0 md:w-1/2 flex space-x-2 items-center justify-start md:justify-end'>
{
item.action_type != 'AC_AD_FD_ONLY' ?
<Link to='transfer-fund' className='px-2 py-1 flex items-center gap-2 user-balance cursor-pointer h-[48px] rounded-full relative bg-purple lg:text-xl text-lg font-bold text-white'>Transfer</Link>:''
}
<Link to='add-fund' className='px-2 py-1 flex items-center gap-2 user-balance cursor-pointer h-[48px] rounded-full relative bg-green lg:text-xl text-lg font-bold text-white'>
<span className="">
<svg xmlns="http://www.w3.org/2000/svg" width="38"
height="38" viewBox="0 0 42 42" fill="none"><path
d="M21 0C16.8466 0 12.7865 1.23163 9.33303 3.53914C5.8796 5.84665 3.18798 9.1264 1.59854 12.9636C0.00909901 16.8009 -0.406771 21.0233 0.403518 25.0969C1.21381 29.1705 3.21386 32.9123 6.15077 35.8492C9.08767 38.7861 12.8295 40.7862 16.9031 41.5965C20.9767 42.4068 25.1991 41.9909 29.0364 40.4015C32.8736 38.812 36.1534 36.1204 38.4609 32.667C40.7684 29.2135 42 25.1534 42 21C41.994 15.4323 39.7796 10.0944 35.8426 6.15741C31.9056 2.22045 26.5677 0.00602189 21 0ZM28 22.75H22.75V28C22.75 28.4641 22.5656 28.9092 22.2374 29.2374C21.9093 29.5656 21.4641 29.75 21 29.75C20.5359 29.75 20.0908 29.5656 19.7626 29.2374C19.4344 28.9092 19.25 28.4641 19.25 28V22.75H14C13.5359 22.75 13.0908 22.5656 12.7626 22.2374C12.4344 21.9092 12.25 21.4641 12.25 21C12.25 20.5359 12.4344 20.0907 12.7626 19.7626C13.0908 19.4344 13.5359 19.25 14 19.25H19.25V14C19.25 13.5359 19.4344 13.0908 19.7626 12.7626C20.0908 12.4344 20.5359 12.25 21 12.25C21.4641 12.25 21.9093 12.4344 22.2374 12.7626C22.5656 13.0908 22.75 13.5359 22.75 14V19.25H28C28.4641 19.25 28.9093 19.4344 29.2374 19.7626C29.5656 20.0907 29.75 20.5359 29.75 21C29.75 21.4641 29.5656 21.9092 29.2374 22.2374C28.9093 22.5656 28.4641 22.75 28 22.75Z"
fill="white"></path>
</svg>
</span>
<span className='text-white'>Add Credit</span>
</Link>
</div>
</div>
))
:
+2 -2
View File
@@ -129,7 +129,7 @@ function ConfirmAddFund({ payment }) {
<div className="md:p-8 p-4 add-fund-btn flex justify-end items-center py-4">
<FlutterWaveButton
{...fwConfig}
className="text-lg text-white bg-sky-blue px-4 py-2 hover:opacity-90 rounded-md"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
/>
</div>
</div>
@@ -137,7 +137,7 @@ function ConfirmAddFund({ payment }) {
)}
<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-[600px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
<div className="wallet w-full md:p-8 p-4 h-full min-h-[600px] bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="text-gray-900 dark:text-white text-xl lg:text-2xl font-medium">
Recent Activity
</h2>
@@ -1,66 +1,85 @@
import React, {useState} from 'react'
import React, { useState } from "react";
import PaginatedList from '../../Pagination/PaginatedList'
import { handlePagingFunc } from '../../Pagination/HandlePagination';
import PaginatedList from "../../Pagination/PaginatedList";
import { handlePagingFunc } from "../../Pagination/HandlePagination";
import { PriceFormatter } from "../../Helpers/PriceFormatter";
function CouponTable({coupon}) {
function CouponTable({ coupon }) {
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentCoupon = coupon?.data?.slice(indexOfFirstItem, indexOfLastItem);
const [currentPage, setCurrentPage] = useState(0);
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 handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
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'>
<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">Date</th>
<th className="p-2">Description</th>
<th className="p-2">Amount</th>
<th className="p-2">Active</th>
</tr>
</tr>
</thead>
{coupon.data.length ?
(
<tbody>
{currentCoupon.map((item, index) => (
<tr key={index} className='text-slate-500'>
<td className="p-2">{item.added}</td>
<td className="p-2">{item.code}</td>
<td className="p-2">{item.amount}</td>
<td className="p-2">{item.status}</td>
{coupon.data.length ? (
<tbody>
{currentCoupon.map((item, index) => {
let thePrice = PriceFormatter(
item?.price * 0.01,
item?.currency_code,
item?.currency
);
return (
<tr key={index} className="text-slate-500">
<td className="p-2">{item.added}</td>
<td className="p-2">{item.code}</td>
<td className="p-2">{item.amount}</td>
<td className="p-2">{item.status}</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>
)
:
coupon.error ?
(
<tbody>
<tr className='text-slate-500'>
<td className="p-2" colSpan={4}>Opps! an error occurred. Please try again!</td>
</tbody>
) : (
<tbody>
<tr className="text-slate-500">
<td className="p-2" colSpan={4}>
No Purchase History Found!
</td>
</tr>
</tbody>
)
:
<tbody>
<tr className='text-slate-500'>
<td className="p-2" colSpan={4}>No Purchase History Found!</td>
</tr>
</tbody>
}
</table>
</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 */}
{/* 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 */}
</div>
)
);
}
export default CouponTable
export default CouponTable;
@@ -15,7 +15,7 @@ function ReferralTable({history}) {
}
return (
<div className='flex flex-col justify-between h-full'>
<div className='flex flex-col justify-between min-h-[420px] overflow-x-auto'>
<table className="referral-list w-full table-auto border-collapse text-left">
<thead className='border-b-2'>
<tr className='text-slate-600'>
@@ -0,0 +1,301 @@
import React, { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import Layout from "../Partials/Layout";
import CommonHead from "../UserHeader/CommonHead";
import usersService from "../../services/UsersService";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import OthersInterestedTable from "./OthersInterestedTable";
export default function ManageInterestOffer(props) {
const navigate = useNavigate()
const apiCall = new usersService()
let [redirectTime, setRedirectTime] = useState(5)
let [tab, setTab] = useState("info"); //message STATE FOR SWITCHING BETWEEN TABS
let [requestStatus, setRequestStatus] = useState({loading: false, status: false, message: '', processType: ''})
const messageList = {data: [1,2,3,4,5,6]} // TO BE REMOVED AND REPLACE WITH REAL MESSAGE 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 currentMessageList = messageList?.data?.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
const [selectTab, setValue] = useState("today");
const filterHandler = (value) => {
setValue(value);
};
//FUNCTION TO ACCEPT/REJECT OFFER INTEREST
const interestOfferProcess = ({target:{name}}) => {
setRequestStatus(prev => ({...prev, loading: true, processType: name}))
let reqData = { // API PAYLOADS
proc: name.toUpperCase(),
client_uid : props.offerDetails?.client_uid,
offer_code : props.offerDetails?.offer_code,
offer_uid: props.offerDetails?.offer_uid,
}
apiCall.offersInterestProc(reqData).then(res => {
if(res.status != 200 || res.data.internal_return < 0){
setRequestStatus({loading: false, status: false, message: 'Unable to complete request', processType: ''})
return
}
setInterval(() => { // SETS REDIRECT COUNT DOWN
setRedirectTime(prev => prev - 1)
}, 1000);
setRequestStatus({loading: false, status: true, message: `Offer ${name}ed`, processType: ''})
setTimeout(()=>{
navigate('/offer-interest', {replace: true})
},5000)
}).catch(err => {
setRequestStatus({loading: false, status: false, message: 'Opps! something went wrong. Try again', processType: ''})
}).finally(()=>{
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: '', processType: ''})
},5000)
})
}
useEffect(()=>{
// run API to get message to replace message array above, add reload variable as dependence array
},[])
return (
<Layout>
<CommonHead
commonHeadData={props.commonHeadData}
/>
<div className="notification-page w-full mb-10">
<div className="notification-wrapper w-full mb-4">
{/* heading */}
<div className="sm:flex justify-between items-center mb-3">
<div className="mb-3 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span className={`${selectTab === "today" ? "block" : "hidden"}`}>Manage Offer Interest</span>
</h1>
</div>
</div>
{/* manage offer section */}
<div className="w-full p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow">
<div className="my-2 w-full sm:grid gap-5 grid-cols-4">
{/* Detail section */}
<div className="w-full mb-5 lg:mb-0 col-span-3">
<div className="w-full flex justify-start space-x-3 items-center">
<button
type="button"
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
onClick={() =>
navigate('/offer-interest', { replace: true })
}
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="35"
height="35"
viewBox="0 0 24 24"
fill="skyblue"
>
<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-sm lg:text-xl font-bold text-sky-blue dark:text-white tracking-wide">
{props.offerDetails?.offer_code && props.offerDetails.offer_code}
</h1>
</div>
<h1 className="my-3 text-xl lg:text-2xl font-bold text-dark-gray dark:text-white tracking-wide border">
{props.offerDetails?.title}
</h1>
<div className="w-full">
{/* switch button */}
<div className="my-1 flex items-center border-b border-slate-300">
<button
name="info"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "info" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
Info
</button>
<button
name="message"
onClick={(e) => setTab(e.target.name)}
className={`p-2 text-lg font-bold text-slate-600 dark:text-white border ${
tab == "message" ? "border-sky-blue" : "border-slate-300"
} tracking-wide transition duration-200`}
>
Messages ({messageList.data.length})
</button>
</div>
{/* END OF switch button */}
{/* info tab */}
{tab == 'info' ?
<div className="info-details w-full border-t">
<div className="my-3 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Name</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_name}</span>
</div>
<div className="my-3 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Member Since</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_added}</span>
</div>
<div className="my-3 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs completed</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_jobs_completed ? props.offerDetails?.client_jobs_completed :0}</span>
</div>
<div className="my-0 md:my-3 block md:flex items-center gap-10">
<div className="my-3 md:my-0 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs active</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_jobs_active ? props.offerDetails?.client_jobs_active:0}</span>
</div>
<div className="my-3 md:my-0 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs uncompleted</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_jobs_missed ? props.offerDetails?.client_jobs_missed:0}</span>
</div>
</div>
<div className="block md:flex items-center gap-10">
<div className="my-3 md:my-0 flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">% completion</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_percent_completion ? props.offerDetails?.client_percent_completion:0}</span>
</div>
<div className="flex items-center gap-1">
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Pending Offers</span>
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">{props.offerDetails?.client_offers_pending ? props.offerDetails?.client_offers_pending:0}</span>
</div>
</div>
</div>
:
<div className="message-details w-full border-t">
<div className="my-0 w-full flex items-center gap-5">
<div className="w-3/4">
<p className="text-base font-bold text-dark-gray dark:text-white tracking-wide">Message to dummy name</p>
<textarea rows={2} autoFocus={true} className="p-2 text-base font-bold text-dark-gray dark:text-white dark:bg-dark-gray border tracking-wide w-full resize-none rounded-md outline-none" />
</div>
<div className="w-1/4 flex flex-col justify-center items-center">
<button
type="button"
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<span className="text-white">Send</span>
</button>
</div>
</div>
{/* message list */}
<div className="min-h-[100px] max-h-[200px] overflow-y-auto">
{currentMessageList.map((item, index)=>(
<div key={index} className="my-2 w-full flex items-center gap-1">
<p className="text-base font-bold text-dark-gray dark:text-white tracking-wide">2023-04-06-from { }<span className="font-normal">Dummy name</span></p>
<p className="text-base font-bold text-dark-gray dark:text-white tracking-wide">I am testing message</p>
</div>
))}
</div>
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
messageList?.data?.length
? true
: false
}
data={messageList?.data}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
}
</div>
</div>
{/* END OF Detail section */}
{/* BUTTON section */}
<div className="p-4 w-full min-h-full bg-sky-100 dark:bg-dark-gray col-span-1">
<div className="w-full h-full">
<div className="mt-0 sm:mt-10 flex sm:flex-col justify-center items-center gap-10">
{requestStatus.loading && requestStatus.processType == 'accept' ?
<LoadingSpinner color='sky-blue' size='10' />
:
<button
type="button"
name='accept'
disabled={requestStatus.loading}
onClick={interestOfferProcess}
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Accept
</button>
}
{requestStatus.loading && requestStatus.processType == 'reject' ?
<LoadingSpinner color='sky-blue' size='10' />
:
<button
type="button"
name='reject'
disabled={requestStatus.loading}
onClick={interestOfferProcess}
className="px-2 py-1 h-11 flex justify-center items-center border-gradient text-base rounded-full text-black"
>
Reject
</button>
}
</div>
{/* ERROR DISPLAY */}
<div className="w-full">
{/* error or success display */}
{requestStatus.message != "" && requestStatus.processType != 'sendmeassge' &&
(!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}
</div>
) : (
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} redirecting.... ${redirectTime}sec`}
</div>
)
))}
</div>
{/* End of error or success display */}
</div>
</div>
{/* END of BUTTON section */}
</div>
</div>
{/* END OF manage offer section */}
</div>
<div className="w-full overflow-x-auto">
{/* heading */}
<div className="sm:flex justify-between items-center mb-3">
<div className="mb-3 sm:mb-0">
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
<span className={`${selectTab === "today" ? "block" : "hidden"}`}>Others interested in this Task</span>
</h1>
</div>
</div>
<OthersInterestedTable othersInterestedList={props.othersInterestedList} />
</div>
</div>
</Layout>
);
}
@@ -29,7 +29,7 @@ export default function OffersInterestTable({offerInterestList, className}) {
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white rounded-2xl section-shadow min-h-[520px] ${
className={`update-table w-full my-8 p-8 bg-white dark:bg-dark-white rounded-2xl section-shadow min-h-[520px] ${
className || ""
}`}
>
@@ -52,9 +52,9 @@ export default function OffersInterestTable({offerInterestList, className}) {
</tr> */}
</thead>
<tbody className="h-full">
{currentOfferInterestList?.map((item, idx) => {
{currentOfferInterestList?.map((item, index) => {
return (
<tr key={item?.offer_uid} className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
<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">
<div className="min-w-[60px] min-h-[60px] rounded-full overflow-hidden flex justify-center items-center">
@@ -87,7 +87,7 @@ export default function OffersInterestTable({offerInterestList, className}) {
<td className="text-right py-4">
<button
onClick={() => {
navigate("/manage-active-job", {
navigate("/manage-offer", {
state: { ...item, pathname },
});
}}
@@ -0,0 +1,148 @@
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";
import { handlePagingFunc } from "../Pagination/HandlePagination";
import PaginatedList from "../Pagination/PaginatedList";
import { useDispatch } from "react-redux";
import { tableReload } from "../../store/TableReloads";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import familyImage from '../../assets/images/no-family-side.png'
export default function OthersInterestTable({othersInterestedList, className}) {
const dispatch = useDispatch()
const navigate = useNavigate();
let { pathname } = useLocation();
const filterCategories = ["All Categories", "Explore", "Featured"];
const [selectedCategory, setCategory] = useState(filterCategories[0]);
const [currentPage, setCurrentPage] = useState(0);
const indexOfFirstItem = Number(currentPage);
const indexOfLastItem =
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
const currentOthersInterestedList = othersInterestedList?.data?.slice(indexOfFirstItem, indexOfLastItem);
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
return (
<div
className={`update-table w-full p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow min-h-[520px] ${
className || ""
}`}
>
{othersInterestedList?.loading ? (
<div className="min-h-[520px] w-full flex flex-col justify-center items-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
)
:
othersInterestedList?.data?.length > 0 ?
(
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400 relative">
<thead className="sticky top-0">
{/* <tr className="text-base text-thin-light-gray whitespace-nowrap border-b dark:border-[#5356fb29] default-border-bottom ">
<th className="py-4">Name</th>
<th className="py-4 text-center">Last Login</th>
<th className="py-4 text-center">No of Tasks</th>
<th className="py-4 text-right"></th>
</tr> */}
</thead>
<tbody className="h-full">
{currentOthersInterestedList?.map((item, index) => {
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">
<div className="min-w-[60px] min-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">
{item?.title}
</h1>
<span className="text-sm text-thin-light-gray">{item?.expire}</span>
</div>
</div>
</td>
<td className="text-center py-4 px-2">
<div className="flex space-x-1 items-center justify-center">
<p className="font-bold text-x text-dark-gray dark:text-white">{item?.client_name}</p>
</div>
</td>
<td className="text-center py-4 px-2">
<div className="flex space-x-1 items-center justify-center">
{/* <span className="font-bold text-x text-dark-gray dark:text-white">{formatNumber(item?.price * 0.01)}</span> */}
<span className="font-bold text-x text-dark-gray dark:text-white">{PriceFormatter(item?.price * 0.01,item?.currency_code,item?.currency)}</span>
</div>
</td>
<td className="text-right py-4">
<button
onClick={() => {
dispatch(tableReload({type:'OTHERSINTERESTEDTABLE'}))
navigate("/manage-offer", {
state: { ...item, pathname },
});
}}
type="button"
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
View
</button>
</td>
</tr>
);
})
}
</tbody>
</table>
)
:
(
<div className="font-bold text-center text-xl md:text-2xl lg:text-4xl text-dark-gray md:flex items-center justify-between">
<div className="p-2 w-full md:w-1/2">
<p className="mb-4 p-3 md:p-16">No Offer list avaliable.</p>
<button
onClick={()=>{navigate('/market', {replace: true})}}
type="button"
className="text-white btn-gradient text-lg tracking-wide px-5 py-2 rounded-full"
>
Goto Market
</button>
</div>
<div className="p-2 w-full md:w-1/2">
<img className='w-full' src={familyImage && familyImage} alt="Add Family" />
</div>
</div>
)
}
{/* PAGINATION BUTTON */}
<PaginatedList
onClick={handlePagination}
prev={currentPage == 0 ? true : false}
next={
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
othersInterestedList?.data?.length
? true
: false
}
data={othersInterestedList?.data}
start={indexOfFirstItem}
stop={indexOfLastItem}
/>
{/* END OF PAGINATION BUTTON */}
</div>
);
}
+3 -3
View File
@@ -6,7 +6,7 @@ const PaginatedList = ({ onClick, prev, next, data, start, stop }) => {
{!prev && (
<button
className={`p-2 border ${
prev ? "border-black" : "border-transparent"
prev ? "border-black dark:border-white dark:text-white" : "border-transparent dark:text-white"
} btn-shine rounded-full h-11 w-11`}
name="prev"
onClick={onClick}
@@ -26,7 +26,7 @@ const PaginatedList = ({ onClick, prev, next, data, start, stop }) => {
key={index}
value={index}
className={`p-2 border ${
index === start ? "border-black" : "border-transparent"
index === start ? "border-black dark:border-white dark:text-white" : "border-transparent dark:text-white"
} btn-shine rounded-full h-11 w-11`}
onClick={onClick}
name="page_num"
@@ -43,7 +43,7 @@ const PaginatedList = ({ onClick, prev, next, data, start, stop }) => {
{!next && (
<button
className={`p-2 border ${
next ? "border-black" : "border-transparent"
next ? "border-black dark:border-white dark:text-white" : "border-transparent dark:text-white"
} btn-shine rounded-full h-11 w-11`}
name="next"
onClick={onClick}
+1 -1
View File
@@ -827,7 +827,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
type="button"
className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
Cannected
Connected
</button>
</div>
</div>
+58 -46
View File
@@ -116,10 +116,21 @@ function ReferralDisplay() {
}, [refHistoryReload]);
return (
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="referral w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
<div className="content-wrapper w-full lg:flex xl:space-x-8 bottomMargin">
<div className="lg:w-2/2 w-full mb-10 lg:mb-0">
<div className="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>
Refer a Friend
</span>
</h1>
</div>
</div>
<div className="referral w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="mb-4 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Send Referral
</h2>
<Formik
@@ -129,42 +140,44 @@ function ReferralDisplay() {
>
{(props) => (
<Form className="referral-info">
{/* Firstname */}
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
label="Firstname"
type="text"
name="firstname"
placeholder="Firstname"
value={props.values.firstname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.firstname && props.touched.firstname && (
<p className="text-sm text-red-500">
{props.errors.firstname}
</p>
)}
</div>
<div className="block md:mb-6 md:flex gap-10">
{/* Firstname */}
<div className="field w-full mb-6 md:mb-0">
<InputCom
fieldClass="px-6"
label="Firstname"
type="text"
name="firstname"
placeholder="Firstname"
value={props.values.firstname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.firstname && props.touched.firstname && (
<p className="text-sm text-red-500">
{props.errors.firstname}
</p>
)}
</div>
{/* Lastname */}
<div className="field w-full mb-6">
<InputCom
fieldClass="px-6"
label="Lastname"
type="text"
name="lastname"
placeholder="Lastname"
value={props.values.lastname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.lastname && props.touched.lastname && (
<p className="text-sm text-red-500">
{props.errors.lastname}
</p>
)}
{/* Lastname */}
<div className="field w-full mb-6 md:mb-0">
<InputCom
fieldClass="px-6"
label="Lastname"
type="text"
name="lastname"
placeholder="Lastname"
value={props.values.lastname}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
/>
{props.errors.lastname && props.touched.lastname && (
<p className="text-sm text-red-500">
{props.errors.lastname}
</p>
)}
</div>
</div>
<div className="field w-full mb-6">
@@ -193,8 +206,7 @@ function ReferralDisplay() {
) : (
<button
type="submit"
className="text-lg text-white bg-sky-blue p-2 hover:opacity-90 rounded-md"
>
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white" >
Send Message
</button>
)}
@@ -203,20 +215,20 @@ function ReferralDisplay() {
)}
</Formik>
</div>
</div>
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
<div className="referral w-full md:p-8 p-4 h-full max-h-[700px] bg-white dark:bg-dark-white overflow-y-auto rounded-2xl shadow">
<div className="w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow">
<h2 className="mb-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
Referral List
</h2>
{referralList.loading ? (
<LoadingSpinner size="32" color="sky-blue" />
<LoadingSpinner size="32" color="sky-blue" />
) : (
<ReferralTable history={referralList} />
<ReferralTable history={referralList} />
)}
</div>
</div>
</div>
);
}
+9 -5
View File
@@ -1,14 +1,18 @@
import React from "react";
import Accordion from "../../Helpers/Accordion";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
export default function FaqTab({ datas = [] }) {
export default function FaqTab({ datas }) {
return (
<div className="faq-tab w-full">
<div className="accordion-items w-full">
{datas &&
datas.length > 0 &&
datas.map((value) => (
<Accordion key={value.id + Math.random()} datas={value} />
{datas.loading ?
<LoadingSpinner color='sky-blue' size={16} />
:
datas &&
datas?.data?.length > 0 &&
datas.data.map((value, index) => (
<Accordion key={index + Math.random()} datas={value} />
))}
</div>
</div>
+3 -5
View File
@@ -1,7 +1,7 @@
import React, { useRef, useState } from "react";
import cover from "../../assets/images/profile-info-cover.png";
import profile from "../../assets/images/profile-info-profile.png";
import faq from "../../data/faq.json";
import Icons from "../Helpers/Icons";
import Layout from "../Partials/Layout";
import ChangePasswordTab from "./Tabs/ChangePasswordTab";
@@ -12,7 +12,7 @@ import PaymentMathodsTab from "./Tabs/PaymentMathodsTab";
import PersonalInfoTab from "./Tabs/PersonalInfoTab";
import TermsConditionTab from "./Tabs/TermsConditionTab";
export default function Settings() {
export default function Settings({faq}) {
const tabs = [
{
id: 1,
@@ -83,8 +83,6 @@ export default function Settings() {
}
};
// fab tab
const faqData = faq.datas;
return (
<>
<Layout>
@@ -259,7 +257,7 @@ export default function Settings() {
)}
{tab === "login_activity" && <LoginActivityTab />}
{tab === "password" && <ChangePasswordTab />}
{tab === "faq" && <FaqTab datas={faqData} />}
{tab === "faq" && <FaqTab datas={faq} />}
{tab === "terms" && <TermsConditionTab />}
</div>
</div>
+23 -2
View File
@@ -9,8 +9,24 @@
font-family: "Product Sans";
src: url("./assets/fonts/Product Sans Bold.ttf");
}
.wallet-box{
background-color: aliceblue;
border-radius: 20px;
}
.bal-col1{
width: 110px;
}
.bg-green{
background-color: darkgreen;
}
.referral{
margin-bottom: 20px
}
.heroSilderTitle{
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
font-family: sans; color: white;
font-size: 42px;
}
.job-action{
background-color: lightgoldenrodyellow;
@@ -876,4 +892,9 @@ TODO: Responsive ===========================
.job-popup{
top: 55px;
}
.addJob-popup{
top: 30px;
height: 55rem !important;
}
+23 -1
View File
@@ -666,6 +666,18 @@ class usersService {
return this.postAuxEnd("/offersinterestlist", postData);
}
// END POINT FOR PROCESSING OFFER INTEREST
offersInterestProc(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: 13034,
...reqData
};
return this.postAuxEnd("/offersinterestproc", postData);
}
// END POINT FOR WORKER TO MARK TASK AS COMPLETED
workerJobAction(reqData) {
var postData = {
@@ -687,9 +699,19 @@ class usersService {
action: 14015,
...reqData,
};
return this.postAuxEnd("/activejobstatus ", postData);
return this.postAuxEnd("/activejobstatus", postData);
}
// END POINT FOR OWNER JOB ACTION
getFaq() {
var postData = {
uid: localStorage.getItem("uid"),
// member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
};
return this.postAuxEnd("/faq", postData);
}
/*
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
+18 -10
View File
@@ -3,7 +3,9 @@ import { createSlice } from "@reduxjs/toolkit";
const initialState = {
jobListTable: false,
pendingListTable: false,
myTaskTable: false
myTaskTable: false,
othersInterestedTable: false,
couponTable: false
};
export const tableReloadSlice = createSlice({
@@ -11,18 +13,24 @@ export const tableReloadSlice = createSlice({
initialState,
reducers: {
tableReload: (state, action) => {
switch(action.payload.type){
case 'JOBTABLE':
switch (action.payload.type) {
case "JOBTABLE":
state.jobListTable = !state.jobListTable;
return
case 'PENDINGTABLE' :
return;
case "PENDINGTABLE":
state.pendingListTable = !state.pendingListTable;
return
case 'MYTASKTABLE' :
return;
case "MYTASKTABLE":
state.myTaskTable = !state.myTaskTable;
return
return;
case "OTHERSINTERESTEDTABLE":
state.othersInterestedTable = !state.othersInterestedTable;
return;
case "COUPONTABLE":
state.couponTable = !state.couponTable;
return;
default:
return state
return state;
}
},
},
@@ -30,4 +38,4 @@ export const tableReloadSlice = createSlice({
export const { tableReload } = tableReloadSlice.actions;
export default tableReloadSlice.reducer;
export default tableReloadSlice.reducer;
+36 -10
View File
@@ -1,14 +1,40 @@
import React from 'react'
import AddJob from '../components/AddJob/AddJob'
import Layout from '../components/Partials/Layout'
import React from "react";
import AddJob from "../components/AddJob/AddJob";
import ModalCom from "../components/Helpers/ModalCom";
function AddJobPage() {
function AddJobPage({ action, situation }) {
return (
<Layout>
<AddJob />
</Layout>
)
<ModalCom action={action} situation={situation} className="addJob-popup">
<div className="lg:w-[600px] w-full h-full lg:overflow-hidden lg:rounded-2xl bg-white dark:bg-dark-white ">
<div className="heading flex justify-between items-center py-6 md:px-[30px] px-[23px] border-b dark:border-[#5356fb29] border-light-purple dark:border-[#5356fb29] ">
<p className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Create New Job
</p>
<button type="button" onClick={action}>
<svg
width="32"
height="32"
viewBox="0 0 32 32"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M32 14.3645C32 15.5022 32 16.6399 32 17.7779C31.8143 17.8408 31.8787 18.0048 31.8565 18.1334C30.6952 24.8402 26.8853 29.2664 20.4091 31.362C19.4672 31.6668 18.4669 31.7917 17.4935 31.9997C16.3558 31.9997 15.2181 31.9997 14.0801 31.9997C13.8574 31.741 13.5279 31.7984 13.2475 31.7416C6.90872 30.4552 2.74424 26.7311 0.684152 20.6107C0.386668 19.7268 0.396442 18.7733 0 17.9199C0 16.6399 0 15.3598 0 14.0798C0.259 13.884 0.190585 13.5694 0.240675 13.3162C1.52285 6.84244 5.35655 2.66392 11.5936 0.623067C12.4549 0.34116 13.3785 0.343909 14.2221 0C15.3125 0 16.4029 0 17.4932 0C17.525 0.110258 17.6111 0.120948 17.7089 0.130417C24.2666 0.77242 29.8064 5.52819 31.449 11.9351C31.6552 12.739 31.8174 13.5542 32 14.3645ZM29.3431 16.0699C29.3718 8.68538 23.4154 2.66942 16.0684 2.66178C8.69759 2.65445 2.66972 8.58489 2.65353 15.8601C2.63704 23.2563 8.52319 29.2979 15.7868 29.3404C23.2862 29.3846 29.3144 23.4832 29.3431 16.0699Z"
fill="#374557"
fillOpacity="0.6"
/>
<path
d="M14.1604 16.0221C12.3843 14.2567 10.6724 12.5534 8.95837 10.8525C8.53353 10.431 8.23421 9.97162 8.46175 9.34031C8.83956 8.29209 9.95101 8.07371 10.794 8.906C12.3611 10.4536 13.9344 11.9963 15.4529 13.5909C15.9202 14.0817 16.1447 14.0005 16.5662 13.5643C18.0961 11.9804 19.6617 10.4307 21.2282 8.88248C22.0596 8.06058 23.208 8.30064 23.5522 9.35008C23.7584 9.97865 23.459 10.4383 23.0336 10.8619C21.489 12.3991 19.9531 13.9443 18.4088 15.4815C18.2421 15.6476 18.0408 15.779 17.8188 15.9558C19.629 17.7563 21.366 19.4676 23.0831 21.1987C23.934 22.0567 23.6875 23.2106 22.6072 23.556C21.9658 23.761 21.5223 23.4186 21.1067 23.0023C19.5502 21.444 17.9757 19.9031 16.448 18.3171C16.0616 17.9157 15.8854 17.9811 15.5375 18.3378C13.9835 19.9318 12.399 21.4956 10.8242 23.0692C10.4015 23.4916 9.94887 23.7768 9.30961 23.516C8.27819 23.0948 8.06073 22.0814 8.87591 21.2418C10.0307 20.0528 11.2118 18.8891 12.3895 17.7221C12.9588 17.1577 13.5462 16.6106 14.1604 16.0221Z"
fill="#374557"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<AddJob popUpHandler={action} />
</div>
</ModalCom>
);
}
export default AddJobPage
export default AddJobPage;
+46
View File
@@ -0,0 +1,46 @@
import React, { useContext,useState, useEffect } from "react";
import usersService from "../services/UsersService";
import ManageInterestOffer from "../components/OffersInterest/ManageInterestOffer";
import { useSelector } from "react-redux";
import { useLocation, useNavigate } from "react-router-dom";
export default function MyReviewDueJobsPage() {
const {state} = useLocation()
let navigate = useNavigate()
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
let { othersInterestedTable } = useSelector((state) => state.tableReload); // FOR OTHERS INTERESTED TABLE RELOAD
const apiCall = new usersService();
const [othersInterestedList, setOthersInterestedList] = useState({loading: true, data: []})
useEffect(() => {
if(!state){
navigate('/', {replace: true})
return
}
apiCall.offersInterestList().then(res => {
let newData
if(res.data.result_list.length){
newData = res.data.result_list.filter(item => item.offer_code == state.offer_code && item.client_uid != state.client_uid)
}else{
newData = []
}
setOthersInterestedList({loading: false, data: newData})
}).catch(err => {
setOthersInterestedList({loading: false, data: []})
console.log('Error: ', err)
})
}, [othersInterestedTable]);
// debugger;
return (
<>
<ManageInterestOffer
othersInterestedList={othersInterestedList}
commonHeadData={commonHeadBanner.result_list}
offerDetails={state}
/>
</>
);
}
+7 -33
View File
@@ -1,41 +1,15 @@
//import React from "react";
import React, { useContext, useState, useEffect } from "react";
// import MyTasks from "../components/MyTasks";
// import UsersService from "../services/UsersService";
import usersService from "../services/UsersService";
import MyJobs from "../components/MyJobs";
import { useSelector } from "react-redux";
export default function MyJobsPage() {
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 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;
let { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
const { userJobList } = useSelector((state) => state.userJobList);
return (
<>
<MyJobs MyJobList={userJobList} commonHeadData={commonHeadBanner.result_list} />
<MyJobs
MyJobList={userJobList}
commonHeadData={commonHeadBanner.result_list}
/>
</>
);
}
}
+21 -2
View File
@@ -1,10 +1,29 @@
import React from "react";
import React,{useState, useEffect} from "react";
import Settings from "../components/Settings";
import usersService from "../services/UsersService";
export default function SettingsPage() {
const apiCall = new usersService()
let [faq, setFaq] = useState({loading:true, data:[]}) // STATE TO HOLD FAQ DATA
//FUNCTION TO GET FAQ
const getFaq = () => {
apiCall.getFaq().then(res => {
setFaq({loading:false, data:res.data.result_list})
}).catch(err => {
setFaq({loading:false, data:[]})
console.log('Error', err)
})
}
useEffect(()=>{
getFaq()
},[])
return (
<>
<Settings />
<Settings faq={faq} />
</>
);
}