mirror of
https://github.com/stronk-dev/LivepeerEvents.git
synced 2025-07-05 10:45:10 +02:00
Initial lazy grouping
This commit is contained in:
parent
b9f782b2e3
commit
c7985b493b
@ -15,8 +15,8 @@ const EventButton = (obj) => {
|
|||||||
<p>TransferBond: transfered bond worth {obj.data.amount / 1000000000000000000} Eth from {obj.data.oldDelegator} to {obj.data.newDelegator}</p>
|
<p>TransferBond: transfered bond worth {obj.data.amount / 1000000000000000000} Eth from {obj.data.oldDelegator} to {obj.data.newDelegator}</p>
|
||||||
</div>
|
</div>
|
||||||
} else if (obj.name == "Bond") {
|
} else if (obj.name == "Bond") {
|
||||||
eventSpecificInfo = <div className="row">
|
eventSpecificInfo = <div className="row" style={{backgroundColor:'rgba(50,50,50,0.3)'}}>
|
||||||
<p>Bond: {obj.data.delegator} transfered bond worth {obj.data.bondedAmount / 1000000000000000000} Eth from {obj.data.oldDelegate} to {obj.data.newDelegate}</p>
|
<p>Bond: {obj.data.delegator} delegated {obj.data.bondedAmount / 1000000000000000000} LPT from {obj.data.oldDelegate} to {obj.data.newDelegate}</p>
|
||||||
</div>
|
</div>
|
||||||
} else if (obj.name == "Rebond") {
|
} else if (obj.name == "Rebond") {
|
||||||
eventSpecificInfo = <div className="row">
|
eventSpecificInfo = <div className="row">
|
||||||
|
@ -5,17 +5,23 @@ import ScrollContainer from 'react-indiana-drag-scroll';
|
|||||||
const EventViewer = (obj) => {
|
const EventViewer = (obj) => {
|
||||||
let txCounter = 0;
|
let txCounter = 0;
|
||||||
let currentTx = "";
|
let currentTx = "";
|
||||||
|
let eventCache = [];
|
||||||
|
let eventBundle = [];
|
||||||
return (
|
return (
|
||||||
<div className="stroke roundedOpaque" style={{ padding: 0, margin: 0, marginTop: '2em', position: 'absolute', bottom: 0, top: '200px', left: '0px', right: '0px', overflowY: 'auto', overflowX: 'hidden', width: '100%' }}>
|
<div className="stroke roundedOpaque" style={{ padding: 0, margin: 0, marginTop: '2em', position: 'absolute', bottom: 0, top: '200px', left: '0px', right: '0px', overflowY: 'auto', overflowX: 'hidden', width: '100%' }}>
|
||||||
<div className="content-wrapper">
|
<div className="content-wrapper">
|
||||||
<ScrollContainer className="overflow-container" hideScrollbars={false}>
|
<ScrollContainer className="overflow-container" hideScrollbars={false}>
|
||||||
<div className="overflow-content" style={{ cursor: 'grab' }}>
|
<div className="overflow-content" style={{ cursor: 'grab' }}>
|
||||||
{obj.events.map((eventObj, idx) => {
|
{obj.events.slice(0).reverse().map((eventObj, idx) => {
|
||||||
if(currentTx != eventObj.transactionHash){
|
if (currentTx != eventObj.transactionHash) {
|
||||||
txCounter++;
|
txCounter++;
|
||||||
currentTx = eventObj.transactionHash;
|
currentTx = eventObj.transactionHash;
|
||||||
|
eventBundle = eventCache;
|
||||||
|
eventCache = [];
|
||||||
|
} else {
|
||||||
|
eventCache.push(eventObj);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
// TODO: make something that groups shit as long as the eventObj.transactionUrl is the same
|
|
||||||
return <EventButton
|
return <EventButton
|
||||||
key={eventObj.transactionUrl + idx}
|
key={eventObj.transactionUrl + idx}
|
||||||
transactionUrl={eventObj.transactionUrl}
|
transactionUrl={eventObj.transactionUrl}
|
||||||
@ -24,6 +30,7 @@ const EventViewer = (obj) => {
|
|||||||
data={eventObj.data}
|
data={eventObj.data}
|
||||||
address={eventObj.address}
|
address={eventObj.address}
|
||||||
idx={txCounter}
|
idx={txCounter}
|
||||||
|
subEvents={eventBundle}
|
||||||
/>
|
/>
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user