From 98c1f809425172f420edeacb1a35fa392c0a9186 Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Fri, 25 Jan 2019 14:48:17 -0500 Subject: [PATCH] use VaultEvents model for TransfersGraph --- app/components/Dashboard.jsx | 2 +- app/components/TransfersGraph.jsx | 29 +++++++++++++---------------- app/model/vaultEvent.js | 2 +- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/app/components/Dashboard.jsx b/app/components/Dashboard.jsx index d7abcb8..799d144 100644 --- a/app/components/Dashboard.jsx +++ b/app/components/Dashboard.jsx @@ -12,7 +12,7 @@ const Dashboard = ({ pledges }) => ( ) -Dashboard.PropTypes = { +Dashboard.propTypes = { pledges: PropTypes.array.isRequired } diff --git a/app/components/TransfersGraph.jsx b/app/components/TransfersGraph.jsx index a78802a..c93e136 100644 --- a/app/components/TransfersGraph.jsx +++ b/app/components/TransfersGraph.jsx @@ -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 ( - - {({ vaultEvents }) => - - - - } - + + + ) } 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)) diff --git a/app/model/vaultEvent.js b/app/model/vaultEvent.js index e3b7f1c..a43d153 100644 --- a/app/model/vaultEvent.js +++ b/app/model/vaultEvent.js @@ -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 { }) } } -