Compare commits

..

1 Commits

Author SHA1 Message Date
victorAnumudu 497407112c unused code cleaned 2023-06-12 14:10:26 +01:00
6 changed files with 12 additions and 77 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ export default function FamilyTable({ className, familyList, loader, popUpHandle
return ( return (
<div <div
className={`update-table w-full h-full p-8 bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow min-h-[520px] ${ className={`update-table w-full h-full p-8 bg-white dark:bg-dark-white overflow-y-auto rounded-2xl section-shadow ${
className || "" className || ""
}`} }`}
> >
@@ -28,7 +28,7 @@ export default function MyActiveJobTable({ MyJobList, className }) {
return ( return (
<div <div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${ className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
className || "" className || ""
}`} }`}
> >
@@ -45,7 +45,7 @@ export default function MyActiveJobTable({ MyJobList, className }) {
<> <>
{MyJobList && {MyJobList &&
MyJobList?.result_list && MyJobList?.result_list &&
MyJobList.result_list.length > 0 ? MyJobList.result_list.length > 0 &&
currentActiveJobList.map((value, index) => ( currentActiveJobList.map((value, index) => (
<tr <tr
key={index} key={index}
@@ -112,14 +112,7 @@ export default function MyActiveJobTable({ MyJobList, className }) {
</div> </div>
</td> </td>
</tr> </tr>
)) ))}
:
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<td className="p-2">
No Active Task!
</td>
</tr>
}
</> </>
} }
</tbody> </tbody>
+3 -10
View File
@@ -70,7 +70,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
return ( return (
<div <div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${ className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
className || "" className || ""
}`} }`}
> >
@@ -102,7 +102,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
<> <>
{MyJobList && {MyJobList &&
MyJobList?.data?.result_list && MyJobList?.data?.result_list &&
MyJobList.data?.result_list.length > 0 ? MyJobList.data?.result_list.length > 0 &&
currentJobList.map((value, index) => ( currentJobList.map((value, index) => (
<tr <tr
key={index} key={index}
@@ -181,14 +181,7 @@ export default function MyJobTable({ MyJobList, reloadJobList, className }) {
</button> </button>
</td> </td>
</tr> </tr>
)) ))}
:
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<td className="p-2">
No Jobs Avaliable!
</td>
</tr>
}
</> </>
) : selectedCategory === "Explore" ? ( ) : selectedCategory === "Explore" ? (
<></> <></>
@@ -25,7 +25,7 @@ export default function MyPendingJobTable({ MyJobList, className }) {
return ( return (
<div <div
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] ${ className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ${
className || "" className || ""
}`} }`}
> >
@@ -42,7 +42,7 @@ export default function MyPendingJobTable({ MyJobList, className }) {
<> <>
{MyJobList && {MyJobList &&
MyJobList?.result_list && MyJobList?.result_list &&
MyJobList.result_list.length > 0 ? MyJobList.result_list.length > 0 &&
currentActiveJobList.map((value, index) => ( currentActiveJobList.map((value, index) => (
<tr <tr
key={index} key={index}
@@ -105,14 +105,7 @@ export default function MyPendingJobTable({ MyJobList, className }) {
</button> </button>
</td> </td>
</tr> </tr>
)) ))}
:
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
<td className="p-2">
No Pending Task!
</td>
</tr>
}
</> </>
} }
</tbody> </tbody>
+1 -1
View File
@@ -22,7 +22,7 @@ function Balance({wallet, coupon}) {
<div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'> <div className='w-full lg:flex xl:space-x-8 lg:space-x-4 bottomMargin'>
{/* WALLET SECTION */} {/* WALLET SECTION */}
<div className="lg:w-4/4 w-full mb-10 lg:mb-0"> <div className="lg:w-4/4 w-full mb-10 lg:mb-0">
<div className="wallet w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white rounded-2xl shadow min-h-[520px]"> <div className="wallet w-full md:p-8 p-4 h-full bg-white dark:bg-dark-white rounded-2xl shadow">
<div className='flex items-baseline justify-between'> <div className='flex items-baseline justify-between'>
{/*<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Wallet</h2>*/} {/*<h2 className='text-slate-900 dark:text-white text-xl lg:text-2xl font-medium'>Wallet</h2>*/}
{/*<p className='text-base text-slate-500 dark:text-white'>Add New Wallet</p>*/} {/*<p className='text-base text-slate-500 dark:text-white'>Add New Wallet</p>*/}
+1 -45
View File
@@ -20,9 +20,6 @@ function Wallet() {
} }
const WalletRoutes = () => { const WalletRoutes = () => {
const apiCall = new usersService() const apiCall = new usersService()
@@ -38,18 +35,6 @@ const WalletRoutes = () => {
error: false error: false
}) })
let [purchaseHistory, setPurchaseHistory] = useState({ // FOR PURCHASE HISTORY
loading: true,
data: [],
error: false
})
let [couponHistory, setCouponHistory] = useState({ // FOR COUPON HISTORY
loading: true,
data: [],
error: false
})
//FUNCTION TO GET WALLET LIST //FUNCTION TO GET WALLET LIST
const getWalletList = ()=>{ const getWalletList = ()=>{
apiCall.getUserWallets(null).then((res)=>{ apiCall.getUserWallets(null).then((res)=>{
@@ -76,38 +61,9 @@ const WalletRoutes = () => {
}) })
} }
//FUNCTION TO GET PURCHASE HISTORY
const getPurchaseHistory = ()=>{
apiCall.getPurchaseHx().then((res)=>{
if(res.data.internal_return < 0){ // success but no data
setPurchaseHistory(prev => ({...prev, loading: false}))
return
}
// console.log('purchase',res.data)
setPurchaseHistory(prev => ({...prev, loading: false, data: res.data.result_list}))
}).catch((error)=>{
setPurchaseHistory(prev => ({...prev, loading: false, error: true}))
})
}
//FUNCTION TO GET COUPON HISTORY
const getCouponHistory = ()=>{
apiCall.getCouponHx().then((res)=>{
if(res.data.internal_return < 0){ // success but no data
setCouponHistory(prev => ({...prev, loading: false}))
return
}
setCouponHistory(prev => ({...prev, loading: false, data: res.data.result_list}))
}).catch((error)=>{
setCouponHistory(prev => ({...prev, loading: false, error: true}))
})
}
useEffect(()=>{ useEffect(()=>{
getWalletList() getWalletList()
getPaymentHistory() getPaymentHistory()
getPurchaseHistory()
getCouponHistory()
}, []) }, [])
return ( return (
<Routes> <Routes>
@@ -115,7 +71,7 @@ const WalletRoutes = () => {
<Route path='add-fund' element={<AddFund payment={paymentHistory} />} /> <Route path='add-fund' element={<AddFund payment={paymentHistory} />} />
<Route path='add-fund/confirm-add-fund' element={<ConfirmAddFund payment={paymentHistory} />} /> <Route path='add-fund/confirm-add-fund' element={<ConfirmAddFund payment={paymentHistory} />} />
<Route path='transfer-fund' element={<TransferFund payment={paymentHistory} wallet={walletList} />} /> <Route path='transfer-fund' element={<TransferFund payment={paymentHistory} wallet={walletList} />} />
<Route index element={<Balance coupon={couponHistory} wallet={walletList} />} /> <Route index element={<Balance wallet={walletList} />} />
<Route path='transfer-fund/add-recipient' element={<AddRecipient />} /> <Route path='transfer-fund/add-recipient' element={<AddRecipient />} />
<Route path='transfer-fund/confirm-transfer' element={<ConfirmTransfer payment={paymentHistory} wallet={walletList} />} /> <Route path='transfer-fund/confirm-transfer' element={<ConfirmTransfer payment={paymentHistory} wallet={walletList} />} />
<Route path='*' element={<Navigate to='/' />} /> <Route path='*' element={<Navigate to='/' />} />