use VaultEvents model for TransfersGraph
This commit is contained in:
parent
8b3e648448
commit
98c1f80942
|
@ -12,7 +12,7 @@ const Dashboard = ({ pledges }) => (
|
|||
</div>
|
||||
)
|
||||
|
||||
Dashboard.PropTypes = {
|
||||
Dashboard.propTypes = {
|
||||
pledges: PropTypes.array.isRequired
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import { withDatabase } from '@nozbe/watermelondb/DatabaseProvider'
|
|||
import { uniq, isNil } from 'ramda'
|
||||
import { toEther } from '../utils/conversions'
|
||||
import { getTokenLabel } from '../utils/currencies'
|
||||
import { FundingContext } from '../context'
|
||||
import { getAuthorizations } from '../selectors/vault'
|
||||
|
||||
|
||||
|
@ -75,29 +74,27 @@ const createElements = (transfers, vaultEvents) => {
|
|||
]
|
||||
}
|
||||
|
||||
const TransfersGraph = ({ transfers }) => {
|
||||
const TransfersGraph = ({ transfers, vaultEvents }) => {
|
||||
return (
|
||||
<FundingContext.Consumer>
|
||||
{({ vaultEvents }) =>
|
||||
<Fragment>
|
||||
<CytoscapeComponent
|
||||
elements={createElements(transfers, vaultEvents)}
|
||||
style={ { width: '100vw', height: '100%', fontSize: '14px' } }
|
||||
stylesheet={stylesheet}
|
||||
layout={layout}
|
||||
/>
|
||||
</Fragment>
|
||||
}
|
||||
</FundingContext.Consumer>
|
||||
<Fragment>
|
||||
<CytoscapeComponent
|
||||
elements={createElements(transfers, vaultEvents)}
|
||||
style={ { width: '100vw', height: '100%', fontSize: '14px' } }
|
||||
stylesheet={stylesheet}
|
||||
layout={layout}
|
||||
/>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
TransfersGraph.propTypes = {
|
||||
transfers: PropTypes.array.isRequired
|
||||
transfers: PropTypes.array.isRequired,
|
||||
vaultEvents: PropTypes.array.isRequired
|
||||
}
|
||||
|
||||
export default withDatabase(withObservables([], ({ database }) => ({
|
||||
transfers: database.collections.get('lp_events').query(
|
||||
Q.where('event', 'Transfer')
|
||||
).observe()
|
||||
).observe(),
|
||||
vaultEvents : database.collections.get('vault_events').query().observe()
|
||||
}))(TransfersGraph))
|
||||
|
|
|
@ -5,6 +5,7 @@ import { action, field, json } from '@nozbe/watermelondb/decorators'
|
|||
const sanitizeValues = json => json
|
||||
export default class VaultEvent extends Model {
|
||||
static table = 'vault_events'
|
||||
|
||||
@field('address') address
|
||||
|
||||
@field('event_id') eventId
|
||||
|
@ -25,4 +26,3 @@ export default class VaultEvent extends Model {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue