liquid-funding/app/components/Dashboard.jsx

23 lines
726 B
React
Raw Normal View History

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'
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>
)
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))