Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b5625ab799 | |||
| 9dc8acc584 | |||
| 4ef9b2f20e | |||
| 709b8ea8f2 | |||
| 549af89a43 | |||
| 123ed2056a | |||
| f04f4c713e | |||
| 6d16e7f63f | |||
| 153bc7ab7d | |||
| 054688af8b | |||
| 9994ccc26a | |||
| f5c24ffb0c | |||
| d5ce5d758a | |||
| 0b14c7675b | |||
| 6a3662d69e | |||
| 8a6c8badbe | |||
| 99be0961a9 |
@@ -27,7 +27,7 @@ export default function HomeBannerOffersCard(props) {
|
|||||||
<div className="content flex justify-between items-center mb-5">
|
<div className="content flex justify-between items-center mb-5">
|
||||||
<div className="siderCardHeader">
|
<div className="siderCardHeader">
|
||||||
<h1 className="text-2xl font-bold text-dark-gray dark:text-white tracking-wide">
|
<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>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
{/*<SelectBox datas={filterDatas} action={dataSetHandler} />*/}
|
{/*<SelectBox datas={filterDatas} action={dataSetHandler} />*/}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ export default function FamilyManageTabs({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<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 || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -5,16 +5,12 @@ import { handlePagingFunc } from "../../Pagination/HandlePagination";
|
|||||||
import PaginatedList from "../../Pagination/PaginatedList";
|
import PaginatedList from "../../Pagination/PaginatedList";
|
||||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
import Icons from "../../Helpers/Icons";
|
import Icons from "../../Helpers/Icons";
|
||||||
|
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
||||||
|
|
||||||
export default function FamilyTasks({ familyData, className, loader }) {
|
export default function FamilyTasks({ familyData, className, loader }) {
|
||||||
const filterCategories = ["All Categories", "Explore", "Featured"];
|
|
||||||
const [selectedCategory, setCategory] = useState(filterCategories[0]);
|
|
||||||
|
|
||||||
let navigate = useNavigate();
|
let navigate = useNavigate();
|
||||||
let { pathname } = useLocation();
|
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 [currentPage, setCurrentPage] = useState(0);
|
||||||
const indexOfFirstItem = Number(currentPage);
|
const indexOfFirstItem = Number(currentPage);
|
||||||
const indexOfLastItem =
|
const indexOfLastItem =
|
||||||
@@ -24,10 +20,7 @@ export default function FamilyTasks({ familyData, className, loader }) {
|
|||||||
indexOfLastItem
|
indexOfLastItem
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handlePagination = (e) => handlePagingFunc(e, setCurrentPage);
|
||||||
const handlePagination = (e) => {
|
|
||||||
handlePagingFunc(e, setCurrentPage);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -52,8 +45,14 @@ export default function FamilyTasks({ familyData, className, loader }) {
|
|||||||
familyData?.result_list &&
|
familyData?.result_list &&
|
||||||
familyData.result_list.length > 0 &&
|
familyData.result_list.length > 0 &&
|
||||||
currentTask.map((value, index) => {
|
currentTask.map((value, index) => {
|
||||||
// find due date
|
// find due date
|
||||||
const dueDate = value?.delivery_date.split(" ")[0]
|
const dueDate = value?.delivery_date.split(" ")[0];
|
||||||
|
// the price
|
||||||
|
let thePrice = PriceFormatter(
|
||||||
|
value?.price * 0.01,
|
||||||
|
value?.currency_code,
|
||||||
|
value?.currency
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={index}
|
key={index}
|
||||||
@@ -73,26 +72,26 @@ export default function FamilyTasks({ familyData, className, loader }) {
|
|||||||
{value.title}
|
{value.title}
|
||||||
</h1>
|
</h1>
|
||||||
<div className="flex gap-4 items-center">
|
<div className="flex gap-4 items-center">
|
||||||
<span className="text-sm text-thin-light-gray">
|
<span className="text-sm text-thin-light-gray">
|
||||||
Price:{" "}
|
Price:{" "}
|
||||||
<span className="text-purple">
|
<span className="text-purple">
|
||||||
{value.price * 0.01}
|
{thePrice}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
<span className="text-sm text-thin-light-gray">
|
||||||
<span className="text-sm text-thin-light-gray">
|
Duration:{" "}
|
||||||
Duration:{" "}
|
<span className="text-purple">
|
||||||
<span className="text-purple">
|
{" "}
|
||||||
{" "}
|
{value.timeline_days} day(s)
|
||||||
{value.timeline_days} day(s)
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
<span className="text-sm text-thin-light-gray">
|
||||||
<span className="text-sm text-thin-light-gray">
|
Due Date:{" "}
|
||||||
Due Date:{" "}
|
<span className="text-purple">
|
||||||
<span className="text-purple">
|
{" "}
|
||||||
{" "}
|
{dueDate}
|
||||||
{dueDate}
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -103,7 +102,12 @@ export default function FamilyTasks({ familyData, className, loader }) {
|
|||||||
type="button"
|
type="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/manage-active-job", {
|
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"
|
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>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
);
|
||||||
})}
|
})}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default function Accordion({ datas }) {
|
|||||||
<>
|
<>
|
||||||
<div className="accordion-item overflow-hidden relative z-[1]">
|
<div className="accordion-item overflow-hidden relative z-[1]">
|
||||||
<div
|
<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}
|
onClick={accordionHandler}
|
||||||
>
|
>
|
||||||
<div className="accordion-title-icon relative">
|
<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="w-[3px] h-auto bg-purple rounded-[28px]"></div>
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<p className="text-base text-thin-light-gray tracking-wide">
|
<p className="text-base text-thin-light-gray tracking-wide">
|
||||||
{datas.content}
|
{datas.msg}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -68,13 +68,13 @@ export default function InputCom({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<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
|
<input
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
value={value}
|
value={value}
|
||||||
onChange={inputHandler}
|
onChange={inputHandler}
|
||||||
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${
|
className={`input-field placeholder:text-base text-dark-gray w-full h-full tracking-wide ${
|
||||||
inputBg ? inputBg : "bg-[#FAFAFA]"
|
inputBg ? inputBg : "bg-[#FAFAFA]"
|
||||||
} dark:bg-[#11131F] focus:ring-0 focus:outline-none ${fieldClass}`}
|
} dark:bg-[#11131F] focus:ring-0 focus:outline-none ${fieldClass}`}
|
||||||
type={type}
|
type={type}
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ export default function History() {
|
|||||||
</div>
|
</div>
|
||||||
{/* END OF RECENT ACTIVITY SECTION */}
|
{/* END OF RECENT ACTIVITY SECTION */}
|
||||||
</div>
|
</div>
|
||||||
<HistoryTable />
|
{/*<HistoryTable />*/}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ function ActiveJobs(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<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 */}
|
{/* job title */}
|
||||||
<div className="w-full md:w-8/12">
|
<div className="w-full md:w-8/12">
|
||||||
<div className="w-full flex justify-start space-x-3 items-start">
|
<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">
|
<p className="w-full text-base text-right text-sky-blue">
|
||||||
{props.details.job_to && props.details.job_to}
|
{props.details.job_to && props.details.job_to}
|
||||||
</p>
|
</p>
|
||||||
<div className="text-base text-slate-700 dark:text-black tracking-wide">
|
<div className="text-base text-slate-700 dark:text-white tracking-wide">
|
||||||
<p className="font-semibold text-black">Description: </p>
|
<p className="font-semibold text-black dark:text-white">Description: </p>
|
||||||
<p className="p-2 border border-sky-blue">
|
<p className="p-2 border border-sky-blue">
|
||||||
{props.details?.description && props.details.description}
|
{props.details?.description && props.details.description}
|
||||||
</p>
|
</p>
|
||||||
@@ -295,12 +295,12 @@ function ActiveJobs(props) {
|
|||||||
<p className="text-base text-sky-blue">Delivery Detail</p>
|
<p className="text-base text-sky-blue">Delivery Detail</p>
|
||||||
{passDue ? (
|
{passDue ? (
|
||||||
<div className="my-1">
|
<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>
|
<span className="font-semibold">Due: </span>
|
||||||
{props.details?.delivery_date &&
|
{props.details?.delivery_date &&
|
||||||
props.details.delivery_date.split(" ")[0]}
|
props.details.delivery_date.split(" ")[0]}
|
||||||
</p>
|
</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 &&
|
||||||
props.details.delivery_date.split(" ")[1]}
|
props.details.delivery_date.split(" ")[1]}
|
||||||
</p>
|
</p>
|
||||||
@@ -309,10 +309,10 @@ function ActiveJobs(props) {
|
|||||||
<div className="my-1 flex items-start gap-3">
|
<div className="my-1 flex items-start gap-3">
|
||||||
<p className="font-semibold">Due: </p>
|
<p className="font-semibold">Due: </p>
|
||||||
<div className="flex flex-col justify-between">
|
<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} />
|
<CountDown lastDate={props.details.delivery_date} />
|
||||||
</p>
|
</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>Hrs</span>
|
||||||
<span>Min</span>
|
<span>Min</span>
|
||||||
<span>Sec</span>
|
<span>Sec</span>
|
||||||
@@ -321,15 +321,15 @@ function ActiveJobs(props) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="my-1 text-base text-slate-700 dark:text-black tracking-wide flex items-center gap-3">
|
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
|
||||||
<span className="font-semibold text-black">Duration: </span>
|
<span className="font-semibold text-black dark:text-white">Duration: </span>
|
||||||
<span className="">
|
<span className="">
|
||||||
{props.details?.timeline_days && props.details.timeline_days}{" "}
|
{props.details?.timeline_days && props.details.timeline_days}{" "}
|
||||||
day(s)
|
day(s)
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="my-1 text-base text-slate-700 dark:text-black tracking-wide flex items-center gap-3">
|
<div className="my-1 text-base text-slate-700 tracking-wide flex items-center gap-3">
|
||||||
<span className="font-semibold text-black">No: </span>
|
<span className="font-semibold text-black dark:text-white">No: </span>
|
||||||
<span className="">
|
<span className="">
|
||||||
{props.details?.contract && props.details.contract}
|
{props.details?.contract && props.details.contract}
|
||||||
</span>
|
</span>
|
||||||
@@ -338,7 +338,7 @@ function ActiveJobs(props) {
|
|||||||
{/* end of job details */}
|
{/* end of job details */}
|
||||||
</div>
|
</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="w-full lg:w-1/2">
|
||||||
<div className="">
|
<div className="">
|
||||||
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
@@ -358,7 +358,7 @@ function ActiveJobs(props) {
|
|||||||
<button
|
<button
|
||||||
name="message"
|
name="message"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
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"
|
tab == "message" ? "border-sky-blue" : "border-slate-300"
|
||||||
} tracking-wide transition duration-200`}
|
} tracking-wide transition duration-200`}
|
||||||
>
|
>
|
||||||
@@ -367,7 +367,7 @@ function ActiveJobs(props) {
|
|||||||
<button
|
<button
|
||||||
name="files"
|
name="files"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
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"
|
tab == "files" ? "border-sky-blue" : "border-slate-300"
|
||||||
} tracking-wide transition duration-200`}
|
} tracking-wide transition duration-200`}
|
||||||
>
|
>
|
||||||
@@ -376,7 +376,7 @@ function ActiveJobs(props) {
|
|||||||
</div>
|
</div>
|
||||||
{tab == "message" ? (
|
{tab == "message" ? (
|
||||||
<textarea
|
<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"
|
// rows="10"
|
||||||
style={{ resize: "none" }}
|
style={{ resize: "none" }}
|
||||||
name="message"
|
name="message"
|
||||||
@@ -498,7 +498,7 @@ function ActiveJobs(props) {
|
|||||||
{/* MESSAGE SECTION */}
|
{/* MESSAGE SECTION */}
|
||||||
<div className="w-full lg:w-1/2">
|
<div className="w-full lg:w-1/2">
|
||||||
<div className="flex justify-between items-center gap-5">
|
<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
|
Message
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import React from 'react'
|
|||||||
|
|
||||||
function CurrentJobAction() {
|
function CurrentJobAction() {
|
||||||
return (
|
return (
|
||||||
<div className='job-action'>
|
<div className='job-action bg-white dark:bg-black'>
|
||||||
<p className="my-3 py-1 text-base active-owner">
|
<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>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ function CurrentTaskAction({jobDetails}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
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>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -101,9 +101,9 @@ function PastDueJobAction({jobDetails}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
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>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import React from 'react'
|
|||||||
|
|
||||||
function PastDueTaskAction() {
|
function PastDueTaskAction() {
|
||||||
return (
|
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>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -90,9 +90,9 @@ function ReviewJobAction({jobDetails}) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className='job-action'>
|
<div className='job-action bg-white dark:bg-black'>
|
||||||
<div className="my-3 py-1 text-base">
|
<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>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import React from 'react'
|
|||||||
|
|
||||||
function ReviewTaskAction() {
|
function ReviewTaskAction() {
|
||||||
return (
|
return (
|
||||||
<div className='job-action'>
|
<div className='job-action bg-white dark:bg-black'>
|
||||||
<p className="my-3 py-1 text-base">
|
<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
|
Waiting for the completion message from the client before you can approve. Worker True & Review Job
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
import { useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import { toast } from "react-toastify";
|
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
import { tableReload } from "../../store/TableReloads";
|
||||||
|
|
||||||
const CouponPopup = ({ popUpHandler, data }) => {
|
const CouponPopup = ({ popUpHandler, data }) => {
|
||||||
const [loader, setLoader] = useState(false);
|
const [loader, setLoader] = useState(false);
|
||||||
const apiCall = useMemo(() => new usersService(), []);
|
const apiCall = useMemo(() => new usersService(), []);
|
||||||
|
const [statusMsg, setStatusMsg] = useState({
|
||||||
|
success: "",
|
||||||
|
error: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const redeemCouponHandler = async () => {
|
const redeemCouponHandler = async () => {
|
||||||
setLoader(true);
|
setLoader(true);
|
||||||
@@ -14,28 +21,34 @@ const CouponPopup = ({ popUpHandler, data }) => {
|
|||||||
const reqData = { code_id: Number(coupon_id), code };
|
const reqData = { code_id: Number(coupon_id), code };
|
||||||
|
|
||||||
const res = await apiCall.getCouponRedeem(reqData);
|
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(() => {
|
setTimeout(() => {
|
||||||
popUpHandler();
|
popUpHandler();
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
}, 3000);
|
}, 10000);
|
||||||
throw new Response(res);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// error &&
|
|
||||||
// toast.warn("An error occurred while processing your coupon.", {
|
|
||||||
// autoClose: 3000,
|
|
||||||
// hideProgressBar: true,
|
|
||||||
// });
|
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
console.log(error);
|
if (error?.status !== 200)
|
||||||
return;
|
setStatusMsg({
|
||||||
// throw new Error(error);
|
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:
|
Amount:
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<div className="signin-area w-full">
|
<div className="signin-area w-full">
|
||||||
<div className="flex justify-end">
|
<div className="flex justify-end">
|
||||||
<button
|
<button
|
||||||
@@ -96,6 +108,12 @@ const CouponPopup = ({ popUpHandler, data }) => {
|
|||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div className="signin-area w-full px-5 py-4">
|
<div className="signin-area w-full px-5 py-4">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { handlePagingFunc } from "../Pagination/HandlePagination";
|
|||||||
import ModalCom from "../Helpers/ModalCom";
|
import ModalCom from "../Helpers/ModalCom";
|
||||||
import CouponPopup from "./CouponPopup";
|
import CouponPopup from "./CouponPopup";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
|
|
||||||
function CouponTable({ coupon }) {
|
function CouponTable({ coupon }) {
|
||||||
const [currentPage, setCurrentPage] = useState(0);
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
@@ -38,12 +39,18 @@ function CouponTable({ coupon }) {
|
|||||||
</thead>
|
</thead>
|
||||||
{coupon.data.length ? (
|
{coupon.data.length ? (
|
||||||
<tbody>
|
<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">
|
<tr key={index} className="text-slate-500">
|
||||||
<td className="p-2 cursor-default">
|
<td className="p-2 cursor-default">
|
||||||
{item.added} <br /> {item.code}
|
{item.added} <br /> {item.code}
|
||||||
</td>
|
</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">
|
<td className="p-2 h-20 flex items-center justify-end">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -51,7 +58,7 @@ function CouponTable({ coupon }) {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCouponPopup((prev) => ({
|
setCouponPopup((prev) => ({
|
||||||
state: !prev.state,
|
state: !prev.state,
|
||||||
data: item,
|
data: {...item, thePrice},
|
||||||
}));
|
}));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -59,7 +66,7 @@ function CouponTable({ coupon }) {
|
|||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
)})}
|
||||||
</tbody>
|
</tbody>
|
||||||
) : coupon.error ? (
|
) : coupon.error ? (
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import CouponTable from "./CouponTable";
|
import CouponTable from "./CouponTable";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
export default function MyCoupons() {
|
export default function MyCoupons() {
|
||||||
const apiCall = new usersService();
|
const apiCall = useMemo(() => new usersService(), []);
|
||||||
|
const {couponTable} = useSelector(state => state.tableReload)
|
||||||
let [couponHistory, setCouponHistory] = useState({
|
let [couponHistory, setCouponHistory] = useState({
|
||||||
// FOR COUPON HISTORY
|
// FOR COUPON HISTORY
|
||||||
loading: true,
|
loading: true,
|
||||||
@@ -14,7 +16,7 @@ export default function MyCoupons() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//FUNCTION TO GET COUPON HISTORY
|
//FUNCTION TO GET COUPON HISTORY
|
||||||
const getCouponHistory = () => {
|
const getCouponHistory = useCallback(() => {
|
||||||
apiCall
|
apiCall
|
||||||
.getCouponPending()
|
.getCouponPending()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -32,11 +34,11 @@ export default function MyCoupons() {
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setCouponHistory((prev) => ({ ...prev, loading: false, error: true }));
|
setCouponHistory((prev) => ({ ...prev, loading: false, error: true }));
|
||||||
});
|
});
|
||||||
};
|
}, [apiCall]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getCouponHistory();
|
getCouponHistory();
|
||||||
}, []);
|
}, [couponTable]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import usersService from "../../services/UsersService";
|
|||||||
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
||||||
import PaginatedList from "../Pagination/PaginatedList";
|
import PaginatedList from "../Pagination/PaginatedList";
|
||||||
import EditJobPopOut from "../jobPopout/EditJobPopout";
|
import EditJobPopOut from "../jobPopout/EditJobPopout";
|
||||||
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
|
|
||||||
export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
||||||
const [myCountry, setCountries] = useState("");
|
const [myCountry, setCountries] = useState("");
|
||||||
@@ -101,9 +102,15 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
{selectedCategory === "All Categories" ? (
|
{selectedCategory === "All Categories" ? (
|
||||||
<>
|
<>
|
||||||
{MyJobList &&
|
{MyJobList &&
|
||||||
MyJobList?.data?.result_list &&
|
MyJobList?.data?.result_list &&
|
||||||
MyJobList.data?.result_list.length > 0 ?
|
MyJobList.data?.result_list.length > 0 ? (
|
||||||
currentJobList.map((value, index) => (
|
currentJobList.map((value, index) => {
|
||||||
|
let thePrice = PriceFormatter(
|
||||||
|
value?.price * 0.01,
|
||||||
|
value?.currency_code,
|
||||||
|
value?.currency
|
||||||
|
);
|
||||||
|
return(
|
||||||
<tr
|
<tr
|
||||||
key={index}
|
key={index}
|
||||||
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50"
|
||||||
@@ -126,7 +133,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
<span className="text-sm text-thin-light-gray">
|
<span className="text-sm text-thin-light-gray">
|
||||||
Price:{" "}
|
Price:{" "}
|
||||||
<span className="text-purple">
|
<span className="text-purple">
|
||||||
{value.price * 0.01}
|
{thePrice}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span className="text-sm text-thin-light-gray">
|
<span className="text-sm text-thin-light-gray">
|
||||||
@@ -181,14 +188,12 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
|
|||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))
|
)})
|
||||||
:
|
) : (
|
||||||
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||||
<td className="p-2">
|
<td className="p-2">No Jobs Avaliable!</td>
|
||||||
No Jobs Avaliable!
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
}
|
)}
|
||||||
</>
|
</>
|
||||||
) : selectedCategory === "Explore" ? (
|
) : selectedCategory === "Explore" ? (
|
||||||
<></>
|
<></>
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ export default function MyJobs(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<CommonHead
|
<CommonHead commonHeadData={props.commonHeadData} />
|
||||||
commonHeadData={props.commonHeadData}
|
|
||||||
/>
|
|
||||||
<div className="notification-page w-full mb-10">
|
<div className="notification-page w-full mb-10">
|
||||||
<div className="notification-wrapper w-full">
|
<div className="notification-wrapper w-full">
|
||||||
{/* heading */}
|
{/* heading */}
|
||||||
@@ -42,9 +40,7 @@ export default function MyJobs(props) {
|
|||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<MyJobTable
|
<MyJobTable MyJobList={props.MyJobList} />
|
||||||
MyJobList={props.MyJobList}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|||||||
@@ -1,66 +1,85 @@
|
|||||||
import React, {useState} from 'react'
|
import React, { useState } from "react";
|
||||||
|
|
||||||
import PaginatedList from '../../Pagination/PaginatedList'
|
import PaginatedList from "../../Pagination/PaginatedList";
|
||||||
import { handlePagingFunc } from '../../Pagination/HandlePagination';
|
import { handlePagingFunc } from "../../Pagination/HandlePagination";
|
||||||
|
import { 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 handlePagination = (e) => {
|
||||||
const indexOfFirstItem = Number(currentPage);
|
handlePagingFunc(e, setCurrentPage);
|
||||||
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)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col justify-between h-full'>
|
<div className="flex flex-col justify-between h-full">
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className='border-b-2'>
|
<thead className="border-b-2">
|
||||||
<tr className='text-slate-600'>
|
<tr className="text-slate-600">
|
||||||
<th className="p-2">Date</th>
|
<th className="p-2">Date</th>
|
||||||
<th className="p-2">Description</th>
|
<th className="p-2">Description</th>
|
||||||
<th className="p-2">Amount</th>
|
<th className="p-2">Amount</th>
|
||||||
<th className="p-2">Active</th>
|
<th className="p-2">Active</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{coupon.data.length ?
|
{coupon.data.length ? (
|
||||||
(
|
<tbody>
|
||||||
<tbody>
|
{currentCoupon.map((item, index) => {
|
||||||
{currentCoupon.map((item, index) => (
|
let thePrice = PriceFormatter(
|
||||||
<tr key={index} className='text-slate-500'>
|
item?.price * 0.01,
|
||||||
<td className="p-2">{item.added}</td>
|
item?.currency_code,
|
||||||
<td className="p-2">{item.code}</td>
|
item?.currency
|
||||||
<td className="p-2">{item.amount}</td>
|
);
|
||||||
<td className="p-2">{item.status}</td>
|
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>
|
</tr>
|
||||||
))}
|
</tbody>
|
||||||
</tbody>
|
) : (
|
||||||
)
|
<tbody>
|
||||||
:
|
<tr className="text-slate-500">
|
||||||
coupon.error ?
|
<td className="p-2" colSpan={4}>
|
||||||
(
|
No Purchase History Found!
|
||||||
<tbody>
|
</td>
|
||||||
<tr className='text-slate-500'>
|
|
||||||
<td className="p-2" colSpan={4}>Opps! an error occurred. Please try again!</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
)
|
)}
|
||||||
:
|
</table>
|
||||||
<tbody>
|
|
||||||
<tr className='text-slate-500'>
|
|
||||||
<td className="p-2" colSpan={4}>No Purchase History Found!</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
}
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{/* 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} />
|
<PaginatedList
|
||||||
{/* END OF PAGINATION BUTTON */}
|
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>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default CouponTable
|
export default CouponTable;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ function ReferralTable({history}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
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">
|
<table className="referral-list w-full table-auto border-collapse text-left">
|
||||||
<thead className='border-b-2'>
|
<thead className='border-b-2'>
|
||||||
<tr className='text-slate-600'>
|
<tr className='text-slate-600'>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import CommonHead from "../UserHeader/CommonHead";
|
import CommonHead from "../UserHeader/CommonHead";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
@@ -11,6 +11,8 @@ import OthersInterestedTable from "./OthersInterestedTable";
|
|||||||
export default function ManageInterestOffer(props) {
|
export default function ManageInterestOffer(props) {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
let [tab, setTab] = useState("info"); //message STATE FOR SWITCHING BETWEEN TABS
|
||||||
|
|
||||||
const messageList = {data: [1,2,3,4,5,6]} // TO BE REMOVED AND REPLACE WITH REAL MESSAGE FROM API CALL
|
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 [currentPage, setCurrentPage] = useState(0);
|
||||||
const indexOfFirstItem = Number(currentPage);
|
const indexOfFirstItem = Number(currentPage);
|
||||||
@@ -25,17 +27,21 @@ export default function ManageInterestOffer(props) {
|
|||||||
const filterHandler = (value) => {
|
const filterHandler = (value) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
// run API to get message to replace message array above, add reload variable as dependence array
|
||||||
|
},[])
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<CommonHead
|
<CommonHead
|
||||||
commonHeadData={props.commonHeadData}
|
commonHeadData={props.commonHeadData}
|
||||||
/>
|
/>
|
||||||
<div className="notification-page w-full mb-10">
|
<div className="notification-page w-full mb-10">
|
||||||
<div className="notification-wrapper w-full">
|
<div className="notification-wrapper w-full mb-4">
|
||||||
{/* heading */}
|
{/* heading */}
|
||||||
<div className="sm:flex justify-between items-center mb-6">
|
<div className="sm:flex justify-between items-center mb-3">
|
||||||
<div className="mb-5 sm:mb-0">
|
<div className="mb-3 sm:mb-0">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||||
<span className={`${selectTab === "today" ? "block" : "hidden"}`}>Manage Offer Interest</span>
|
<span className={`${selectTab === "today" ? "block" : "hidden"}`}>Manage Offer Interest</span>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
@@ -43,39 +49,16 @@ export default function ManageInterestOffer(props) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* manage offer section */}
|
{/* manage offer section */}
|
||||||
<div className="w-full mb-8 p-8 bg-white dark:bg-dark-white rounded-2xl section-shadow">
|
<div className="w-full p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow">
|
||||||
{/* <div className="w-full flex justify-start space-x-3 items-center">
|
<div className="my-2 w-full sm:grid gap-5 grid-cols-4">
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
|
|
||||||
onClick={() =>
|
|
||||||
navigate(props.offerDetails.pathname, { 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> */}
|
|
||||||
|
|
||||||
<div className="my-2 w-full md:grid gap-5 grid-cols-3">
|
|
||||||
{/* Detail section */}
|
{/* Detail section */}
|
||||||
<div className="w-full mb-5 lg:mb-0 col-span-2">
|
<div className="w-full mb-5 lg:mb-0 col-span-3">
|
||||||
<div className="w-full flex justify-start space-x-3 items-center">
|
<div className="w-full flex justify-start space-x-3 items-center">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
|
className="min-w-[45px] h-auto text-[#374557] border border-sky-blue p-1 rounded-full"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
navigate(props.offerDetails.pathname, { replace: true })
|
navigate('/offer-interest', { replace: true })
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -92,114 +75,147 @@ export default function ManageInterestOffer(props) {
|
|||||||
{props.offerDetails?.offer_code && props.offerDetails.offer_code}
|
{props.offerDetails?.offer_code && props.offerDetails.offer_code}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<h1 className="my-5 text-xl lg:text-2xl font-bold text-dark-gray dark:text-white tracking-wide border">
|
<h1 className="my-3 text-xl lg:text-2xl font-bold text-dark-gray dark:text-white tracking-wide border">
|
||||||
{props.offerDetails?.title}
|
{props.offerDetails?.title}
|
||||||
</h1>
|
</h1>
|
||||||
<div className="flex items-center">
|
|
||||||
<div className="w-3/4">
|
|
||||||
<div className="my-5 flex items-center gap-1">
|
|
||||||
<span className="w-[150px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Name</span>
|
|
||||||
<span className="text-sm font-bold text-dark-gray dark:text-white tracking-wide">Dummy name</span>
|
|
||||||
</div>
|
|
||||||
<div className="my-5 flex items-center gap-1">
|
|
||||||
<span className="w-[150px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Member Since</span>
|
|
||||||
<span className="text-sm font-bold text-dark-gray dark:text-white tracking-wide">Dummy Date</span>
|
|
||||||
</div>
|
|
||||||
<div className="my-5 flex items-center gap-1">
|
|
||||||
<span className="w-[150px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs completed</span>
|
|
||||||
<span className="text-sm font-bold text-dark-gray dark:text-white tracking-wide">Dummy number</span>
|
|
||||||
</div>
|
|
||||||
<div className="my-5 flex items-center gap-1">
|
|
||||||
<span className="w-[150px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs active</span>
|
|
||||||
<span className="text-sm font-bold text-dark-gray dark:text-white tracking-wide">Dummy number</span>
|
|
||||||
</div>
|
|
||||||
<div className="my-5 flex items-center gap-1">
|
|
||||||
<span className="w-[150px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Jobs uncompleted</span>
|
|
||||||
<span className="text-sm font-bold text-dark-gray dark:text-white tracking-wide">Dummy number</span>
|
|
||||||
</div>
|
|
||||||
<div className="my-5 flex items-center gap-1">
|
|
||||||
<span className="w-[150px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Pending Offers</span>
|
|
||||||
<span className="text-sm font-bold text-dark-gray dark:text-white tracking-wide">Dummy number</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
<span className="w-[150px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">% completion</span>
|
|
||||||
<span className="text-sm font-bold text-dark-gray dark:text-white tracking-wide">Dummy number</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="w-1/4 flex flex-col justify-center items-center gap-10">
|
<div className="w-full">
|
||||||
|
{/* switch button */}
|
||||||
|
<div className="my-1 flex items-center border-b border-slate-300">
|
||||||
<button
|
<button
|
||||||
type="button"
|
name="info"
|
||||||
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
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`}
|
||||||
>
|
>
|
||||||
<span className="text-white">Accept</span>
|
Info
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
name="message"
|
||||||
className="px-2 py-1 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white"
|
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`}
|
||||||
>
|
>
|
||||||
<span className="text-gradient">Reject</span>
|
Messages ({messageList.data.length})
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
{/* END OF Detail section */}
|
{/* END OF Detail section */}
|
||||||
|
|
||||||
{/* message section */}
|
{/* BUTTON section */}
|
||||||
<div className="p-4 w-full min-h-full bg-sky-100 dark:bg-dark-gray col-span-1">
|
<div className="p-4 w-full min-h-full bg-sky-100 dark:bg-dark-gray col-span-1">
|
||||||
<p className="text-base font-bold text-dark-gray dark:text-white tracking-wide">Message to dummy name</p>
|
<div className="w-full h-full flex flex-col justify-center items-center gap-10">
|
||||||
<div className="my-4 w-full">
|
<button
|
||||||
<textarea rows={5} className="p-4 text-base font-bold text-dark-gray dark:text-white tracking-wide w-full resize-none rounded-md outline-none" />
|
type="button"
|
||||||
<div className="w-full flex justify-end items-center">
|
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
<button
|
>
|
||||||
type="button"
|
<span className="text-white">Accept</span>
|
||||||
className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
</button>
|
||||||
>
|
<button
|
||||||
<span className="text-white">Send</span>
|
type="button"
|
||||||
</button>
|
className="px-2 py-1 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white"
|
||||||
</div>
|
>
|
||||||
|
<span className="text-gradient">Reject</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/* message list */}
|
|
||||||
{currentMessageList.map((item, index)=>(
|
|
||||||
<div className="my-3 w-full">
|
|
||||||
<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>
|
|
||||||
))}
|
|
||||||
|
|
||||||
{/* 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>
|
||||||
{/* END of message section */}
|
{/* END of BUTTON section */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* END OF manage offer section */}
|
{/* END OF manage offer section */}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full overflow-x-auto">
|
<div className="w-full overflow-x-auto">
|
||||||
<div className="notification-page w-full mb-10">
|
{/* heading */}
|
||||||
<div className="notification-wrapper w-full">
|
<div className="sm:flex justify-between items-center mb-3">
|
||||||
{/* heading */}
|
<div className="mb-3 sm:mb-0">
|
||||||
<div className="sm:flex justify-between items-center mb-6">
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||||
<div className="mb-5 sm:mb-0">
|
<span className={`${selectTab === "today" ? "block" : "hidden"}`}>Others interested in this Task</span>
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
</h1>
|
||||||
<span className={`${selectTab === "today" ? "block" : "hidden"}`}>Others interested in this Task</span>
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<OthersInterestedTable othersInterestedList={props.othersInterestedList} />
|
<OthersInterestedTable othersInterestedList={props.othersInterestedList} />
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ export default function OffersInterestTable({offerInterestList, className}) {
|
|||||||
</tr> */}
|
</tr> */}
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="h-full">
|
<tbody className="h-full">
|
||||||
{currentOfferInterestList?.map((item, idx) => {
|
{currentOfferInterestList?.map((item, index) => {
|
||||||
return (
|
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">
|
<td className=" py-4">
|
||||||
<div className="flex space-x-2 items-center">
|
<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">
|
<div className="min-w-[60px] min-h-[60px] rounded-full overflow-hidden flex justify-center items-center">
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import LoadingSpinner from "../Spinners/LoadingSpinner";
|
|||||||
import { useNavigate, useLocation, Link } from "react-router-dom";
|
import { useNavigate, useLocation, Link } from "react-router-dom";
|
||||||
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
||||||
import PaginatedList from "../Pagination/PaginatedList";
|
import PaginatedList from "../Pagination/PaginatedList";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
import { tableReload } from "../../store/TableReloads";
|
||||||
|
|
||||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
|
|
||||||
@@ -11,6 +13,7 @@ import familyImage from '../../assets/images/no-family-side.png'
|
|||||||
|
|
||||||
export default function OthersInterestTable({othersInterestedList, className}) {
|
export default function OthersInterestTable({othersInterestedList, className}) {
|
||||||
|
|
||||||
|
const dispatch = useDispatch()
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
let { pathname } = useLocation();
|
let { pathname } = useLocation();
|
||||||
|
|
||||||
@@ -29,7 +32,7 @@ export default function OthersInterestTable({othersInterestedList, className}) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<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 p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow min-h-[520px] ${
|
||||||
className || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
@@ -52,9 +55,9 @@ export default function OthersInterestTable({othersInterestedList, className}) {
|
|||||||
</tr> */}
|
</tr> */}
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="h-full">
|
<tbody className="h-full">
|
||||||
{currentOthersInterestedList?.map((item, idx) => {
|
{currentOthersInterestedList?.map((item, index) => {
|
||||||
return (
|
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">
|
<td className=" py-4">
|
||||||
<div className="flex space-x-2 items-center">
|
<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">
|
<div className="min-w-[60px] min-h-[60px] rounded-full overflow-hidden flex justify-center items-center">
|
||||||
@@ -87,6 +90,7 @@ export default function OthersInterestTable({othersInterestedList, className}) {
|
|||||||
<td className="text-right py-4">
|
<td className="text-right py-4">
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
dispatch(tableReload({type:'OTHERSINTERESTEDTABLE'}))
|
||||||
navigate("/manage-offer", {
|
navigate("/manage-offer", {
|
||||||
state: { ...item, pathname },
|
state: { ...item, pathname },
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const PaginatedList = ({ onClick, prev, next, data, start, stop }) => {
|
|||||||
{!prev && (
|
{!prev && (
|
||||||
<button
|
<button
|
||||||
className={`p-2 border ${
|
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`}
|
} btn-shine rounded-full h-11 w-11`}
|
||||||
name="prev"
|
name="prev"
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
@@ -26,7 +26,7 @@ const PaginatedList = ({ onClick, prev, next, data, start, stop }) => {
|
|||||||
key={index}
|
key={index}
|
||||||
value={index}
|
value={index}
|
||||||
className={`p-2 border ${
|
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`}
|
} btn-shine rounded-full h-11 w-11`}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
name="page_num"
|
name="page_num"
|
||||||
@@ -43,7 +43,7 @@ const PaginatedList = ({ onClick, prev, next, data, start, stop }) => {
|
|||||||
{!next && (
|
{!next && (
|
||||||
<button
|
<button
|
||||||
className={`p-2 border ${
|
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`}
|
} btn-shine rounded-full h-11 w-11`}
|
||||||
name="next"
|
name="next"
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
|
|||||||
@@ -116,10 +116,21 @@ function ReferralDisplay() {
|
|||||||
}, [refHistoryReload]);
|
}, [refHistoryReload]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="content-wrapper w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin">
|
<div className="content-wrapper w-full lg:flex xl:space-x-8 bottomMargin">
|
||||||
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
|
<div className="lg:w-2/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">
|
<div className="sm:flex justify-between items-center mb-6">
|
||||||
<h2 className="text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
<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
|
Send Referral
|
||||||
</h2>
|
</h2>
|
||||||
<Formik
|
<Formik
|
||||||
@@ -129,42 +140,44 @@ function ReferralDisplay() {
|
|||||||
>
|
>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Form className="referral-info">
|
<Form className="referral-info">
|
||||||
{/* Firstname */}
|
<div className="block md:mb-6 md:flex gap-10">
|
||||||
<div className="field w-full mb-6">
|
{/* Firstname */}
|
||||||
<InputCom
|
<div className="field w-full mb-6 md:mb-0">
|
||||||
fieldClass="px-6"
|
<InputCom
|
||||||
label="Firstname"
|
fieldClass="px-6"
|
||||||
type="text"
|
label="Firstname"
|
||||||
name="firstname"
|
type="text"
|
||||||
placeholder="Firstname"
|
name="firstname"
|
||||||
value={props.values.firstname}
|
placeholder="Firstname"
|
||||||
inputHandler={props.handleChange}
|
value={props.values.firstname}
|
||||||
blurHandler={props.handleBlur}
|
inputHandler={props.handleChange}
|
||||||
/>
|
blurHandler={props.handleBlur}
|
||||||
{props.errors.firstname && props.touched.firstname && (
|
/>
|
||||||
<p className="text-sm text-red-500">
|
{props.errors.firstname && props.touched.firstname && (
|
||||||
{props.errors.firstname}
|
<p className="text-sm text-red-500">
|
||||||
</p>
|
{props.errors.firstname}
|
||||||
)}
|
</p>
|
||||||
</div>
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Lastname */}
|
{/* Lastname */}
|
||||||
<div className="field w-full mb-6">
|
<div className="field w-full mb-6 md:mb-0">
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
label="Lastname"
|
label="Lastname"
|
||||||
type="text"
|
type="text"
|
||||||
name="lastname"
|
name="lastname"
|
||||||
placeholder="Lastname"
|
placeholder="Lastname"
|
||||||
value={props.values.lastname}
|
value={props.values.lastname}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
blurHandler={props.handleBlur}
|
blurHandler={props.handleBlur}
|
||||||
/>
|
/>
|
||||||
{props.errors.lastname && props.touched.lastname && (
|
{props.errors.lastname && props.touched.lastname && (
|
||||||
<p className="text-sm text-red-500">
|
<p className="text-sm text-red-500">
|
||||||
{props.errors.lastname}
|
{props.errors.lastname}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="field w-full mb-6">
|
<div className="field w-full mb-6">
|
||||||
@@ -193,8 +206,7 @@ function ReferralDisplay() {
|
|||||||
) : (
|
) : (
|
||||||
<button
|
<button
|
||||||
type="submit"
|
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
|
Send Message
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
@@ -203,20 +215,20 @@ function ReferralDisplay() {
|
|||||||
)}
|
)}
|
||||||
</Formik>
|
</Formik>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="lg:w-1/2 w-full mb-10 lg:mb-0">
|
<div className="w-full md:p-8 p-4 bg-white dark:bg-dark-white rounded-2xl shadow">
|
||||||
<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">
|
|
||||||
<h2 className="mb-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
<h2 className="mb-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
||||||
Referral List
|
Referral List
|
||||||
</h2>
|
</h2>
|
||||||
{referralList.loading ? (
|
{referralList.loading ? (
|
||||||
<LoadingSpinner size="32" color="sky-blue" />
|
<LoadingSpinner size="32" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
<ReferralTable history={referralList} />
|
<ReferralTable history={referralList} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import Accordion from "../../Helpers/Accordion";
|
import Accordion from "../../Helpers/Accordion";
|
||||||
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
export default function FaqTab({ datas = [] }) {
|
export default function FaqTab({ datas }) {
|
||||||
return (
|
return (
|
||||||
<div className="faq-tab w-full">
|
<div className="faq-tab w-full">
|
||||||
<div className="accordion-items w-full">
|
<div className="accordion-items w-full">
|
||||||
{datas &&
|
{datas.loading ?
|
||||||
datas.length > 0 &&
|
<LoadingSpinner color='sky-blue' size={16} />
|
||||||
datas.map((value) => (
|
:
|
||||||
<Accordion key={value.id + Math.random()} datas={value} />
|
datas &&
|
||||||
|
datas?.data?.length > 0 &&
|
||||||
|
datas.data.map((value, index) => (
|
||||||
|
<Accordion key={index + Math.random()} datas={value} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useRef, useState } from "react";
|
import React, { useRef, useState } from "react";
|
||||||
import cover from "../../assets/images/profile-info-cover.png";
|
import cover from "../../assets/images/profile-info-cover.png";
|
||||||
import profile from "../../assets/images/profile-info-profile.png";
|
import profile from "../../assets/images/profile-info-profile.png";
|
||||||
import faq from "../../data/faq.json";
|
|
||||||
import Icons from "../Helpers/Icons";
|
import Icons from "../Helpers/Icons";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import ChangePasswordTab from "./Tabs/ChangePasswordTab";
|
import ChangePasswordTab from "./Tabs/ChangePasswordTab";
|
||||||
@@ -12,7 +12,7 @@ import PaymentMathodsTab from "./Tabs/PaymentMathodsTab";
|
|||||||
import PersonalInfoTab from "./Tabs/PersonalInfoTab";
|
import PersonalInfoTab from "./Tabs/PersonalInfoTab";
|
||||||
import TermsConditionTab from "./Tabs/TermsConditionTab";
|
import TermsConditionTab from "./Tabs/TermsConditionTab";
|
||||||
|
|
||||||
export default function Settings() {
|
export default function Settings({faq}) {
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@@ -83,8 +83,6 @@ export default function Settings() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// fab tab
|
|
||||||
const faqData = faq.datas;
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Layout>
|
<Layout>
|
||||||
@@ -259,7 +257,7 @@ export default function Settings() {
|
|||||||
)}
|
)}
|
||||||
{tab === "login_activity" && <LoginActivityTab />}
|
{tab === "login_activity" && <LoginActivityTab />}
|
||||||
{tab === "password" && <ChangePasswordTab />}
|
{tab === "password" && <ChangePasswordTab />}
|
||||||
{tab === "faq" && <FaqTab datas={faqData} />}
|
{tab === "faq" && <FaqTab datas={faq} />}
|
||||||
{tab === "terms" && <TermsConditionTab />}
|
{tab === "terms" && <TermsConditionTab />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+8
-1
@@ -10,7 +10,14 @@
|
|||||||
src: url("./assets/fonts/Product Sans Bold.ttf");
|
src: url("./assets/fonts/Product Sans Bold.ttf");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.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{
|
.job-action{
|
||||||
background-color: lightgoldenrodyellow;
|
background-color: lightgoldenrodyellow;
|
||||||
|
|||||||
@@ -687,9 +687,19 @@ class usersService {
|
|||||||
action: 14015,
|
action: 14015,
|
||||||
...reqData,
|
...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(username)
|
||||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import { createSlice } from "@reduxjs/toolkit";
|
|||||||
const initialState = {
|
const initialState = {
|
||||||
jobListTable: false,
|
jobListTable: false,
|
||||||
pendingListTable: false,
|
pendingListTable: false,
|
||||||
myTaskTable: false
|
myTaskTable: false,
|
||||||
|
othersInterestedTable: false,
|
||||||
|
couponTable: false
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tableReloadSlice = createSlice({
|
export const tableReloadSlice = createSlice({
|
||||||
@@ -11,18 +13,24 @@ export const tableReloadSlice = createSlice({
|
|||||||
initialState,
|
initialState,
|
||||||
reducers: {
|
reducers: {
|
||||||
tableReload: (state, action) => {
|
tableReload: (state, action) => {
|
||||||
switch(action.payload.type){
|
switch (action.payload.type) {
|
||||||
case 'JOBTABLE':
|
case "JOBTABLE":
|
||||||
state.jobListTable = !state.jobListTable;
|
state.jobListTable = !state.jobListTable;
|
||||||
return
|
return;
|
||||||
case 'PENDINGTABLE' :
|
case "PENDINGTABLE":
|
||||||
state.pendingListTable = !state.pendingListTable;
|
state.pendingListTable = !state.pendingListTable;
|
||||||
return
|
return;
|
||||||
case 'MYTASKTABLE' :
|
case "MYTASKTABLE":
|
||||||
state.myTaskTable = !state.myTaskTable;
|
state.myTaskTable = !state.myTaskTable;
|
||||||
return
|
return;
|
||||||
|
case "OTHERSINTERESTEDTABLE":
|
||||||
|
state.othersInterestedTable = !state.othersInterestedTable;
|
||||||
|
return;
|
||||||
|
case "COUPONTABLE":
|
||||||
|
state.couponTable = !state.couponTable;
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
return state
|
return state;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ export default function MyReviewDueJobsPage() {
|
|||||||
let navigate = useNavigate()
|
let navigate = useNavigate()
|
||||||
|
|
||||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||||
|
let { othersInterestedTable } = useSelector((state) => state.tableReload); // FOR OTHERS INTERESTED TABLE RELOAD
|
||||||
|
|
||||||
const apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
const [othersInterestedList, setOthersInterestedList] = useState({loading: true, data: []})
|
const [othersInterestedList, setOthersInterestedList] = useState({loading: true, data: []})
|
||||||
@@ -19,12 +20,18 @@ export default function MyReviewDueJobsPage() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
apiCall.offersInterestList().then(res => {
|
apiCall.offersInterestList().then(res => {
|
||||||
setOthersInterestedList({loading: false, data: res.data.result_list})
|
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 => {
|
}).catch(err => {
|
||||||
setOthersInterestedList({loading: false, data: []})
|
setOthersInterestedList({loading: false, data: []})
|
||||||
console.log('Error: ', err)
|
console.log('Error: ', err)
|
||||||
})
|
})
|
||||||
}, []);
|
}, [othersInterestedTable]);
|
||||||
|
|
||||||
// debugger;
|
// debugger;
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,41 +1,16 @@
|
|||||||
//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 MyJobs from "../components/MyJobs";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
export default function MyJobsPage() {
|
export default function MyJobsPage() {
|
||||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
let { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
||||||
|
const { userJobList } = useSelector((state) => state.userJobList);
|
||||||
|
|
||||||
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;
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<MyJobs MyJobList={userJobList} commonHeadData={commonHeadBanner.result_list} />
|
<MyJobs
|
||||||
|
MyJobList={userJobList}
|
||||||
|
commonHeadData={commonHeadBanner.result_list}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,29 @@
|
|||||||
import React from "react";
|
import React,{useState, useEffect} from "react";
|
||||||
import Settings from "../components/Settings";
|
import Settings from "../components/Settings";
|
||||||
|
import usersService from "../services/UsersService";
|
||||||
|
|
||||||
export default function SettingsPage() {
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<Settings />
|
<Settings faq={faq} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user