-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vinay kharayat
committed
Oct 4, 2023
1 parent
29639b7
commit 1ef73d2
Showing
13 changed files
with
3,417 additions
and
180 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,239 @@ | ||
import { useEffect, useState } from "react"; | ||
|
||
export default function EventTable({ updateTableData }) { | ||
const [tableData, setTableData] = useState([]); | ||
|
||
useEffect(() => { | ||
console.log("updateTableData", updateTableData); | ||
setTableData(updateTableData); | ||
}, [updateTableData]); | ||
|
||
return ( | ||
<div className="w-full relative overflow-x-auto shadow-md sm:rounded-lg"> | ||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400"> | ||
<thead className="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"> | ||
<tr> | ||
<th scope="col" className="px-6 py-3"> | ||
Pool address | ||
</th> | ||
<th scope="col" className="px-6 py-3"> | ||
Token A amount | ||
</th> | ||
<th scope="col" className="px-6 py-3"> | ||
Token B amount | ||
</th> | ||
<th scope="col" className="px-6 py-3"> | ||
Block number | ||
</th> | ||
<th scope="col" className="px-6 py-3"> | ||
Event name | ||
</th> | ||
<th scope="col" className="px-6 py-3"> | ||
Transaction hash | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{tableData.map((row) => ( | ||
<tr | ||
id="log-row" | ||
key={row.id} | ||
className="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600" | ||
> | ||
<td className="px-6 py-4">{row.poolAddress}</td> | ||
<td className="px-6 py-4">{row.amountTokenA}</td> | ||
<td className="px-6 py-4">{row.amountTokenB}</td> | ||
<td className="px-6 py-4">{row.blockNumber}</td> | ||
<td className="px-6 py-4">{row.eventName}</td> | ||
<td className="px-6 py-4">{row.transactionHash}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
|
||
<div | ||
id="editUserModal" | ||
tabIndex={-1} | ||
aria-hidden="true" | ||
className="fixed top-0 left-0 right-0 z-50 items-center justify-center hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full" | ||
> | ||
<div className="relative w-full max-w-2xl max-h-full"> | ||
<form | ||
action="#" | ||
className="relative bg-white rounded-lg shadow dark:bg-gray-700" | ||
> | ||
<div className="flex items-start justify-between p-4 border-b rounded-t dark:border-gray-600"> | ||
<h3 className="text-xl font-semibold text-gray-900 dark:text-white"> | ||
Edit user | ||
</h3> | ||
<button | ||
type="button" | ||
className="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ml-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white" | ||
data-modal-hide="editUserModal" | ||
> | ||
<svg | ||
className="w-3 h-3" | ||
aria-hidden="true" | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 14 14" | ||
> | ||
<path | ||
stroke="currentColor" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="2" | ||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" | ||
/> | ||
</svg> | ||
<span className="sr-only">Close modal</span> | ||
</button> | ||
</div> | ||
|
||
<div className="p-6 space-y-6"> | ||
<div className="grid grid-cols-6 gap-6"> | ||
<div className="col-span-6 sm:col-span-3"> | ||
<label | ||
htmlFor="first-name" | ||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white" | ||
> | ||
First Name | ||
</label> | ||
<input | ||
type="text" | ||
name="first-name" | ||
id="first-name" | ||
className="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-600 focus:border-blue-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" | ||
placeholder="Bonnie" | ||
required | ||
/> | ||
</div> | ||
<div className="col-span-6 sm:col-span-3"> | ||
<label | ||
htmlFor="last-name" | ||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white" | ||
> | ||
Last Name | ||
</label> | ||
<input | ||
type="text" | ||
name="last-name" | ||
id="last-name" | ||
className="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-600 focus:border-blue-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" | ||
placeholder="Green" | ||
required | ||
/> | ||
</div> | ||
<div className="col-span-6 sm:col-span-3"> | ||
<label | ||
htmlFor="email" | ||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white" | ||
> | ||
</label> | ||
<input | ||
type="email" | ||
name="email" | ||
id="email" | ||
className="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-600 focus:border-blue-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" | ||
placeholder="[email protected]" | ||
required | ||
/> | ||
</div> | ||
<div className="col-span-6 sm:col-span-3"> | ||
<label | ||
htmlFor="phone-number" | ||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white" | ||
> | ||
Phone Number | ||
</label> | ||
<input | ||
type="number" | ||
name="phone-number" | ||
id="phone-number" | ||
className="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-600 focus:border-blue-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" | ||
placeholder="e.g. +(12)3456 789" | ||
required | ||
/> | ||
</div> | ||
<div className="col-span-6 sm:col-span-3"> | ||
<label | ||
htmlFor="department" | ||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white" | ||
> | ||
Department | ||
</label> | ||
<input | ||
type="text" | ||
name="department" | ||
id="department" | ||
className="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-600 focus:border-blue-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" | ||
placeholder="Development" | ||
required | ||
/> | ||
</div> | ||
<div className="col-span-6 sm:col-span-3"> | ||
<label | ||
htmlFor="company" | ||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white" | ||
> | ||
Company | ||
</label> | ||
<input | ||
type="number" | ||
name="company" | ||
id="company" | ||
className="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-600 focus:border-blue-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" | ||
placeholder="123456" | ||
required | ||
/> | ||
</div> | ||
<div className="col-span-6 sm:col-span-3"> | ||
<label | ||
htmlFor="current-password" | ||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white" | ||
> | ||
Current Password | ||
</label> | ||
<input | ||
type="password" | ||
name="current-password" | ||
id="current-password" | ||
className="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-600 focus:border-blue-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" | ||
placeholder="••••••••" | ||
required | ||
/> | ||
</div> | ||
<div className="col-span-6 sm:col-span-3"> | ||
<label | ||
htmlFor="new-password" | ||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white" | ||
> | ||
New Password | ||
</label> | ||
<input | ||
type="password" | ||
name="new-password" | ||
id="new-password" | ||
className="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-600 focus:border-blue-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" | ||
placeholder="••••••••" | ||
required | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div className="flex items-center p-6 space-x-2 border-t border-gray-200 rounded-b dark:border-gray-600"> | ||
<button | ||
type="submit" | ||
className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800" | ||
> | ||
Save all | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.