added history table to history page

This commit was merged in pull request #41.
This commit is contained in:
victorAnumudu
2023-05-08 12:52:21 +01:00
parent e201d4726d
commit 4ff53fbfa1
6 changed files with 148 additions and 70 deletions
+2 -33
View File
@@ -7,6 +7,7 @@ import LoadingSpinner from '../Spinners/LoadingSpinner';
import {Formik, Form} from 'formik'
import * as Yup from 'yup'
import ReferralTable from '../MyWallet/WalletComponent/ReferralTable';
const validationSchema = Yup.object().shape({
email: Yup.string()
@@ -169,39 +170,7 @@ function ReferralDisplay() {
)
:
(
<table className="referral-list w-full table-auto border-collapse text-left">
<thead className='border-b-2'>
<tr className='text-slate-600'>
<th className="p-3">Added/Name</th>
<th className="p-3">Email</th>
<th className="p-3">Status</th>
</tr>
</thead>
<tbody>
{referralList.data.length ?
referralList.data.map((item, index) => (
<tr key={index} className='text-slate-500'>
<td className="p-3">{item.added_date} / {item.firstname} {item.lastname}</td>
<td className="p-3">{item.email}</td>
<td className="p-3">{item.status}</td>
</tr>
))
:
(
referralList.error ?
<tr className='text-slate-500'>
<td colSpan={3}>Opps! couldn't get referral history. Try reloading the page</td>
</tr>
:
(
<tr className='text-slate-500'>
<td colSpan={3}>No Item Found on referral List</td>
</tr>
)
)
}
</tbody>
</table>
<ReferralTable history={referralList} />
)
}
</div>