Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f3b8190418 | |||
| 6a37da92f0 | |||
| 3d382695cd | |||
| 9b0ff4a1e6 | |||
| 7231d97492 | |||
| f880afabb0 | |||
| e9d9dd2395 | |||
| a9c273aa17 | |||
| dddd314412 | |||
| 43f0039d29 | |||
| c9a475b525 | |||
| 74b2a554f1 |
@@ -1,4 +1,5 @@
|
|||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
||||||
import debounce from "../../../hooks/debounce";
|
import debounce from "../../../hooks/debounce";
|
||||||
@@ -6,8 +7,12 @@ import usersService from "../../../services/UsersService";
|
|||||||
import InputCom from "../../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import AuthLayout from "../AuthLayout2";
|
import AuthLayout from "../AuthLayout2";
|
||||||
import LoadingSpinner from '../../../components/Spinners/LoadingSpinner'
|
import LoadingSpinner from '../../../components/Spinners/LoadingSpinner'
|
||||||
|
import { updateUserDetails } from "../../../store/UserDetails";
|
||||||
|
|
||||||
export default function VerifyLink() {
|
export default function VerifyLink() {
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const [email, setEmail] = useState("");
|
const [email, setEmail] = useState("");
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
const [msgError, setMsgError] = useState("");
|
const [msgError, setMsgError] = useState("");
|
||||||
@@ -50,12 +55,14 @@ export default function VerifyLink() {
|
|||||||
) {
|
) {
|
||||||
localStorage.setItem("email", `${data?.email}`);
|
localStorage.setItem("email", `${data?.email}`);
|
||||||
localStorage.setItem("member_id", `${data?.member_id}`);
|
localStorage.setItem("member_id", `${data?.member_id}`);
|
||||||
|
localStorage.setItem("uid", `${data?.uid}`);
|
||||||
localStorage.setItem("session_token", `${data?.session}`);
|
localStorage.setItem("session_token", `${data?.session}`);
|
||||||
localStorage.setItem("session", `${data?.session}`);
|
localStorage.setItem("wallet_available_status", `${data?.wallet_available_status}`);
|
||||||
localStorage.setItem("uid", data?.uid);
|
dispatch(updateUserDetails({ ...data }));
|
||||||
|
setTimeout(() => {
|
||||||
navigate("/", { replace: true });
|
navigate("/", { replace: true });
|
||||||
setLinkLoader(false);
|
setLinkLoader(false);
|
||||||
|
}, 2000);
|
||||||
} else {
|
} else {
|
||||||
setLinkLoader(false);
|
setLinkLoader(false);
|
||||||
setMsgError("Invalid Link or Password Combination");
|
setMsgError("Invalid Link or Password Combination");
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export default function AvailableJobsCard({
|
|||||||
// backgroundImage: `url('${image}')`,
|
// backgroundImage: `url('${image}')`,
|
||||||
// }}
|
// }}
|
||||||
>
|
>
|
||||||
<div className="flex flex-col h-full bg-slate-100 p-2 rounded-md">
|
<div className="flex flex-col min-h-full bg-slate-100 p-2 rounded-md">
|
||||||
<p>{datas.description}</p>
|
<p>{datas.description}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -95,7 +95,7 @@ export default function AvailableJobsCard({
|
|||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<div>
|
<div>
|
||||||
<p className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white">
|
<p className="w-full font-bold text-xl tracking-wide text-dark-gray dark:text-white">
|
||||||
{/* {thePrice} | {datas.timeline_days} day(s) */}
|
{/* {thePrice} | {datas.timeline_days} day(s) */}
|
||||||
{thePrice}
|
{thePrice}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -55,20 +55,20 @@ function JobsCompleted() {
|
|||||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||||
: familyRewardHistory.data.length ?
|
: familyRewardHistory.data.length ?
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className='border-b-2'>
|
<thead className='w-full'>
|
||||||
<tr className='text-slate-600'>
|
<tr className='text-slate-600 dark:text-white'>
|
||||||
<th className="p-2"></th>
|
<th className="p-4"></th>
|
||||||
<th className="p-2">Amount</th>
|
<th className="p-4">Amount</th>
|
||||||
<th className="p-2">Date</th>
|
<th className="p-4">Date</th>
|
||||||
<th className="p-2">Confirmation</th>
|
<th className="p-4">Confirmation</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{currentReward.map((item, index) => {
|
{currentReward.map((item, index) => {
|
||||||
let date = new Date(item.added).toLocaleDateString()
|
let date = new Date(item.added).toLocaleDateString()
|
||||||
return (
|
return (
|
||||||
<tr key={index} className='text-slate-500'>
|
<tr key={index} className='dark:text-white dark:bg-dark-white border-y dark:border-[#5356fb29] hover:bg-gray-50 dark:hover:bg-gray-50 dark:hover:text-black transition-all duration-300'>
|
||||||
<td className="p-2">
|
<td className="p-4">
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<img src={item.icon} className='min-w-[60px] max-w-[60px] min-h-[60px] max-h-[60px] rounded-full bg-slate-500' alt='Reward Logo' />
|
<img src={item.icon} className='min-w-[60px] max-w-[60px] min-h-[60px] max-h-[60px] rounded-full bg-slate-500' alt='Reward Logo' />
|
||||||
<div className='flex flex-col'>
|
<div className='flex flex-col'>
|
||||||
@@ -77,9 +77,9 @@ function JobsCompleted() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-2">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
|
<td className="p-4">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
|
||||||
<td className="p-2">{date}</td>
|
<td className="p-4">{date}</td>
|
||||||
<td className="p-2">{item.confirmation}</td>
|
<td className="p-4">{item.confirmation}</td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -97,7 +97,7 @@ function JobsCompleted() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{/* PAGINATION BUTTON */}
|
{/* PAGINATION BUTTON */}
|
||||||
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= familyRewardHistory?.data?.length ? true : false} data={familyRewardHistory?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
<PaginatedList borderTop={false} onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= familyRewardHistory?.data?.length ? true : false} data={familyRewardHistory?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
||||||
{/* END OF PAGINATION BUTTON */}
|
{/* END OF PAGINATION BUTTON */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -52,20 +52,20 @@ export const RewardsTable = memo(() => {
|
|||||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||||
: familyRewardHistory.data.length ?
|
: familyRewardHistory.data.length ?
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className='border-b-2'>
|
<thead className='w-full'>
|
||||||
<tr className='text-slate-600'>
|
<tr className='text-slate-600 dark:text-white'>
|
||||||
<th className="p-2"></th>
|
<th className="p-4"></th>
|
||||||
<th className="p-2">Amount</th>
|
<th className="p-4">Amount</th>
|
||||||
<th className="p-2">Date</th>
|
<th className="p-4">Date</th>
|
||||||
<th className="p-2">Confirmation</th>
|
<th className="p-4">Confirmation</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{currentReward.map((item, index) => {
|
{currentReward.map((item, index) => {
|
||||||
let date = new Date(item.added).toLocaleDateString()
|
let date = new Date(item.added).toLocaleDateString()
|
||||||
return (
|
return (
|
||||||
<tr key={index} className='text-slate-500'>
|
<tr key={index} className='dark:text-white dark:bg-dark-white border-y dark:border-[#5356fb29] hover:bg-gray-50 dark:hover:bg-gray-50 dark:hover:text-black transition-all duration-300'>
|
||||||
<td className="p-2">
|
<td className="p-4">
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<img src={item.icon} className='min-w-[60px] max-w-[60px] min-h-[60px] max-h-[60px] rounded-full bg-slate-500' alt='Reward Logo' />
|
<img src={item.icon} className='min-w-[60px] max-w-[60px] min-h-[60px] max-h-[60px] rounded-full bg-slate-500' alt='Reward Logo' />
|
||||||
<div className='flex flex-col'>
|
<div className='flex flex-col'>
|
||||||
@@ -74,9 +74,9 @@ export const RewardsTable = memo(() => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-2">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
|
<td className="p-4">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
|
||||||
<td className="p-2">{date}</td>
|
<td className="p-4">{date}</td>
|
||||||
<td className="p-2">{item.confirmation}</td>
|
<td className="p-4">{item.confirmation}</td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -94,7 +94,7 @@ export const RewardsTable = memo(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{/* PAGINATION BUTTON */}
|
{/* PAGINATION BUTTON */}
|
||||||
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= familyRewardHistory?.data?.length ? true : false} data={familyRewardHistory?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
<PaginatedList borderTop={false} onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= familyRewardHistory?.data?.length ? true : false} data={familyRewardHistory?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
||||||
{/* END OF PAGINATION BUTTON */}
|
{/* END OF PAGINATION BUTTON */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ export default function History() {
|
|||||||
</button>
|
</button>
|
||||||
</div> */}
|
</div> */}
|
||||||
{/* END OF switch button */}
|
{/* END OF switch button */}
|
||||||
<div className="history-tables w-full bg-red-50 overflow-x-auto">
|
<div className="history-tables w-full bg-red-50 dark:bg-dark-white overflow-x-auto">
|
||||||
{/* PURCHASE SECTION */}
|
{/* PURCHASE SECTION */}
|
||||||
{selectedTab == 'purchases' &&
|
{selectedTab == 'purchases' &&
|
||||||
<div className="wallet w-full">
|
<div className="wallet w-full">
|
||||||
|
|||||||
@@ -80,18 +80,18 @@ function ActiveJobs(props) {
|
|||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
message: "File must be <= 30mb",
|
message: `File must be <= ${Number(process.env.REACT_APP_MAX_VIDEO_FILE_SIZE)/1048576} mb`,
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
}, 5000);
|
}, 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) { // return if other files is more than 1mb
|
if (fileType != 'video' && files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) { // return if other files is more than 1mb
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
message: "File must be <= 1mb",
|
message: `File must be <= ${Number(process.env.REACT_APP_MAX_FILE_SIZE)/1048576} mb`,
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
|
|||||||
@@ -74,18 +74,18 @@ function ActiveJobsMedia(props) {
|
|||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
message: "File must be <= 30mb",
|
message: `File must be <= ${Number(process.env.REACT_APP_MAX_VIDEO_FILE_SIZE)/1048576} mb`,
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
}, 5000);
|
}, 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) { // return if other files is more than 1mb
|
if (fileType != 'video' && files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)) { // return if other files is more than 1mb
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
message: "File must be <= 1mb",
|
message: `File must be <= ${Number(process.env.REACT_APP_MAX_FILE_SIZE)/1048576} mb`,
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ function AmountSection({ currency, amount, country }) {
|
|||||||
<div className={`flex items-center gap-8`}>
|
<div className={`flex items-center gap-8`}>
|
||||||
{/* text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1 */}
|
{/* text-xl font-bold text-dark-gray dark:text-white tracking-tighter my-1 */}
|
||||||
<h1 className="min-w-[150px] job-label">
|
<h1 className="min-w-[150px] job-label">
|
||||||
Amount({currency})
|
Amount ({currency})
|
||||||
</h1>
|
</h1>
|
||||||
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{formattedAmount}
|
{formattedAmount}
|
||||||
@@ -91,7 +91,7 @@ function TotalSection({ currency, amount, fee, country }) {
|
|||||||
return (
|
return (
|
||||||
<div className={`flex items-center gap-8`}>
|
<div className={`flex items-center gap-8`}>
|
||||||
<h1 className="min-w-[150px] job-label">
|
<h1 className="min-w-[150px] job-label">
|
||||||
Total
|
Total ({currency})
|
||||||
</h1>
|
</h1>
|
||||||
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
<span className="min-w-[100px] text-base text-right font-normal text-dark-gray dark:text-white tracking-tighter my-1">
|
||||||
{formattedTotal}
|
{formattedTotal}
|
||||||
|
|||||||
@@ -18,21 +18,21 @@ function PurchasesTable({purchase}) {
|
|||||||
<div className='flex flex-col justify-between min-h-[500px]'>
|
<div className='flex flex-col justify-between min-h-[500px]'>
|
||||||
{purchase.data.length ?
|
{purchase.data.length ?
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className='border-b-2'>
|
<thead className='w-full'>
|
||||||
<tr className='text-slate-600'>
|
<tr className='text-slate-600 dark:text-white'>
|
||||||
<th className="p-2">Trx.</th>
|
<th className="p-4">Trx.</th>
|
||||||
<th className="p-2">Amount</th>
|
<th className="p-4">Amount</th>
|
||||||
<th className="p-2">Fee</th>
|
<th className="p-4">Fee</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{currentPurchase.map((item, index) => (
|
{currentPurchase.map((item, index) => (
|
||||||
<tr key={index} className='text-slate-500'>
|
<tr key={index} className='dark:text-white dark:bg-dark-white border-y dark:border-[#5356fb29] hover:bg-gray-50 dark:hover:bg-gray-50 dark:hover:text-black transition-all duration-300'>
|
||||||
<td className="p-2">{item.added_date}<br />
|
<td className="p-4">{item.added_date}<br />
|
||||||
<b>{item.confirmation} </b>
|
<b>{item.confirmation} </b>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-2">{item.amount}</td>
|
<td className="p-4">{item.amount}</td>
|
||||||
<td className="p-2">{item.fee}</td>
|
<td className="p-4">{item.fee}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -48,7 +48,7 @@ function PurchasesTable({purchase}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{/* PAGINATION BUTTON */}
|
{/* PAGINATION BUTTON */}
|
||||||
<PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= purchase?.data?.length ? true : false} data={purchase?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
<PaginatedList borderTop={false} onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= purchase?.data?.length ? true : false} data={purchase?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
||||||
{/* END OF PAGINATION BUTTON */}
|
{/* END OF PAGINATION BUTTON */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,28 +21,28 @@ function RecentActivityTable({ payment }) {
|
|||||||
<div className="flex flex-col justify-between min-h-[500px]">
|
<div className="flex flex-col justify-between min-h-[500px]">
|
||||||
{payment?.data?.length > 0 ?
|
{payment?.data?.length > 0 ?
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className="border-b-2">
|
<thead className="w-full">
|
||||||
<tr className="text-slate-600">
|
<tr className="text-slate-600 dark:text-white">
|
||||||
<th className="p-2">Date</th>
|
<th className="p-4">Date</th>
|
||||||
<th className="p-2">Trx.</th>
|
<th className="p-4">Trx.</th>
|
||||||
<th className="p-2">Amnt./Fee</th>
|
<th className="p-4">Amnt./Fee</th>
|
||||||
<th className="p-2">Status</th>
|
<th className="p-4">Status</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{currentActivity.map((item, index) => (
|
{currentActivity.map((item, index) => (
|
||||||
<tr key={index} className="text-slate-500">
|
<tr key={index} className="dark:text-white dark:bg-dark-white border-y dark:border-[#5356fb29] hover:bg-gray-50 dark:hover:bg-gray-50 dark:hover:text-black transition-all duration-300">
|
||||||
<td className="p-2">{item.trx_date}</td>
|
<td className="p-4">{item.trx_date}</td>
|
||||||
<td
|
<td
|
||||||
className="p-4"
|
className="p-4"
|
||||||
dangerouslySetInnerHTML={{ __html: item.recipient }}
|
dangerouslySetInnerHTML={{ __html: item.recipient }}
|
||||||
></td>
|
></td>
|
||||||
<td className="p-2">
|
<td className="p-4">
|
||||||
{item.amount}
|
{item.amount}
|
||||||
<br />
|
<br />
|
||||||
{item.fee}
|
{item.fee}
|
||||||
</td>
|
</td>
|
||||||
<td className="p-2">{item.status}</td>
|
<td className="p-4">{item.status}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -70,6 +70,7 @@ function RecentActivityTable({ payment }) {
|
|||||||
data={payment?.data}
|
data={payment?.data}
|
||||||
start={indexOfFirstItem}
|
start={indexOfFirstItem}
|
||||||
stop={indexOfLastItem}
|
stop={indexOfLastItem}
|
||||||
|
borderTop={false}
|
||||||
/>
|
/>
|
||||||
{/* END OF PAGINATION BUTTON */}
|
{/* END OF PAGINATION BUTTON */}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,10 +6,18 @@ import CommonHead from "../UserHeader/CommonHead";
|
|||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import OthersInterestedTable from "./OthersInterestedTable";
|
import OthersInterestedTable from "./OthersInterestedTable";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { tableReload } from "../../store/TableReloads";
|
import { tableReload } from "../../store/TableReloads";
|
||||||
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
|
|
||||||
export default function ManageInterestOffer(props) {
|
export default function ManageInterestOffer(props) {
|
||||||
|
|
||||||
|
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||||
|
|
||||||
|
let walletBal = walletDetails?.data?.filter(wallet => wallet.code == props?.offerDetails?.currency_code) // USER WALLET BALANCE FOR CORRESPONDING TASK CURRENCY
|
||||||
|
|
||||||
|
let clientAdded = new Date(props.offerDetails?.client_added)
|
||||||
|
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const apiCall = new usersService()
|
const apiCall = new usersService()
|
||||||
@@ -183,12 +191,21 @@ export default function ManageInterestOffer(props) {
|
|||||||
<button
|
<button
|
||||||
name="message"
|
name="message"
|
||||||
onClick={(e) => setTab(e.target.name)}
|
onClick={(e) => setTab(e.target.name)}
|
||||||
className={`px-4 py-1 rounded-t-2xl ${
|
className={`px-4 py-1 rounded-t-2xl flex gap-2 ${
|
||||||
tab == "message" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
tab == "message" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
Messages ({messageList.data.length})
|
Messages ({messageList.data.length})
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
name="details"
|
||||||
|
onClick={(e) => setTab(e.target.name)}
|
||||||
|
className={`px-4 py-1 rounded-t-2xl ${
|
||||||
|
tab == "details" ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
Delivery Details
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/* END OF switch button */}
|
{/* END OF switch button */}
|
||||||
|
|
||||||
@@ -202,7 +219,10 @@ export default function ManageInterestOffer(props) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="my-3 md:my-0 flex items-center gap-1">
|
<div className="my-3 md:my-0 flex items-center gap-1">
|
||||||
<span className="w-[200px] text-lg font-bold text-dark-gray dark:text-white tracking-wide">Member Since</span>
|
<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>
|
<span className="min-w-[100px] text-sm font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
|
{clientAdded.getFullYear()}{" - "}
|
||||||
|
{clientAdded.getMonth() < 9 ? '0'+ (clientAdded.getMonth() + 1) : clientAdded.getMonth() + 1}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="my-3 flex items-center gap-1">
|
<div className="my-3 flex items-center gap-1">
|
||||||
@@ -230,7 +250,7 @@ export default function ManageInterestOffer(props) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
: tab == 'message' ?
|
||||||
<div className="message-details w-full border-t">
|
<div className="message-details w-full border-t">
|
||||||
<p className="my-1 text-base text-dark-gray dark:text-white tracking-wide">To: <span className="font-bold">{props.offerDetails?.client_name}</span></p>
|
<p className="my-1 text-base text-dark-gray dark:text-white tracking-wide">To: <span className="font-bold">{props.offerDetails?.client_name}</span></p>
|
||||||
<div className="w-full flex items-center gap-5">
|
<div className="w-full flex items-center gap-5">
|
||||||
@@ -294,14 +314,31 @@ export default function ManageInterestOffer(props) {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
: tab == 'details' ?
|
||||||
|
<div className="info-details w-full border-t">
|
||||||
|
<h1 className="my-3 text-base font-medium text-dark-gray dark:text-white tracking-wide">{props?.offerDetails?.description}</h1>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
null
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* END OF Detail section */}
|
{/* END OF Detail section */}
|
||||||
|
|
||||||
{/* BUTTON section */}
|
|
||||||
<div className="p-4 w-full min-h-full bg-sky-100 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">
|
||||||
<div className="w-full h-full">
|
{/* Wallet balance and reward */}
|
||||||
|
<div className='mb-4 border-b-2 flex flex-col justify-center items-center gap-4'>
|
||||||
|
<div className='w-full flex flex-col lg:flex-row justify-center items-center gap-2'>
|
||||||
|
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Wallet:</p>
|
||||||
|
<span className="font-medium text-dark-gray dark:text-white">{PriceFormatter(walletBal[0]?.amount * 0.01,props?.offerDetails?.currency_code,props?.offerDetails?.currency)}</span>
|
||||||
|
</div>
|
||||||
|
<div className='w-full flex flex-col lg:flex-row justify-center items-center gap-2'>
|
||||||
|
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Reward:</p>
|
||||||
|
<span className="font-medium text-dark-gray dark:text-white">{PriceFormatter(props?.offerDetails?.price * 0.01,props?.offerDetails?.currency_code,props?.offerDetails?.currency)}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* BUTTON section */}
|
||||||
|
<div className="w-full">
|
||||||
<div className="h-full flex sm:flex-col justify-center items-center gap-10">
|
<div className="h-full flex sm:flex-col justify-center items-center gap-10">
|
||||||
{requestStatus.loading && requestStatus.processType == 'accept' ?
|
{requestStatus.loading && requestStatus.processType == 'accept' ?
|
||||||
<LoadingSpinner color='sky-blue' size='10' />
|
<LoadingSpinner color='sky-blue' size='10' />
|
||||||
@@ -333,6 +370,7 @@ export default function ManageInterestOffer(props) {
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
{/* END of BUTTON section */}
|
||||||
|
|
||||||
{/* ERROR DISPLAY */}
|
{/* ERROR DISPLAY */}
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
@@ -357,7 +395,6 @@ export default function ManageInterestOffer(props) {
|
|||||||
{/* End of error or success display */}
|
{/* End of error or success display */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* END of BUTTON section */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* END OF manage offer section */}
|
{/* END OF manage offer section */}
|
||||||
|
|||||||
@@ -100,9 +100,21 @@ export default function OffersInterestTable({offerInterestList, className}) {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className='w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white'
|
||||||
>
|
>
|
||||||
View
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 11 20"
|
||||||
|
id="Arrow"
|
||||||
|
className="w-[0.7rem]"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fillRule="evenodd"
|
||||||
|
d="M.366 19.708c.405.39 1.06.39 1.464 0l8.563-8.264a1.95 1.95 0 0 0 0-2.827L1.768.292A1.063 1.063 0 0 0 .314.282a.976.976 0 0 0-.011 1.425l7.894 7.617a.975.975 0 0 1 0 1.414L.366 18.295a.974.974 0 0 0 0 1.413"
|
||||||
|
// fill=""
|
||||||
|
className="color000000 svgShape fill-[#fff]"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -101,9 +101,22 @@ export default function OthersInterestTable({othersInterestedList, className}) {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
View
|
{/* View */}
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 11 20"
|
||||||
|
id="Arrow"
|
||||||
|
className="w-[0.7rem]"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fillRule="evenodd"
|
||||||
|
d="M.366 19.708c.405.39 1.06.39 1.464 0l8.563-8.264a1.95 1.95 0 0 0 0-2.827L1.768.292A1.063 1.063 0 0 0 .314.282a.976.976 0 0 0-.011 1.425l7.894 7.617a.975.975 0 0 1 0 1.414L.366 18.295a.974.974 0 0 0 0 1.413"
|
||||||
|
// fill=""
|
||||||
|
className="color000000 svgShape fill-[#fff]"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const PaginatedList = ({ onClick, prev, next, data, start, stop }) => {
|
const PaginatedList = ({ onClick, prev, next, data, start, stop, borderTop=true }) => {
|
||||||
if (data?.length > process.env.REACT_APP_ITEM_PER_PAGE) {
|
if (data?.length > process.env.REACT_APP_ITEM_PER_PAGE) {
|
||||||
return (
|
return (
|
||||||
<div className="p-3 flex justify-center items-center min-h-[70px] space-x-2 border-t-2 w-full">
|
<div className={`p-3 flex justify-center items-center min-h-[70px] space-x-2 w-full ${borderTop ? 'border-t-2' : 'border-t-0'}`}>
|
||||||
{/* Render pagination buttons */}
|
{/* Render pagination buttons */}
|
||||||
{!prev && (
|
{!prev && (
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ export default function Layout({ children }) {
|
|||||||
<Header sidebarHandler={() => setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} />
|
<Header sidebarHandler={() => setMobileSidebar.toggle()} logoutModalHandler={logoutModalHandler} />
|
||||||
</div>
|
</div>
|
||||||
{/* container */}
|
{/* container */}
|
||||||
<div className="nft-container 2xl:space-x-8 h-full mb-12 lg:mt-[140px] mt-24 xl:mt-10 flex flex-col items-start justify-center xl:flex-row xl:justify-between gap-4">
|
<div className="nft-container h-full mb-12 lg:mt-[140px] mt-24 xl:mt-10 flex flex-col items-start justify-center 2xl:flex-row 2xl:justify-between gap-10">
|
||||||
<div className="flex-[80%] 2xl:flex-[85%] w-full">
|
<div className="w-full 2xl:w-[calc(100%-250px)]">
|
||||||
{children && children}
|
{children && children}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="nft-right-side-content flex-[20%] 2xl:flex-[15%] w-full h-full 2xl:flex justify-center 2xl:justify-end relative">
|
<div className="nft-right-side-content w-full 2xl:w-[200px] 2xl:flex justify-center 2xl:justify-end relative">
|
||||||
<RightSideBar myJobList={userJobList} />
|
<RightSideBar myJobList={userJobList} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export default function Sidebar({
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-sky-blue">Menu</h1>
|
<h1 className={`${!sidebar && 'text-center'} title text-xl font-bold text-sky-blue`}>Menu</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="items">
|
<div className="items">
|
||||||
<ul className="flex flex-col space-y-6">
|
<ul className="flex flex-col space-y-6">
|
||||||
@@ -141,11 +141,11 @@ export default function Sidebar({
|
|||||||
{userDetails?.account_type !== "FAMILY" && (
|
{userDetails?.account_type !== "FAMILY" && (
|
||||||
<div
|
<div
|
||||||
className={`menu-item transition-all duration-300 ease-in-out ${
|
className={`menu-item transition-all duration-300 ease-in-out ${
|
||||||
sidebar ? "my-5" : ""
|
sidebar ? "mb-5" : "mb-2"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-sky-blue">Family</h1>
|
<h1 className={`${!sidebar && 'text-center'} title text-xl font-bold text-sky-blue`}>Family</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="items">
|
<div className="items">
|
||||||
<ul className="flex flex-col space-y-6">
|
<ul className="flex flex-col space-y-6">
|
||||||
@@ -206,8 +206,8 @@ export default function Sidebar({
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="heading mb-5">
|
<div className="heading mb-5">
|
||||||
<h1 className="title text-xl font-bold text-sky-blue">
|
<h1 className={`${!sidebar && 'text-center'} title text-xl font-bold text-sky-blue`}>
|
||||||
My Jobs
|
Jobs
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="items">
|
<div className="items">
|
||||||
@@ -321,7 +321,7 @@ const ListItem = ({ sidebar, route, title, bubble, iconName, popup }) => {
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
className={`item-content relative group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray font-medium ${
|
className={`item-content relative group-hover:text-purple text-[18px] transition-all duration-300 ease-in-out text-lighter-gray font-medium ${
|
||||||
sidebar ? "active flex-1" : "w-0"
|
sidebar ? "active flex-1" : "hidden"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{title && title}
|
{title && title}
|
||||||
|
|||||||
Reference in New Issue
Block a user