2018-12-16 17:59:33 +00:00
|
|
|
import React from 'react'
|
2019-01-25 19:31:51 +00:00
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import { withDatabase } from '@nozbe/watermelondb/DatabaseProvider'
|
|
|
|
import withObservables from '@nozbe/with-observables'
|
2018-12-18 19:30:50 +00:00
|
|
|
import PledgeAllocationsChart from './dashboard/PledgeAllocationsChart'
|
|
|
|
import FundingSummary from './dashboard/FundingSummary'
|
2018-12-16 17:59:33 +00:00
|
|
|
|
2019-01-25 19:31:51 +00:00
|
|
|
const Dashboard = ({ pledges }) => (
|
2018-12-16 17:59:33 +00:00
|
|
|
<div>
|
2019-01-25 19:31:51 +00:00
|
|
|
<FundingSummary title="Funding Summary" pledges={pledges} />
|
|
|
|
<PledgeAllocationsChart title="Pledge Allocations" pledges={pledges} />
|
2018-12-16 17:59:33 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
|
2019-01-25 19:48:17 +00:00
|
|
|
Dashboard.propTypes = {
|
2019-01-25 19:31:51 +00:00
|
|
|
pledges: PropTypes.array.isRequired
|
|
|
|
}
|
|
|
|
|
|
|
|
export default withDatabase(withObservables([], ({ database }) => ({
|
|
|
|
pledges: database.collections.get('pledges').query().observe()
|
|
|
|
}))(Dashboard))
|
|
|
|
|