mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-15 01:34:57 +01:00
refactor
This commit is contained in:
parent
fcc8bc2896
commit
9911c458a7
@ -7,10 +7,6 @@ import EtherscanLink from '../../atoms/EtherscanLink'
|
||||
import Time from '../../atoms/Time'
|
||||
import styles from './PoolTransactions.module.css'
|
||||
|
||||
export default function PoolTransactions(): ReactElement {
|
||||
const { ocean, accountId } = useOcean()
|
||||
const [logs, setLogs] = useState<PoolTransaction[]>()
|
||||
|
||||
const columns = [
|
||||
{
|
||||
name: 'Title',
|
||||
@ -46,21 +42,22 @@ export default function PoolTransactions(): ReactElement {
|
||||
}
|
||||
]
|
||||
|
||||
export default function PoolTransactions(): ReactElement {
|
||||
const { ocean, accountId } = useOcean()
|
||||
const [logs, setLogs] = useState<PoolTransaction[]>()
|
||||
|
||||
useEffect(() => {
|
||||
async function getLogs() {
|
||||
if (!ocean || !accountId) return
|
||||
|
||||
const logs = await ocean.pool.getAllPoolLogs(
|
||||
'0xe08A1dAe983BC701D05E492DB80e0144f8f4b909'
|
||||
)
|
||||
// limit to 20 latest transactions for now
|
||||
setLogs(logs.slice(0, 19))
|
||||
const logs = await ocean.pool.getAllPoolLogs(accountId)
|
||||
// limit to 100 latest transactions for now
|
||||
setLogs(logs.slice(0, 99))
|
||||
}
|
||||
getLogs()
|
||||
}, [ocean, accountId])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<DataTable
|
||||
columns={columns}
|
||||
data={logs}
|
||||
@ -68,6 +65,5 @@ export default function PoolTransactions(): ReactElement {
|
||||
noHeader
|
||||
pagination
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user