Compare commits

...

44 Commits

Author SHA1 Message Date
victorAnumudu ef784dc6ed dob field added 2024-10-23 19:14:08 +01:00
ameye 682745c321 Merge branch 'virtual-card-month' of WrenchBoard/Users-Wrench into master 2024-10-23 12:44:24 +00:00
victorAnumudu c63fbfc147 month fixed 2024-10-23 12:34:24 +01:00
ameye 9b0f847bc1 Merge branch 'walletbox-bug' of WrenchBoard/Users-Wrench into master 2024-10-19 02:32:05 +00:00
victorAnumudu c073be1ce6 formattter function add 2024-10-19 03:21:57 +01:00
victorAnumudu f43e10a75f bug fixed 2024-10-19 03:12:26 +01:00
ameye eb41751628 Merge branch 'virtual-form-name' of WrenchBoard/Users-Wrench into master 2024-10-19 01:13:22 +00:00
victorAnumudu fa7a0bd1da name added to form 2024-10-18 18:03:57 +01:00
ameye 52ff30581f Merge branch 'virtual-form-update' of WrenchBoard/Users-Wrench into master 2024-10-17 20:13:51 +00:00
victorAnumudu 858bd7c0f7 virtual card form country and state added 2024-10-17 21:06:29 +01:00
victorAnumudu b995c36a8e virtual card form country and state added 2024-10-17 21:00:17 +01:00
ameye 2363bc3fd7 Merge branch 'add-virtual-card-form' of WrenchBoard/Users-Wrench into master 2024-10-16 18:32:28 +00:00
victorAnumudu ca375c4bae virtual card form added 2024-10-16 19:30:11 +01:00
ameye 3e6e3d3910 Merge branch 'wallet-balance-bg' of WrenchBoard/Users-Wrench into master 2024-10-16 11:01:58 +00:00
victorAnumudu 747abfc47b bg updated 2024-10-16 11:41:47 +01:00
ameye 520e74308d Merge branch 'virtaul-wallet-font-adjust' of WrenchBoard/Users-Wrench into master 2024-10-16 09:36:02 +00:00
victorAnumudu 36c7fdd30d adjusted font size 2024-10-16 03:51:58 +01:00
ameye 85269b9e56 Merge branch 'wallet-virtual-card' of WrenchBoard/Users-Wrench into master 2024-10-15 20:49:30 +00:00
victorAnumudu 95a918e01d add card dummy component added 2024-10-15 21:45:03 +01:00
ameye 3267414454 Merge branch 'wallet-payload-match' of WrenchBoard/Users-Wrench into master 2024-10-14 20:48:11 +00:00
victorAnumudu 85607d81b8 matched dev-users wallet API payload as same with app-dev 2024-10-14 21:34:06 +01:00
ameye 5a1ea91b77 Merge branch 'wallet-api-update' of WrenchBoard/Users-Wrench into master 2024-10-14 19:30:43 +00:00
victorAnumudu 40b5e92047 wallet API changed 2024-10-14 20:24:52 +01:00
ameye bc867ee8aa Merge branch 'nav-link-rename' of WrenchBoard/Users-Wrench into master 2024-10-12 01:24:59 +00:00
victorAnumudu 7c430d03bd nav link updated and view all message popout fixed 2024-10-10 16:58:39 +01:00
ameye 9125990d70 Merge branch 'change-pwd-update' of WrenchBoard/Users-Wrench into master 2024-10-10 00:42:28 +00:00
victorAnumudu e64728e127 padding adjusted 2024-10-10 01:35:13 +01:00
victorAnumudu d82b454caf headed added 2024-10-09 22:11:08 +01:00
victorAnumudu db423a3f1e change pwd page updated 2024-10-09 21:09:00 +01:00
ameye 4376938217 Merge branch 'currency-fix' of WrenchBoard/Users-Wrench into master 2024-10-09 17:15:48 +00:00
victorAnumudu 0411ab82f0 currency fixed 2024-10-09 17:56:54 +01:00
ameye c7d5d5533c Merge branch 'preferences-tab' of WrenchBoard/Users-Wrench into master 2024-10-09 14:55:18 +00:00
ameye 3f7c673087 Merge branch 'resources-pagination' of WrenchBoard/Users-Wrench into master 2024-10-09 14:55:13 +00:00
victorAnumudu da389c937e preference component added 2024-10-09 15:21:03 +01:00
victorAnumudu c71d901556 added pagination to resources page blog display 2024-10-09 09:44:11 +01:00
ameye 804f76100a Merge branch 'settings-page-update' of WrenchBoard/Users-Wrench into master 2024-10-08 21:27:10 +00:00
victorAnumudu 64f6e55fb6 currency code added 2024-10-08 20:09:56 +01:00
ameye 16119dc332 Merge branch 'recipient-account' of WrenchBoard/Users-Wrench into master 2024-10-08 16:10:52 +00:00
victorAnumudu ae08f392ca updated message for account with no recipient yet 2024-10-08 16:58:26 +01:00
ameye b646f020a5 Merge branch 'history-page-update' of WrenchBoard/Users-Wrench into master 2024-10-08 15:46:51 +00:00
victorAnumudu 31b411dcab table style updated 2024-10-08 16:40:41 +01:00
ameye 48d66d263e Merge branch 'managetask-style-update' of WrenchBoard/Users-Wrench into master 2024-10-07 11:57:15 +00:00
victorAnumudu 2a6900f6a9 style updated 2024-10-07 11:16:23 +01:00
ameye 8b3e1e8923 Merge branch 'min-due-time' of WrenchBoard/Users-Wrench into master 2024-10-04 10:52:37 +00:00
41 changed files with 1334 additions and 201 deletions
@@ -5,6 +5,7 @@ import FamilyAddFundPopout from './FamilyAddFundPopout'
function Wallet({wallet, familyData, setFamilyWalletReload}) {
const [addFundPopout, setAddFundPopout] = useState({ show: false, data: {} })
return (
<div className='w-full p-4 bg-[aliceblue] rounded-lg'
// style={{
@@ -14,7 +15,7 @@ function Wallet({wallet, familyData, setFamilyWalletReload}) {
<div className="w-full flex justify-start items-center gap-3">
<div className="min-w-[50px] min-h-[50px] max-w-min md:max-w-[80px] max-h-min md:max-h-[80px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
<img
src={localImgLoad(`images/currency/${(wallet.code).toLowerCase()}.svg`)}
src={wallet.icon}
className="w-full h-full"
alt="currency-icon"
/>
@@ -52,7 +53,7 @@ function Wallet({wallet, familyData, setFamilyWalletReload}) {
name="plan"
// onClick={onClose}
>
Plan Wallet
Add Card
</button>
</div>
</div>
@@ -28,7 +28,9 @@ export default function InputCom({
direction,
tabIndex,
error,
autoComplete="on"
autoComplete="on",
minDate='1900-01-01',
maxDate='2099-09-13'
}) {
const inputRef = useRef(null);
// Entry Validation
@@ -90,26 +92,51 @@ export default function InputCom({
: "text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] border"
}`}
>
<input
placeholder={placeholder}
value={value}
onChange={inputHandler}
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
type={type}
id={name}
name={name}
onInput={onInput}
minLength={minLengthValidation()}
maxLength={maxLengthValidation()}
tabIndex={tabIndex}
// pattern={inputPatterns()}
ref={inputRef}
readOnly={disable}
onBlur={blurHandler}
dir={direction}
autoComplete={autoComplete}
/>
<>
{type == 'date' ?
<input
placeholder={placeholder}
value={value}
onChange={inputHandler}
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
type={type}
id={name}
name={name}
onInput={onInput}
min={minDate}
max={maxDate}
tabIndex={tabIndex}
// pattern={inputPatterns()}
ref={inputRef}
readOnly={disable}
onBlur={blurHandler}
dir={direction}
autoComplete={autoComplete}
/>
:
<input
placeholder={placeholder}
value={value}
onChange={inputHandler}
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
type={type}
id={name}
name={name}
onInput={onInput}
minLength={minLengthValidation()}
maxLength={maxLengthValidation()}
tabIndex={tabIndex}
// pattern={inputPatterns()}
ref={inputRef}
readOnly={disable}
onBlur={blurHandler}
dir={direction}
autoComplete={autoComplete}
/>
}
</>
{iconName && (
<div className="absolute right-6 bottom-3 z-10 flex gap-2">
{iconName.split(" ").map((item, index) => (
+19
View File
@@ -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></>;
};
+5 -5
View File
@@ -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>
)
}
+11 -11
View File
@@ -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>
)
}
+1 -1
View File
@@ -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' &&
+1 -1
View File
@@ -53,7 +53,7 @@ export default function HomeActivities({ className }) {
return (
<div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl relative min-h-[520px] ${
className={`update-table w-full bg-white dark:bg-dark-white overflow-hidden rounded-2xl relative min-h-[520px] ${
className || ""
}`}
>
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from "react";
import usersService from "../../../services/UsersService";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import {PriceFormatter} from '../../Helpers/PriceFormatter'
export default function LockJob({
details,
@@ -19,8 +19,7 @@ export default function ActiveJobMessage({ activeJobMesList }) {
// }
return (
<div className='flex flex-col justify-between'>
<div className="w-full h-full min-h-[250px] max-h-[300px] overflow-y-auto">
<div className="w-full h-full max-h-[343px] overflow-y-auto">
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className='border-b-2'>
<tr className='text-slate-600'>
@@ -71,9 +70,10 @@ export default function ActiveJobMessage({ activeJobMesList }) {
</table>
</div>
{/* PAGINATION BUTTON */}
{/* <PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= activeJobMesList?.data?.length ? true : false} data={activeJobMesList?.data} start={indexOfFirstItem} stop={indexOfLastItem} /> */}
{/* END OF PAGINATION BUTTON */}
</div>
// <div className='flex flex-col justify-between'>
// PAGINATION BUTTON
// <PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= activeJobMesList?.data?.length ? true : false} data={activeJobMesList?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
// END OF PAGINATION BUTTON
// </div>
)
}
+33 -22
View File
@@ -12,7 +12,7 @@ import IndexJobActions from "./JobActions/IndexJobActions";
import usersService from "../../services/UsersService";
import { PriceFormatter } from "../Helpers/PriceFormatter";
import { SocketValues } from "../Contexts/SocketIOContext";
import TabButton from "../customTabs/TabButton";
import ManageJobTab from "../customTabs/ManageJobTab";
import AttachFile from "../attachmentCom/AttachFile";
import JobDetailPopout from "./JobDetailPopout";
@@ -390,8 +390,8 @@ function ActiveJobs(props) {
{/* end of job details */}
</div>
<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 mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
<div className="my-4 py-[20px] bg-white dark:bg-black px-4 rounded-2xl shadow-md grid grid-cols-1 lg:grid-cols-2 gap-3">
<div className="w-full mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
<div className="">
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
Actions
@@ -408,7 +408,7 @@ function ActiveJobs(props) {
{/* switch button */}
<div className="grid grid-cols-2">
{tabs.map((item) => (
<TabButton
<ManageJobTab
key={item}
item={item}
selectedTab={selectedTab}
@@ -545,14 +545,16 @@ function ActiveJobs(props) {
</div>
{/* MESSAGE SECTION */}
<div className="w-full lg:w-1/2">
<div className="mb-4">
<AttachFile
data={props.details}
showOnData={true}
fontSize={'text-lg'}
/>
</div>
<div className="w-full flex flex-col">
{props.details &&
<div className="mb-4">
<AttachFile
data={props.details}
showOnData={true}
fontSize={'text-lg'}
/>
</div>
}
<div className="flex justify-between items-center gap-5">
<p className="w-full text-lg font-bold text-dark-gray dark:text-white tracking-wide flex items-center gap-2 justify-between">
<span>Message</span>
@@ -671,37 +673,46 @@ const PopModal = ({
</svg>
</button>
</div>
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
<div className="w-full flex flex-col items-center">
<div className="job-action-modal-body w-full px-10 py-2 gap-4">
<div className="w-full">
{activeJobMesList.loading ? (
<LoadingSpinner size="16" color="sky-blue" />
) : (
<div className="message-table h-[500px] overflow-y-auto">
<table className="wallet-activity w-full table-auto border-collapse text-left">
<thead className="border-b-2">
{/* <thead className="border-b-0">
<tr className="text-slate-600">
<th className="p-2"></th>
<th className="p-0"></th>
</tr>
</thead>
</thead> */}
{activeJobMesList?.data?.length ? (
<tbody>
{activeJobMesList?.data?.map((item, index) => (
{activeJobMesList?.data?.map((item, index) => {
let imageLink = `${activeJobMesList?.image}${localStorage.getItem('session_token')}/contracts/${item.msg_uid}`
return (
<tr key={index} className="text-slate-500">
<td>
<div className="msg_box">
<div className={`msg_box ${item.who}`}>
<div className="msg_header">
{item.msg_date} {item.msg_firstname}
</div>
<span
{/* <span
className="p-2"
dangerouslySetInnerHTML={{
__html: item.message,
}}
></span>
></span> */}
{item.msg_type == 'FILE' ?
<a href={imageLink} target="_blank" className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></a>
:
<span className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></span>
}
</div>
</td>
</tr>
))}
)
})}
</tbody>
) : activeJobMesList.error ? (
<tbody>
@@ -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
+23 -20
View File
@@ -3,6 +3,7 @@ import background from "../../assets/images/bg-sky-blue.jpg";
import { localImgLoad } from "../../lib";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import FamilyWalletRedeemOptions from "./FamilyWalletRedeemOptions";
import {PriceFormatter} from '../Helpers/PriceFormatter'
/**
* Renders a list of wallet items or a loading spinner depending on the state of the `wallet` object.
@@ -20,7 +21,7 @@ export default function FamilyWalletBox({ wallet, payment }) {
const handleChangeWallet = ({ target: { name } }) => {
// FUNCTION TO SWITCH WALLET IF USER HAS MORE THAN TWO WALLETS
const currentWalletSelected = wallet?.data?.filter(
(item) => item.code == name
(item) => item.description == name
);
setSelectedWallet(currentWalletSelected[0]);
setActiveWalletBtn(name);
@@ -33,7 +34,7 @@ export default function FamilyWalletBox({ wallet, payment }) {
useEffect(() => {
setSelectedWallet(wallet.data[0]);
setActiveWalletBtn(wallet?.data[0]?.code);
setActiveWalletBtn(wallet?.data[0]?.description);
}, [wallet]);
return (
@@ -54,13 +55,13 @@ export default function FamilyWalletBox({ wallet, payment }) {
<>
{wallet?.data?.length > 1 && (
<div className="wal-selection px-5 py-2 text-black dark:text-white flex items-center gap-2">
{wallet?.data?.map((item) => (
{wallet?.data?.map((item, index) => (
<button
className={`py-0.5 px-1 mb-1 rounded-lg border border-orange-500 ${
activeWalletBtn == item?.code && "bg-orange-500"
activeWalletBtn == item?.description && "bg-orange-500"
}`}
key={item?.wallet_uid}
name={item?.code}
key={item?.wallet_uid+index}
name={item?.description}
onClick={handleChangeWallet}
>
{item?.description}
@@ -69,30 +70,32 @@ export default function FamilyWalletBox({ wallet, payment }) {
</div>
)}
<div
className="p-5 bg-white-opacity min-h-[240px]"
className="p-5 bg-white-opacity min-h-[240px] flex justify-end items-center"
style={{
background: `url(${background}) 0% 0% / cover no-repeat`,
background: `url(${selectedWallet?.banner}) 0% 0% / cover no-repeat`,
}}
>
{/* image */}
<div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[100px] max-h-min md:max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
{/* <div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[100px] max-h-min md:max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
<img
src={localImgLoad(`images/currency/${image}`)}
className="w-full h-full"
alt="currency-icon"
/>
</div> */}
<div className='flex flex-col justify-center'>
<p className="text-base sm:text-lg text-white tracking-wide my-3 text-center">
Current Balance
</p>
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
{PriceFormatter(
selectedWallet?.amount / 100,
selectedWallet?.code,
undefined,
"text-[2rem]"
)}
</p>
</div>
<p className="text-base sm:text-lg text-white opacity-[70%] tracking-wide my-3">
Current Balance
</p>
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
{Formatter(
selectedWallet?.amount / 100,
selectedWallet?.code,
undefined,
"text-[2rem]"
)}
</p>
</div>
</>
) : (
+2 -4
View File
@@ -1,9 +1,9 @@
import React, { Suspense, lazy, useEffect, useState } from "react";
import React, { useEffect, useState } from "react";
import { useSelector } from "react-redux";
import usersService from "../../services/UsersService";
import Layout from "../Partials/Layout";
import LoadingSpinner from "../Spinners/LoadingSpinner";
const WalletBox = lazy(() => import("./WalletBox"));
import WalletBox from "./WalletBox";
const WalletRoutes = () => {
const apiCall = new usersService();
@@ -62,13 +62,11 @@ const WalletRoutes = () => {
return (
<Layout>
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
<WalletBox
wallet={walletDetails}
payment={paymentHistory}
countries={allCountries.data}
/>
</Suspense>
</Layout>
);
};
+17 -10
View File
@@ -1,7 +1,7 @@
import { useSelector } from "react-redux";
import LoadingSpinner from "../Spinners/LoadingSpinner";
import WalletItemCard from "./WalletItemCard";
import WalletItemCardFamily from "./WalletItemCardFamily";
import WalletItemCardVirtual from './walletvirtual/WalletItemCardVirtual'
/**
* Renders a list of wallet items or a loading spinner depending on the state of the `wallet` object.
@@ -9,25 +9,32 @@ import WalletItemCardFamily from "./WalletItemCardFamily";
export default function WalletBox({ wallet, payment, countries }) {
const { loading, data } = wallet;
const { userDetails } = useSelector((state) => state.userDetails);
const accountType = userDetails?.account_type === "FAMILY";
// const { userDetails } = useSelector((state) => state.userDetails);
// const accountType = userDetails?.account_type === "FAMILY";
// console.log('mumu', data)
return (
<div className="my-wallet-wrapper w-full mb-10">
<div className="main-wrapper w-full">
<div className="balance-inquery w-auto grid md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] gap-5 mb-11 h-auto">
{/* xl:grid-cols[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] */}
{loading ? (
<div className="w-full h-full flex items-center justify-center">
<LoadingSpinner size="16" color="sky-blue" />
</div>
) : (
data.length > 0 && data.map((item) => (
<div key={item.wallet_uid} className="w-full md:max-w-[450px] h-full mb-10 lg:mb-0">
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
</div>
))
<div className="w-auto grid md:grid-cols-2 xxl:grid-cols-3 gap-4 md:gap-10">
{ data?.length > 0 && data.map((item, index) => (
<div key={item.wallet_uid+index} className="w-full h-full">
{item.country ?
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
:
<WalletItemCardVirtual walletItem={item} payment={payment} countries={countries} />
}
</div>
))}
</div>
)}
</div>
</div>
</div>
);
@@ -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.currency, item.amount)}</td>
<td className="p-4 text-right">{currencySymbol(item.currency, 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.currency, item.amount)}
<br />
{item.fee}
{currencySymbol(item.currency, item.fee)}
</td>
<td className="p-4">{item.status}</td>
</tr>
+1 -1
View File
@@ -67,7 +67,7 @@ export default function WalletHeader(props) {
<div className="sm:flex justify-between items-center">
<div className="account-name flex space-x-4 items-center mb-2 sm:mb-0">
<div className="icon w-14 h-14 transition duration-300 ease-in-out rounded-full flex justify-center items-center bg-light-purple dark:bg-dark-light-purple ">
<img src={localImgLoad(`images/currency/${image}`)} className="w-14 h-14" alt="" />
<img src={value.icon} className="w-14 h-14" alt="currency icon" />
</div>
<div className="name">
<p className="text-2xl font-bold text-dark-gray dark:text-white">
+36 -29
View File
@@ -1,6 +1,6 @@
import React, { useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import background from "../../assets/images/bg-sky-blue.jpg"; //shape/balance-bg.svg";
// import background from "../../assets/images/bg-sky-blue.jpg"; //shape/balance-bg.svg";
import localImgLoad from "../../lib/localImgLoad";
import { tableReload } from "../../store/TableReloads";
import { PriceFormatter } from "../Helpers/PriceFormatter";
@@ -44,25 +44,25 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
return (
<>
<div
className="current-balance-widget w-full h-full rounded-2xl overflow-hidden flex flex-col items-center gap-4 p-4 justify-between"
className="current-balance-widget w-full h-full min-h-[250px] rounded-2xl overflow-hidden flex flex-col items-center gap-4 p-4 justify-between bg-[#498FC3]"
style={{
background: `url(${background}) 0% 0% / cover no-repeat`,
background: `url(${walletItem?.banner}) 0% 0% / cover no-repeat`,
}}
>
<div className="wallet w-full flex justify-between items-start gap-3">
<div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[150px] max-h-min md:max-h-[150px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
<div className="wallet w-full">
{/* <div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[150px] max-h-min md:max-h-[150px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
<img
src={localImgLoad(`images/currency/${image}`)}
className="w-full h-full"
alt="currency-icon"
/>
</div>
<div className="balance w-full mt-2 flex justify-center">
<div className="">
<p className="text-base sm:text-lg text-white opacity-[70%] tracking-wide mb-2 sm:mb-6">
</div> */}
<div className="balance w-full mt-2 flex justify-end">
<div className="flex flex-col items-center">
<p className="text-base sm:text-lg text-white tracking-wide mb-2 sm:mb-6">
Current Balance
</p>
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10 xxs:scale-100 lg:scale-100 xl:scale-125">
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
{PriceFormatter(
walletItem.amount * 0.01,
walletItem.code,
@@ -73,26 +73,33 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
</div>
</div>
</div>
{walletItem.escrow > 0 ?
<div className='w-full flex justify-end'>
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
HOLDINGS :{" "}
<span className="">
{PriceFormatter(
walletItem.escrow * 0.01,
walletItem.code,
undefined,
"text-[1.5rem]"
)}
</span>
</p>
</div>
:
null
}
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
HOLDINGS :{" "}
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
{PriceFormatter(
walletItem.escrow * 0.01,
walletItem.code,
undefined,
"text-[1.5rem]"
)}
</span>
</p>
<div className="w-full h-[1px] bg-white"></div>
<WalletAction
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
payment={payment}
openPopUp={openPopUp}
/>
<div className='w-full'>
<div className="w-full h-[1px] mb-2 bg-white"></div>
<WalletAction
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
payment={payment}
openPopUp={openPopUp}
/>
</div>
</div>
{creditPopup.show && (
@@ -0,0 +1,590 @@
import { useEffect, useState } from "react";
import { Form, Formik } from "formik";
import * as Yup from "yup";
import { useSelector } from "react-redux";
import ModalCom from "../../Helpers/ModalCom";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import CustomTimer from "../../countdown/CustomTimer";
import InputCom from '../../Helpers/Inputs/InputCom'
import usersService from "../../../services/UsersService";
const validationSchema = Yup.object().shape({
country: Yup.string()
.required("Required"),
phone_number: Yup.string()
.min(9, "Min 9 characters")
.max(11, "Max 11 characters")
.required("Required"),
// birthYear: Yup.string()
// .required("Required"),
// birthMonth: Yup.string()
// .required("Required"),
// birthDay: Yup.string()
// .required("Required"),
address: Yup.string()
.min(5, "Min 3 characters")
.max(50, "Max 25 characters")
.required("Required"),
city: Yup.string()
.min(2, "Min 3 characters")
.max(25, "Max 25 characters")
.required("Required"),
state: Yup.string()
.required("Required"),
zipCode: Yup.string()
.min(1, "Min 3 characters")
.max(8, "Max 8 characters")
.required("Required"),
dob: Yup.string()
.required("Required"),
});
const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
const { userDetails } = useSelector((state) => state.userDetails);
const countryCode = userDetails?.country
const userApi = new usersService()
const [requestStatus, setRequestStatus] = useState({loading: false, status:false, message: ''})
const [allCountries, setAllCountries] = useState({loading: true, data: []}) // VARIABLE TO HOLD COUNTRY LIST
const [state, setState] = useState({loading: true, data: {}}) // VARIABLE TO HOLD STATE LIST
let initialValues = {
// initial values for formik
country: countryCode ? countryCode : '',
phone_number: '',
email: userDetails?.email,
firstname: userDetails?.firstname,
lastname: userDetails?.lastname,
birthYear: '',
birthMonth: '',
birthDay: '',
address: '',
city: userDetails?.city ? userDetails.city : '',
state: '',
zipCode: '',
dob: ''
};
const handleSubmit = (values) => {
// const reqData1 = {
// name: values.firstname + ' ' + values.firstname,
// email: values.email,
// phone_number: values.phone_number,
// status: 'active',
// type: 'individual',
// individual: {
// first_name: values.firstname,
// last_name: values.lastname,
// dob: {day: values.birthDay, month: values.birthMonth, year: values.birthYear}
// },
// billing:{
// address : {
// line1: values.address,
// city: values.city,
// state: values.state,
// postal_code: values.zipCode,
// country: values.country
// }
// }
// }
const reqData = {
request_type: '100',
address: values.address,
city: values.city,
state: values.state,
country: values.country,
postal_code: values.zipCode,
phone_number: values.phone_number,
// dob_day: values.birthDay,
// dob_month: values.birthMonth,
// dob_year: values.birthYear,
dob_day: Number(new Date(values.dob).getDate()),
dob_month: Number(new Date(values.dob).getMonth()) + 1,
dob_year: Number(new Date(values.dob).getFullYear()),
dob: values.dob
}
// console.log('Values', reqData)
setRequestStatus({loading: true, status:false, message: ''})
userApi.walletCardRequest(reqData).then(res => {
if(res?.data?.internal_return < 0){
setRequestStatus({loading: false, status:false, message: 'Failed, try again'})
setTimeout(()=>{
setRequestStatus({loading: false, status:true, message: ''})
},4000)
return
}
setRequestStatus({loading: false, status:true, message: 'Successful'})
setTimeout(()=>{
setRequestStatus({loading: false, status:true, message: ''})
onClose()
},4000)
}).catch(err => {
console.log('ERR', err)
setRequestStatus({loading: false, status:false, message: 'Unable to complete'})
setTimeout(()=>{
setRequestStatus({loading: false, status:false, message: ''})
},4000)
})
}
useEffect(()=>{
// Get Country Api
userApi.getSignupCountryData().then(res =>{
if(!res?.data?.result_list){
return setAllCountries({ loading: false, data: [] });
}
// if(countryCode){
// return setAllCountries({ loading: false, data: res?.data?.result_list?.filter(item => item?.code == countryCode) });
// }
setAllCountries({ loading: false, data: res?.data?.result_list });
}).catch(err => {
setAllCountries({ loading: false, data: [] });
console.log('err', err)
})
},[])
useEffect(()=>{
// GET STATE API
setState({loading: true, data: {}})
userApi.getStateFromCountry({country: countryCode}).then(res =>{
if(!res?.data?.country_state){
return setState({ loading: false, data: {} });
}
setState({ loading: false, data: res?.data?.country_state});
}).catch(err => {
setState({ loading: false, data: {} });
console.log('err', err)
})
},[initialValues.country])
return (
<ModalCom
action={onClose}
situation={situation}
>
<Formik
initialValues={initialValues}
validationSchema={validationSchema}
onSubmit={handleSubmit}
>
{(props) => (
<Form className="w-full overflow-y-auto">
<div className="logout-modal-wrapper mx-auto w-[90%] lg:w-[900px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
<div className="modal-header-con">
<h1 className="modal-title">
{walletItem?.description}
</h1>
<button
type="button"
className="modal-close-btn"
onClick={onClose}
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<div className="p-4 w-full grid lg:grid-cols-2 gap-4">
{/* left part */}
<div className='w-full flex flex-col gap-4'>
<h1 className='text-lg md:text-xl flex gap-1'><span className='font-bold'>Name:</span>{userDetails.lastname} {userDetails.firstname}</h1>
<div className="field w-full grid md:grid-cols-3 gap-4">
<div className="md:col-span-1 field w-full">
<label
htmlFor="country"
className="job-label job-label-flex"
>
<span>Country</span>
{props.errors.country && props.touched.country && (
<span className="text-[12px] text-red-500">
{props.errors.country}
</span>
)}
</label>
<select
id="country"
name="country"
value={props.values.country}
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
onChange={props.handleChange}
disabled={countryCode ? true : false}
>
{allCountries.loading ?
<option className="text-slate-500 text-lg" value="">
Loading...
</option>
: allCountries.data?.length > 0 ?
<>
<option className="text-slate-500 text-lg" value="">
Select Country
</option>
{allCountries.data?.map(item => (
<option key={item.uid} className="text-slate-500 text-lg" value={item.code}>
{item.country}
</option>
))}
</>
:
<option className="text-slate-500 text-lg" value="">
Not Found
</option>
}
</select>
</div>
<div className='md:col-span-2'>
<InputCom
fieldClass="px-6"
label="Phone Number"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="w-full input-curve lg border border-light-purple"
type="text"
name="phone_number"
value={props.values.phone_number}
inputHandler={props.handleChange}
error={(props.errors.phone_number && props.touched.phone_number) && props.errors.phone_number}
/>
</div>
</div>
<InputCom
disable={true}
fieldClass="px-6"
label="Email"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
type="text"
name="email"
value={props.values.email}
inputHandler={props.handleChange}
error={(props.errors.email && props.touched.email) && props.errors.email}
/>
<div className="hidden field w-full md:grid-cols-2 gap-4">
<InputCom
disable={true}
fieldClass="px-6"
label="Firstname"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
type="text"
name="firstname"
value={props.values.firstname}
inputHandler={props.handleChange}
error={(props.errors.firstname && props.touched.firstname) && props.errors.firstname}
/>
<InputCom
disable={true}
fieldClass="px-6"
label="Lastname"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
type="text"
name="lastname"
value={props.values.lastname}
inputHandler={props.handleChange}
error={(props.errors.lastname && props.touched.lastname) && props.errors.lastname}
/>
</div>
<div className="field w-full flex flex-col gap-4">
<p className='hidden job-label'>Date of Birth</p>
<div className='hidden xxs:grid-cols-3 gap-4'>
<div className="field w-full">
<label
htmlFor="birthDay"
className="job-label job-label-flex"
>
<span>Day</span>
{props.errors.birthDay && props.touched.birthDay && (
<span className="text-[12px] text-red-500">
{props.errors.birthDay}
</span>
)}
</label>
<select
id="birthDay"
name="birthDay"
value={props.values.birthDay}
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
onChange={props.handleChange}
>
<>
<option className="text-slate-500 text-lg" value=''>
select
</option>
{day.map(item => (
<option key={item} className="text-slate-500 text-lg" value={item}>
{item}
</option>
))}
</>
</select>
</div>
<div className="field w-full">
<label
htmlFor="birthMonth"
className="job-label job-label-flex"
>
<span>Month</span>
{props.errors.birthMonth && props.touched.birthMonth && (
<span className="text-[12px] text-red-500">
{props.errors.birthMonth}
</span>
)}
</label>
<select
id="birthMonth"
name="birthMonth"
value={props.values.birthMonth}
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
onChange={props.handleChange}
>
<>
<option className="text-slate-500 text-lg" value=''>
select
</option>
{month.map(item => (
<option key={item.value} className="text-slate-500 text-lg" value={item.value}>
{item.name}
</option>
))}
</>
</select>
</div>
<div className="field w-full">
<label
htmlFor="birthYear"
className="job-label job-label-flex"
>
<span>Year</span>
{props.errors.birthYear && props.touched.birthYear && (
<span className="text-[12px] text-red-500">
{props.errors.birthYear}
</span>
)}
</label>
<select
id="birthYear"
name="birthYear"
value={props.values.birthYear}
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
onChange={props.handleChange}
>
<>
<option className="text-slate-500 text-lg" value=''>
select
</option>
{year.map(item => (
<option key={item} className="text-slate-500 text-lg" value={item}>
{item}
</option>
))}
</>
</select>
</div>
</div>
<div className=''>
<InputCom
fieldClass="px-6"
label="Date of Birth"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
type="date"
name="dob"
value={props.values.dob}
inputHandler={props.handleChange}
error={(props.errors.dob && props.touched.dob) && props.errors.dob}
maxDate={year[0] + '-12-31'}
minDate={year[year?.length - 1] + '-01-01'}
/>
</div>
</div>
</div>
{/* right part */}
<div className='p-4 w-full flex flex-col gap-4 bg-blue-200 dark:bg-slate-900 rounded-2xl'>
<InputCom
fieldClass="px-6"
label="Address"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
type="text"
name="address"
value={props.values.address}
inputHandler={props.handleChange}
error={(props.errors.address && props.touched.address) && props.errors.address}
/>
<InputCom
fieldClass="px-6"
label="City"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
type="text"
name="city"
value={props.values.city}
inputHandler={props.handleChange}
error={(props.errors.city && props.touched.city) && props.errors.city}
/>
{/* <InputCom
fieldClass="px-6"
label="State/Province"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
type="text"
name="state"
value={props.values.state}
inputHandler={props.handleChange}
error={(props.errors.state && props.touched.state) && props.errors.state}
/> */}
<div className="field w-full grid md:grid-cols-2 gap-4">
<div className="field w-full">
<label
htmlFor="state"
className="job-label job-label-flex"
>
<span>State/Province</span>
{props.errors.state && props.touched.state && (
<span className="text-[12px] text-red-500">
{props.errors.state}
</span>
)}
</label>
<select
id="state"
name="state"
value={props.values.state}
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
onChange={props.handleChange}
>
{state.loading ?
<option className="text-slate-500 text-lg" value="">
Loading...
</option>
: Object.keys(state.data)?.length > 0 ?
<>
<option className="text-slate-500 text-lg" value="">
Select State
</option>
{Object.keys(state.data)?.map((item, index) => (
<option key={index} className="text-slate-500 text-lg" value={item}>
{state?.data[item]}
</option>
))}
</>
:
<option className="text-slate-500 text-lg" value="">
Not Found
</option>
}
</select>
</div>
<InputCom
fieldClass="px-6"
label="Zip Code"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
type="text"
name="zipCode"
value={props.values.zipCode}
inputHandler={props.handleChange}
error={(props.errors.zipCode && props.touched.zipCode) && props.errors.zipCode}
/>
</div>
</div>
</div>
{requestStatus.message &&
<div className='px-4 my-1'>
<p className={`text-center text-base py-1 font-bold ${requestStatus.status ? 'bg-emerald-600 text-white' : 'bg-red-100 text-red-600'}`}>{requestStatus.message}</p>
</div>
}
<div className="modal-footer-wrapper grid grid-cols-1 xxs:grid-cols-3">
<div className="w-full col-span-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center">
<button
type="button"
onClick={onClose}
className="custom-btn bg-[#f5a430] text-black text-base"
>
Cancel
</button>
<>
{requestStatus.loading ?
<LoadingSpinner size="6" color="sky-blue" />
:
<button
type="submit"
className="custom-btn btn-gradient text-base text-white"
disabled={requestStatus.loading || requestStatus.status}
>
Continue
</button>
}
</>
</div>
</div>
</div>
</Form>
)}
</Formik>
</ModalCom>
);
};
export default VirtualAddCardPopout;
const day = new Array(31).fill(0).map((_,i) => i+1 )
const month = [
{value: 1, name: 'January'},
{value: 2, name: 'February'},
{value: 3, name: 'March'},
{value: 4, name: 'April'},
{value: 5, name: 'May'},
{value: 6, name: 'June'},
{value: 7, name: 'July'},
{value: 8, name: 'August'},
{value: 9, name: 'September'},
{value: 10, name: 'October'},
{value: 11, name: 'November'},
{value: 12, name: 'December'},
]
const date = new Date().getFullYear()
const year = new Array(100).fill(0).map((_,i) => (date-2) - i+1 )
@@ -0,0 +1,23 @@
import React, { useEffect, useState } from "react";
import usersService from "../../../services/UsersService";
function WalletActionVirtual({ walletItem, openPopUp, btnText }) {
return (
<div className="counters w-full flex justify-end gap-2">
<div className="w-1/2 flex justify-end items-center">
<button
className="logout-btn btn-gradient text-white"
onClick={() => {
openPopUp(walletItem?.description, {walletItem});
}}
>
{btnText}
</button>
</div>
</div>
);
}
export default WalletActionVirtual;
@@ -0,0 +1,131 @@
import React, { useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import localImgLoad from "../../../lib/localImgLoad";
import { tableReload } from "../../../store/TableReloads";
import { PriceFormatter } from "../../Helpers/PriceFormatter";
import WalletActionVirtual from "./WalletActionVirtual";
import VirtualAddCardPopout from "./VirtualAddCardPopout";
import WrenchTokenPopout from './WrenchTokenPopout'
import WrenchPointPopout from './WrenchPointPopout'
/**
* Renders a card displaying information about a wallet item.
*/
export default function WalletItemCardVirtual({ walletItem, payment, countries }) {
const dispatch = useDispatch();
const [virtualPopup, setVirtualPopup] = useState({ name: '', data: {} });
/**
* Opens the credit popup.
* @param {Object} value - The value object.
*/
const openPopUp = (name, value) => {
setVirtualPopup({
name: name.toLowerCase(),
data: { ...value },
});
};
/**
* Closes the credit popup and dispatches a table reload action.
*/
const closePopUp = () => {
setVirtualPopup({ name: false, data: {} });
// dispatch(tableReload({ type: "WALLETTABLE" }));
};
const currentWalletCurrency = countries?.filter((country) => country.code === walletItem.country);
const image = walletItem.code
? `${walletItem.code.toLowerCase()}.svg`
: "default.png";
return (
<>
<div
className="current-balance-widget w-full h-full min-h-[250px] rounded-2xl overflow-hidden flex flex-col items-center gap-4 p-4 justify-between bg-[#498FC3]"
style={{
background: `url(${walletItem?.banner}) 0% 0% / cover no-repeat`,
}}
>
<div className="wallet w-full">
{/* <div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[150px] max-h-min md:max-h-[150px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
<img
src={localImgLoad(`images/currency/${image}`)}
className="w-full h-full"
alt="currency-icon"
/>
</div> */}
<div className="balance w-full mt-2 flex justify-end">
<div className="">
<p className="text-lg sm:text-2xl font-bold text-white tracking-wide mb-2 sm:mb-6">
{walletItem?.description}
</p>
{/* <p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10 xxs:scale-100 lg:scale-100 xl:scale-125">
{PriceFormatter(
walletItem.amount * 0.01,
walletItem.code,
undefined,
"text-[2rem]"
)}
</p> */}
</div>
</div>
</div>
{/* {walletItem.escrow > 0 ?
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
HOLDINGS :{" "}
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
{PriceFormatter(
walletItem.escrow * 0.01,
walletItem.code,
undefined,
"text-[1.5rem]"
)}
</span>
</p>
:
null
} */}
<div className='w-full'>
<div className="w-full h-[1px] mb-2 bg-white"></div>
<WalletActionVirtual
walletItem={walletItem}
openPopUp={openPopUp}
btnText={walletItem?.rt_action_text}
/>
</div>
</div>
{virtualPopup.name == 'add virtual debit card' && (
<VirtualAddCardPopout
details={virtualPopup.data}
walletItem={walletItem}
onClose={closePopUp}
situation={virtualPopup.name}
/>
)}
{virtualPopup.name == 'wrench token' && (
<WrenchTokenPopout
details={virtualPopup.data}
walletItem={walletItem}
onClose={closePopUp}
situation={virtualPopup.name}
/>
)}
{virtualPopup.name == 'wrench points' && (
<WrenchPointPopout
details={virtualPopup.data}
walletItem={walletItem}
onClose={closePopUp}
situation={virtualPopup.name}
/>
)}
</>
);
}
@@ -0,0 +1,88 @@
import { useState } from "react";
import ModalCom from "../../Helpers/ModalCom";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import CustomTimer from "../../countdown/CustomTimer";
const WrenchPointPopout = ({ details, onClose, situation, walletItem }) => {
const [input, setInput] = useState("");
return (
<ModalCom
action={onClose}
situation={situation}
>
<div className="logout-modal-wrapper w-[90%] md:w-[768px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="modal-header-con">
<h1 className="modal-title">
{walletItem?.description}
</h1>
<button
type="button"
className="modal-close-btn"
onClick={onClose}
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<div className="w-full h-[32rem]">
{/* <div className="h-[32rem] flex items-center justify-center">
<div className="h-[32rem] flex flex-col items-center justify-center gap-4">
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Processing payment</p>
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Please do not refresh</p>
<LoadingSpinner size="6" color="sky-blue" height='h-20' />
<CustomTimer className="text-lg text-center md:text-2xl text-emerald-600 tracking-wide font-bold" />
</div>
</div> */}
</div>
<div className="modal-footer-wrapper grid grid-cols-1 xxs:grid-cols-3">
<div className="w-full col-span-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center">
<button
type="button"
onClick={onClose}
className="custom-btn bg-[#f5a430] text-black text-base"
>
Cancel
</button>
<button
onClick={()=>{}}
className="custom-btn btn-gradient text-base text-white"
>
{/* {requestStatus.loading ? (
<LoadingSpinner size="6" color="sky-blue" />
) : completeNairaWithdraw.show ? (
"Okay"
) : completeNairaWithdraw?.state?.internal_return < 0 ? (
"Cancel"
) : (
"Transfer"
)} */}
Continue
</button>
</div>
</div>
</div>
</ModalCom>
);
};
export default WrenchPointPopout;
@@ -0,0 +1,88 @@
import { useState } from "react";
import ModalCom from "../../Helpers/ModalCom";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import CustomTimer from "../../countdown/CustomTimer";
const WrenchTokenPopout = ({ details, onClose, situation, walletItem }) => {
const [input, setInput] = useState("");
return (
<ModalCom
action={onClose}
situation={situation}
>
<div className="logout-modal-wrapper w-[90%] md:w-[768px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="modal-header-con">
<h1 className="modal-title">
{walletItem?.description}
</h1>
<button
type="button"
className="modal-close-btn"
onClick={onClose}
>
<svg
width="36"
height="36"
viewBox="0 0 36 36"
fill="none"
className="fill-current"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
fill=""
fillOpacity="0.6"
/>
<path
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
fill="#"
fillOpacity="0.6"
/>
</svg>
</button>
</div>
<div className="w-full h-[32rem]">
{/* <div className="h-[32rem] flex items-center justify-center">
<div className="h-[32rem] flex flex-col items-center justify-center gap-4">
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Processing payment</p>
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Please do not refresh</p>
<LoadingSpinner size="6" color="sky-blue" height='h-20' />
<CustomTimer className="text-lg text-center md:text-2xl text-emerald-600 tracking-wide font-bold" />
</div>
</div> */}
</div>
<div className="modal-footer-wrapper grid grid-cols-1 xxs:grid-cols-3">
<div className="w-full col-span-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center">
<button
type="button"
onClick={onClose}
className="custom-btn bg-[#f5a430] text-black text-base"
>
Cancel
</button>
<button
onClick={()=>{}}
className="custom-btn btn-gradient text-base text-white"
>
{/* {requestStatus.loading ? (
<LoadingSpinner size="6" color="sky-blue" />
) : completeNairaWithdraw.show ? (
"Okay"
) : completeNairaWithdraw?.state?.internal_return < 0 ? (
"Cancel"
) : (
"Transfer"
)} */}
Continue
</button>
</div>
</div>
</div>
</ModalCom>
);
};
export default WrenchTokenPopout;
+1 -1
View File
@@ -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">
+1 -1
View File
@@ -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">
+1 -1
View File
@@ -92,7 +92,7 @@ export default function MobileSidebar({
{/* Using mini component reduces the bulk amount of html */}
<ListItem
title={
userDetails?.account_type == "FULL" ? "Dashboard" : "Home"
userDetails?.account_type == "FULL" ? "Home" : "Home"
}
route="/"
sidebar={sidebar}
+1 -1
View File
@@ -112,7 +112,7 @@ export default function Sidebar({
<ul className="flex flex-col space-y-6">
{/* Using mini component reduces the bulk amount of html */}
<ListItem
title={userDetails?.account_type == "FULL" ? "Dashboard" : "Home"}
title={userDetails?.account_type == "FULL" ? "Home" : "Home"}
route="/"
sidebar={sidebar}
iconName="new-dashboard"
+38 -26
View File
@@ -2,9 +2,10 @@ import ProductCardStyleTwo from "../../Cards/ProductCardStyleTwo";
import DataIteration from "../../Helpers/DataIteration";
import SearchCom from "../../Helpers/SearchCom";
import ResourceBlogCard from "../../Cards/ResourceBlogCard";
import NewPaginatedList from '../../../components/Pagination/NewPaginatedList'
export default function BlogTab({ className, blogdata }) {
console.log("Blog data here>> ", blogdata);
// console.log("Blog data here>> ", blogdata);
// debugger;
return (
<>
@@ -15,33 +16,9 @@ export default function BlogTab({ className, blogdata }) {
<div className="sm:w-1/2 w-full sm:pr-20 pr-0 mb-5 sm:mb-0">
<SearchCom placeholder='Search Blog Items...' />
</div>
{/* filer-dropdown */}
<div className="flex-1 flex sm:justify-end">
{/* <div className="flex space-x-1 items-center">*/}
{/*<span className="text-18 text-thin-light-gray">*/}
{/* Recently Received*/}
{/*</span>*/}
{/* <span>*/}
{/* <svg*/}
{/* width="20"*/}
{/* height="10"*/}
{/* viewBox="0 0 13 6"*/}
{/* fill="none"*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* >*/}
{/* <path*/}
{/* opacity="0.7"*/}
{/* d="M12.4124 0.247421C12.3327 0.169022 12.2379 0.106794 12.1335 0.0643287C12.0291 0.0218632 11.917 0 11.8039 0C11.6908 0 11.5787 0.0218632 11.4743 0.0643287C11.3699 0.106794 11.2751 0.169022 11.1954 0.247421L7.27012 4.07837C7.19045 4.15677 7.09566 4.219 6.99122 4.26146C6.88678 4.30393 6.77476 4.32579 6.66162 4.32579C6.54848 4.32579 6.43646 4.30393 6.33202 4.26146C6.22758 4.219 6.13279 4.15677 6.05312 4.07837L2.12785 0.247421C2.04818 0.169022 1.95338 0.106794 1.84895 0.0643287C1.74451 0.0218632 1.63249 0 1.51935 0C1.40621 0 1.29419 0.0218632 1.18975 0.0643287C1.08531 0.106794 0.990517 0.169022 0.910844 0.247421C0.751218 0.404141 0.661621 0.616141 0.661621 0.837119C0.661621 1.0581 0.751218 1.2701 0.910844 1.42682L4.84468 5.26613C5.32677 5.73605 5.98027 6 6.66162 6C7.34297 6 7.99647 5.73605 8.47856 5.26613L12.4124 1.42682C12.572 1.2701 12.6616 1.0581 12.6616 0.837119C12.6616 0.616141 12.572 0.404141 12.4124 0.247421Z"*/}
{/* fill="#374557"*/}
{/* fillOpacity="0.6"*/}
{/* />*/}
{/* </svg>*/}
{/*</span>*/}
{/* </div>*/}
</div>
</div>
<div className="content-section w-full-width">
{/* <div className="content-section w-full-width">
<div className="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-[30px]">
<DataIteration
datas={blogdata?.blogdata}
@@ -57,7 +34,42 @@ export default function BlogTab({ className, blogdata }) {
)}
</DataIteration>
</div>
</div> */}
{blogdata?.blogdata?.length ?
<NewPaginatedList
data={blogdata?.blogdata}
itemsPerPage={9}
filterItem=''
tableTitle=''
>
{
({data})=>(
<div className="filter-navigate-content w-full min-h-[600px]">
<div
className={"grid lg:grid-cols-3 sm:grid-cols-2 gap-[30px]"}
>
{
data.map((datum, index) => (
<div key={index}>
<ResourceBlogCard
key={index}
datas={datum}
bg={blogdata.image_url}
/>
</div>
))
}
</div>
</div>
)
}
</NewPaginatedList>
:
<div className="w-full h-[40rem] bg-white dark:bg-dark-white flex justify-center items-center">
No Blog Found!
</div>
}
</div>
</div>
</>
@@ -2,7 +2,7 @@
import React, { useState } from "react";
import Icons from "../../Helpers/Icons";
import PasswordSvg from "../PasswordSvg";
// import PasswordSvg from "../PasswordSvg";
import LoadingSpinner from "../../Spinners/LoadingSpinner";
import usersService from "../../../services/UsersService";
import { useNavigate } from "react-router-dom";
@@ -113,14 +113,19 @@ export default function ChangePasswordTab() {
}
return (
<div className="changePasswordTab w-full">
<div className="w-full flex xxl:flex-row flex-col-reverse space-x-5 xxl:items-start">
<div className="flex-1 mb-10">
<div className="w-full">
<div className="content-heading w-full mb-8">
<h1 className="text-2xl font-extrabold text-black dark:text-white antialiased">
Reset Password
</h1>
</div>
<div className="w-full md:w-[calc(100%-100px)] md:ml-auto pb-10">
<div className="input-field mb-6">
<label
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">
@@ -202,7 +207,7 @@ export default function ChangePasswordTab() {
</div>
</div>
</div>
<div className="flex justify-center space-x-4 items-center">
<div className="flex w-full md:w-[calc(100%-128px)] md:ml-auto justify-between gap-4 items-center">
<button
type="button"
className="text-light-red text-18 tracking-wide border-b dark:border-[#5356fb29] border-light-red"
@@ -246,9 +251,9 @@ export default function ChangePasswordTab() {
))}
{/* End of error or success display */}
</div>
<div className="w-[440px] sm:flex hidden justify-end">
{/* <div className="w-[440px] sm:flex hidden justify-end">
<PasswordSvg />
</div>
</div> */}
</div>
</div>
);
@@ -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>
+2
View File
@@ -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
};
+4 -3
View File
@@ -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} />,
@@ -0,0 +1,23 @@
import React from 'react'
import Icons from '../Helpers/Icons'
export default function ManageJobTab({ item='', iconName='', selectedTab='', setSelectedTab=()=>{} }) {
return (
<button
className={`flex lg:space-x-4 space-x-2 hover:text-purple transition-all duration-300 ease-in-out items-center cursor-pointer mb-2 mr-6 lg:mr-0 float-left lg:float-none overflow-hidden ${
selectedTab === item ? "text-purple" : " text-thin-light-gray"
}`}
value={item}
name={item}
onClick={() => setSelectedTab(item)}
>
<div>
<Icons name={iconName} />
</div>
<div>
<p className="text-18 tracking-wide">{item[0]?.toUpperCase() + item?.slice(1)}</p>
</div>
</button>
)
}
@@ -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
View File
@@ -53,7 +53,7 @@
.job-action {
background-color: #4687ba;
border-radius: 15px;
padding: 3px;
padding: 10px;
}
.msg_box {
+4
View File
@@ -78,6 +78,9 @@ export const apiConst = {
WRENCHBOARD_START_JOBLIST: 11028,
WRENCHBOARD_ACCOUNT_DASHDATA: 11029,
WRENCHBOARD_COUNTRY_STATE: 649,
WRENCHBOARD_WALLET_CARD_REQUEST: 11080,
WRENCHBOARD_SEND_CONTACTUS: 11030,
WRENCHBOARD_ACCOUNT_SENDREFER: 11032,
WRENCHBOARD_ACCOUNT_REFERLINK: 11033,
@@ -109,6 +112,7 @@ export const apiConst = {
WRENCHBOARD_GETUSER_SETTINGS: 11059,
WRENCHBOARD_ACCOUNT_WALLETS: 11060,
WRENCHBOARD_WALLET: 11200,
WRENCHBOARD_ACCOUNT_TOPUP_RESULT: 11061,
WRENCHBOARD_ACCOUNT_PREPARE_TOPUP: 11062,
+29 -1
View File
@@ -125,8 +125,11 @@ class usersService {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: apiConst.WRENCHBOARD_WALLET,
limit: 20,
page: 1
};
return this.postAuxEnd("/getwallets", postData);
return this.postAuxEnd("/wallets", postData);
}
getApiGate() {
// localStorage.setItem("session_token", ``);
@@ -1533,6 +1536,31 @@ class usersService {
return this.postAuxEnd("/recentpastdue", postData);
}
//API TO GET STATES FROM COUNTRY
getStateFromCountry(reqData){
var postData = {
member_uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
action: apiConst.WRENCHBOARD_COUNTRY_STATE,
...reqData
};
return this.postAuxEnd("/countrystate", postData);
}
//API TO GET STATES FROM COUNTRY
walletCardRequest(reqData){
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
target_uid: localStorage.getItem("uid"),
action: apiConst.WRENCHBOARD_WALLET_CARD_REQUEST,
...reqData
};
return this.postAuxEnd("/wallets/card/request", postData);
}
/*
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)