Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da389c937e | |||
| 804f76100a | |||
| 64f6e55fb6 | |||
| 16119dc332 | |||
| ae08f392ca | |||
| b646f020a5 | |||
| 31b411dcab | |||
| 48d66d263e | |||
| 2a6900f6a9 | |||
| 8b3e1e8923 |
@@ -75,4 +75,23 @@ export const AmountTo2DP = (
|
||||
|
||||
// return formattedNumber;
|
||||
return formattedNumber;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// FUNCTION TO RETURN CURRENCY SYMBOL
|
||||
export const currencySymbol = (
|
||||
currencyName = "naira",
|
||||
amount = "00",
|
||||
) => {
|
||||
// Cureency Array
|
||||
let currencyArray = [
|
||||
{currencyName:'naira', symbol:'₦'},
|
||||
{currencyName:'usd', symbol:'$'},
|
||||
]
|
||||
|
||||
const matchedCurrency = currencyArray.filter(item => item.currencyName.toLocaleLowerCase() == currencyName.toLocaleLowerCase())
|
||||
const amountTo2DP = AmountTo2DP(amount)
|
||||
// return formattedNumber;
|
||||
return matchedCurrency.length ? <><span>{matchedCurrency[0].symbol}</span><span>{amountTo2DP}</span></> : <><span>$</span><span>{amountTo2DP}</span></>;
|
||||
};
|
||||
@@ -7,7 +7,8 @@ import PaginatedList from '../../components/Pagination/PaginatedList';
|
||||
|
||||
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
||||
|
||||
import { AmountTo2DP } from '../Helpers/PriceFormatter';
|
||||
import { currencySymbol } from '../Helpers/PriceFormatter';
|
||||
import {NewDateTimeFormatter} from '../../lib/NewDateTimeFormatter'
|
||||
|
||||
function JobsCompleted() {
|
||||
|
||||
@@ -47,7 +48,7 @@ function JobsCompleted() {
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
|
||||
<div className='py-4 flex flex-col justify-between min-h-[500px]'>
|
||||
{jobHistory?.loading ?
|
||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||
: jobHistory?.data?.length ?
|
||||
@@ -71,12 +72,11 @@ function JobsCompleted() {
|
||||
<div className='flex flex-col'>
|
||||
<h1 className='text-lg font-bold line-clamp-1'>{item?.title}</h1>
|
||||
<p className='text-sm line-clamp-2'>{item?.description}</p>
|
||||
<p className='text-sm line-clamp-2'>{NewDateTimeFormatter(item?.delivery_date)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="p-4 text-right">{AmountTo2DP(item?.price*0.01)} {item?.currency}</td>
|
||||
{/* <td className="p-4">{date}</td>
|
||||
<td className="p-4">{item?.contract}</td> */}
|
||||
<td className="p-4 flex text-right justify-end items-center">{currencySymbol(item?.currency_code, item?.price*0.01)}</td>
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import PaginatedList from '../../components/Pagination/PaginatedList';
|
||||
|
||||
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
||||
|
||||
import { AmountTo2DP } from '../Helpers/PriceFormatter';
|
||||
import { currencySymbol } from '../Helpers/PriceFormatter';
|
||||
|
||||
|
||||
export const RewardsTable = memo(() => {
|
||||
@@ -47,7 +47,7 @@ export const RewardsTable = memo(() => {
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
|
||||
<div className='py-4 flex flex-col justify-between min-h-[500px] w-full overflow-x-auto'>
|
||||
{familyRewardHistory.loading ?
|
||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||
: familyRewardHistory.data.length ?
|
||||
@@ -55,9 +55,9 @@ export const RewardsTable = memo(() => {
|
||||
<thead className='w-full'>
|
||||
<tr className='text-slate-600 dark:text-white'>
|
||||
<th className="p-4"></th>
|
||||
<th className="p-4 text-right">Amount</th>
|
||||
<th className="p-4">Date</th>
|
||||
<th className="p-4">Confirmation</th>
|
||||
<th className="p-4 text-center">Amount</th>
|
||||
<th className="p-4 text-center">Date</th>
|
||||
<th className="p-4 text-center">Confirmation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -65,18 +65,18 @@ export const RewardsTable = memo(() => {
|
||||
let date = new Date(item.added).toLocaleDateString()
|
||||
return (
|
||||
<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-4">
|
||||
<div className='flex items-center gap-2'>
|
||||
<td className="p-4 min-w-[300px]">
|
||||
<div className='flex w-full 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' />
|
||||
<div className='flex flex-col'>
|
||||
<div className='flex flex-col w-full'>
|
||||
<h1 className='text-lg font-bold'>Reward to {item.rec_firstname} {item.rec_lastname}</h1>
|
||||
<p className='text-sm'>{item.description}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="p-4 text-right">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
|
||||
<td className="p-4">{date}</td>
|
||||
<td className="p-4">{item.confirmation}</td>
|
||||
<td className="p-4 text-right flex-nowrap">{currencySymbol(item.currency, item.amount*0.01)}</td>
|
||||
<td className="p-4 text-center">{date}</td>
|
||||
<td className="p-4 text-center">{item.confirmation}</td>
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ export default function History() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-[1px] bg-[#E3E4FE] dark:bg-[#a7a9b533] mr-10"></div>
|
||||
<div className="flex-1 overflow-y-auto min-h-[520px]">
|
||||
<div className="w-full overflow-y-auto min-h-[520px]">
|
||||
<>
|
||||
{/* PURCHASE SECTION */}
|
||||
{selectedTab == 'purchases' &&
|
||||
|
||||
@@ -6,11 +6,13 @@ import LoadingSpinner from '../../Spinners/LoadingSpinner'
|
||||
|
||||
import usersService from '../../../services/UsersService'
|
||||
|
||||
import {NewDateTimeFormatter }from '../../../lib/NewDateTimeFormatter'
|
||||
|
||||
function CurrentTaskAction({jobDetails}) {
|
||||
|
||||
const currTime = new Date().getTime() / (1000*60*60)
|
||||
const minDueTime = new Date(jobDetails?.minimum_due).getTime() / (1000*60*60)
|
||||
const canSendForReview = jobDetails.strict_timeline ? currTime >= minDueTime : true // calculation to determine when send for review button will be active
|
||||
const canSendForReview = Number(jobDetails.strict_timeline) ? currTime >= minDueTime : true // calculation to determine when send for review button will be active
|
||||
|
||||
const apiCall = new usersService()
|
||||
const navigate = useNavigate()
|
||||
@@ -69,7 +71,7 @@ function CurrentTaskAction({jobDetails}) {
|
||||
<div className="h-full w-full text-sm text-left text-gray-500">
|
||||
{jobDetails.job_type == 'MEDIA' ?
|
||||
<div className="h-full flex justify-center items-center">
|
||||
<button onClick={popUpHandler} type="button" className="btn-gradient h-full text-white p-1 lg:p-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl">
|
||||
<button onClick={popUpHandler} type="button" className="btn-gradient h-full text-white px-5 py-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl">
|
||||
I have completed this task
|
||||
</button>
|
||||
</div>
|
||||
@@ -82,7 +84,7 @@ function CurrentTaskAction({jobDetails}) {
|
||||
</div>
|
||||
|
||||
<div className="flex justify-center items-center">
|
||||
<button onClick={popUpHandler} type="button" className="custom-btn btn-gradient text-white">
|
||||
<button onClick={popUpHandler} type="button" className="custom-btn btn-gradient px-5 py-2 text-white">
|
||||
Send for Review
|
||||
</button>
|
||||
</div>
|
||||
@@ -124,7 +126,18 @@ function CurrentTaskAction({jobDetails}) {
|
||||
</button>
|
||||
</div>
|
||||
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
|
||||
<div className="w-full flex flex-col gap-8 items-center">
|
||||
<div className="w-full flex flex-col min-h-[150px] gap-8 items-center">
|
||||
{!canSendForReview ?
|
||||
<>
|
||||
<h1
|
||||
// className='font-bold text-base tracking-wide text-dark-gray dark:text-white'
|
||||
className='font-bold text-xl tracking-wide text-red-500 text-center'
|
||||
>
|
||||
This task can be marked completed after {NewDateTimeFormatter(jobDetails?.minimum_due)}
|
||||
</h1>
|
||||
|
||||
</>
|
||||
:
|
||||
<>
|
||||
<div className="flex justify-center items-center gap-2">
|
||||
<input
|
||||
@@ -132,7 +145,6 @@ function CurrentTaskAction({jobDetails}) {
|
||||
checked={checked}
|
||||
onChange={()=>{setChecked(prev => !prev)}}
|
||||
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
|
||||
disabled={!canSendForReview}
|
||||
/>
|
||||
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>If you have completed this task</p>
|
||||
</div>
|
||||
@@ -163,18 +175,8 @@ function CurrentTaskAction({jobDetails}) {
|
||||
}
|
||||
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
|
||||
|
||||
{!canSendForReview &&
|
||||
<>
|
||||
<h1
|
||||
// className='font-bold text-base tracking-wide text-dark-gray dark:text-white'
|
||||
className='font-bold text-xl tracking-wide text-red-500 text-center'
|
||||
>
|
||||
This task requires you use about 80% of the time allocated
|
||||
</h1>
|
||||
|
||||
</>
|
||||
}
|
||||
</>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
{/* cancel btn */}
|
||||
|
||||
@@ -121,7 +121,7 @@ function PastDueJobAction({jobDetails}) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={popUpHandler}
|
||||
className="custom-btn btn-gradient text-base text-white"
|
||||
className="custom-btn btn-gradient px-5 py-2 text-base text-white"
|
||||
>
|
||||
Cancel or Extend Timeline
|
||||
</button>
|
||||
|
||||
@@ -129,7 +129,7 @@ function PastDueTaskAction({jobDetails}) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={popUpHandler}
|
||||
className="custom-btn btn-gradient text-base text-white"
|
||||
className="custom-btn btn-gradient px-5 py-2 text-base text-white"
|
||||
>
|
||||
Request Extension
|
||||
</button>
|
||||
|
||||
@@ -36,7 +36,21 @@ export default function JobDetailPopout({action, situation, jobDetail}) {
|
||||
</button>
|
||||
</div>
|
||||
<div className="modal-body-wrapper">
|
||||
<p className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'>{jobDetail}</p>
|
||||
{/* <p className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'>{jobDetail}</p> */}
|
||||
{/* <div
|
||||
className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'
|
||||
dangerouslySetInnerHTML={{__html: jobDetail}}
|
||||
>
|
||||
</div> */}
|
||||
<textarea
|
||||
id="Job Delivery Details"
|
||||
readOnly
|
||||
// rows="5"
|
||||
className={`w-full h-full overflow-y-auto text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white`}
|
||||
style={{ resize: "none" }}
|
||||
name="job_detail"
|
||||
value={jobDetail}
|
||||
/>
|
||||
</div>
|
||||
<div className="modal-footer-wrapper justify-end">
|
||||
<button
|
||||
|
||||
@@ -3,6 +3,8 @@ import React, {useState} from 'react'
|
||||
import PaginatedList from '../../Pagination/PaginatedList';
|
||||
import { handlePagingFunc } from '../../Pagination/HandlePagination';
|
||||
|
||||
import { currencySymbol } from '../../Helpers/PriceFormatter';
|
||||
|
||||
function PurchasesTable({purchase}) {
|
||||
|
||||
const [currentPage, setCurrentPage] = useState(0);
|
||||
@@ -15,7 +17,7 @@ function PurchasesTable({purchase}) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
|
||||
<div className='py-4 flex flex-col justify-between min-h-[500px]'>
|
||||
{purchase.data.length ?
|
||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||
<thead className='w-full'>
|
||||
@@ -31,8 +33,8 @@ function PurchasesTable({purchase}) {
|
||||
<td className="p-4">{item.added_date}<br />
|
||||
<b>{item.confirmation} </b>
|
||||
</td>
|
||||
<td className="p-4 text-right">{item.amount}</td>
|
||||
<td className="p-4 text-right">{item.fee}</td>
|
||||
<td className="p-4 text-right">{currencySymbol('', item.amount)}</td>
|
||||
<td className="p-4 text-right">{currencySymbol('', item.fee)}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
|
||||
@@ -3,6 +3,8 @@ import React, { useState } from "react";
|
||||
import PaginatedList from "../../Pagination/PaginatedList";
|
||||
import { handlePagingFunc } from "../../Pagination/HandlePagination";
|
||||
|
||||
import { currencySymbol } from '../../Helpers/PriceFormatter';
|
||||
|
||||
function RecentActivityTable({ payment }) {
|
||||
const [currentPage, setCurrentPage] = useState(0);
|
||||
const indexOfFirstItem = Number(currentPage);
|
||||
@@ -18,7 +20,7 @@ function RecentActivityTable({ payment }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="p-4 flex flex-col justify-between min-h-[500px]">
|
||||
<div className="py-4 flex flex-col justify-between min-h-[500px]">
|
||||
{payment?.data?.length > 0 ?
|
||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||
<thead className="w-full">
|
||||
@@ -38,9 +40,9 @@ function RecentActivityTable({ payment }) {
|
||||
dangerouslySetInnerHTML={{ __html: item.recipient }}
|
||||
></td>
|
||||
<td className="p-4 text-right">
|
||||
{item.amount}
|
||||
{currencySymbol('', item.amount)}
|
||||
<br />
|
||||
{item.fee}
|
||||
{currencySymbol('', item.fee)}
|
||||
</td>
|
||||
<td className="p-4">{item.status}</td>
|
||||
</tr>
|
||||
|
||||
@@ -413,7 +413,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
||||
</div>
|
||||
</Link>
|
||||
</li>
|
||||
{userDetails && userDetails?.account_type !== "FAMILY" && (
|
||||
{(userDetails && userDetails?.account_type !== "FAMILY" && Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1) && (
|
||||
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
|
||||
<Link to="/yourpage" className="notifications">
|
||||
<div className="name">
|
||||
|
||||
@@ -457,7 +457,7 @@ export default function MediaHeader({ logoutModalHandler, sidebarHandler, backpa
|
||||
</div>
|
||||
</Link>
|
||||
</li>
|
||||
{userDetails && userDetails?.account_type !== "FAMILY" && (
|
||||
{(userDetails && userDetails?.account_type !== "FAMILY" && Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1) && (
|
||||
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
|
||||
<Link to="/yourpage" className="notifications">
|
||||
<div className="name">
|
||||
|
||||
@@ -120,7 +120,7 @@ export default function ChangePasswordTab() {
|
||||
className="input-label text-dark-gray dark:text-white text-xl font-bold block mb-2.5"
|
||||
htmlFor="old_password"
|
||||
>
|
||||
Old Password <span className="text-[10px] text-red-500 italic px-2">{(inputEmpty && !inputs.old_pwd) && 'required'}</span>
|
||||
Current Password <span className="text-[10px] text-red-500 italic px-2">{(inputEmpty && !inputs.old_pwd) && 'required'}</span>
|
||||
</label>
|
||||
<div className="input-wrapper border border-light-purple dark:border-[#5356fb29] w-full rounded-[50px] h-[58px] overflow-hidden relative ">
|
||||
<div className="absolute left-6 bottom-[17px] z-10">
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import React from "react";
|
||||
import Icons from "../../Helpers/Icons";
|
||||
|
||||
export default function Preferences() {
|
||||
return (
|
||||
<div className="login-activity-tab w-full">
|
||||
<div className="relative w-full overflow-x-auto sm:rounded-lg">
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
{/* <thead>
|
||||
<tr className="text-base text-thin-light-gray border-b dark:border-[#5356fb29] default-border-b ">
|
||||
<td className="py-4 text-center">Channel</td>
|
||||
<td className="py-4 text-center">Date</td>
|
||||
<td className="py-4 text-center">Location</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||
<td className="text-center py-4">
|
||||
<div className="flex items-center justify-center">
|
||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||
Desktop
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="text-center py-4">
|
||||
<div className="flex space-x-1 items-center justify-center">
|
||||
<span className="text-base text-dark-gray dark:text-white font-medium whitespace-nowrap px-2">
|
||||
10-10-2035
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="text-center py-4">
|
||||
<span className="text-base text-dark-gray dark:text-white whitespace-nowrap px-2">
|
||||
10.0.0.1000
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody> */}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export default function RecipientAccountTab({
|
||||
})
|
||||
) : (
|
||||
<h1 className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
No Cards Found
|
||||
No Recipient on this account yet.
|
||||
</h1>
|
||||
)}
|
||||
</ul>
|
||||
|
||||
@@ -7,6 +7,7 @@ import PersonalInfoTab from "./PersonalInfoTab";
|
||||
import PrivacyPolicyTab from "./PrivacyPolicyTab";
|
||||
import RecentActivitiesTab from "./RecentActivitiesTab";
|
||||
import TermsConditionTab from "./TermsConditionTab";
|
||||
import Preferences from './Preferences'
|
||||
|
||||
export {
|
||||
ChangePasswordTab,
|
||||
@@ -18,4 +19,5 @@ export {
|
||||
PrivacyPolicyTab,
|
||||
RecentActivitiesTab,
|
||||
TermsConditionTab,
|
||||
Preferences
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
PrivacyPolicyTab,
|
||||
RecentActivitiesTab,
|
||||
TermsConditionTab,
|
||||
Preferences,
|
||||
} from "./Tabs";
|
||||
import RecipientAccountTab from "./Tabs/RecipientAccountTab";
|
||||
|
||||
@@ -91,8 +92,8 @@ export default function Settings({ faq }) {
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: "login_activity",
|
||||
title: "Login Activity",
|
||||
name: "preferences",
|
||||
title: "Preferences",
|
||||
iconName: "login-activity",
|
||||
},
|
||||
{
|
||||
@@ -166,7 +167,7 @@ export default function Settings({ faq }) {
|
||||
<NotificationSettingTab />
|
||||
</div>
|
||||
),
|
||||
login_activity: <LoginActivityTab />,
|
||||
preferences: <Preferences />,
|
||||
recent_activities: <RecentActivitiesTab />,
|
||||
password: <ChangePasswordTab />,
|
||||
faq: <FaqTab datas={faq} />,
|
||||
|
||||
@@ -5,6 +5,7 @@ import usersService from "../../services/UsersService";
|
||||
import ModalCom from "../Helpers/ModalCom";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import Detail from "./popoutcomponent/Detail";
|
||||
import {PriceFormatter} from '../Helpers/PriceFormatter'
|
||||
|
||||
import { useDispatch } from "react-redux";
|
||||
import { NewDateTimeFormatter } from "../../lib/NewDateTimeFormatter";
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@
|
||||
.job-action {
|
||||
background-color: #4687ba;
|
||||
border-radius: 15px;
|
||||
padding: 3px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.msg_box {
|
||||
|
||||
Reference in New Issue
Block a user