2018-12-15 19:09:31 +00:00
|
|
|
import React from 'react'
|
2018-12-15 20:15:17 +00:00
|
|
|
import Divider from '@material-ui/core/Divider'
|
2018-12-15 19:09:31 +00:00
|
|
|
import { FundingContext } from '../context'
|
|
|
|
import PledgesTable from './PledgesTable'
|
|
|
|
import FunderProfilesTable from './FunderProfilesTable'
|
2018-12-15 20:15:17 +00:00
|
|
|
import AddFunder from './AddFunder'
|
|
|
|
import CreateFunding from './CreateFunding'
|
2018-12-15 19:09:31 +00:00
|
|
|
|
|
|
|
const FundsManagement = ({ open }) => {
|
|
|
|
const maxWidth = open ? `${window.visualViewport.width - 35}px` : '100vw'
|
|
|
|
return (
|
|
|
|
<FundingContext.Consumer>
|
2018-12-15 20:15:17 +00:00
|
|
|
{({ allPledges, appendPledges, appendFundProfile, transferPledgeAmounts, fundProfiles, cancelFundProfile }) =>
|
2018-12-15 19:09:31 +00:00
|
|
|
<div style={{ maxWidth }}>
|
2019-01-10 19:37:23 +00:00
|
|
|
<PledgesTable data={allPledges} transferPledgeAmounts={transferPledgeAmounts} fundProfiles={fundProfiles} />
|
|
|
|
<FunderProfilesTable data={fundProfiles} cancelFundProfile={cancelFundProfile}/>
|
2018-12-15 20:15:17 +00:00
|
|
|
<AddFunder appendFundProfile={appendFundProfile} />
|
|
|
|
<Divider variant="middle" />
|
|
|
|
<CreateFunding refreshTable={appendPledges} />
|
2018-12-15 19:09:31 +00:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</FundingContext.Consumer>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default FundsManagement
|