liquid-funding/app/components/FundsManagement.jsx

29 lines
1.1 KiB
React
Raw Normal View History

import React from 'react'
2018-12-15 20:15:17 +00:00
import Divider from '@material-ui/core/Divider'
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'
const FundsManagement = ({ open }) => {
const windowWidth = window.visualViewport.width
const maxWidth = open ? `${windowWidth * 0.80}px` : '100vw'
const WebkitTransition = 'all 0.25s ease-out 0s'
return (
<FundingContext.Consumer>
{({ allPledges, appendPledges, appendFundProfile, transferPledgeAmounts, fundProfiles }) =>
<div style={{ maxWidth, WebkitTransition }}>
2019-01-10 19:37:23 +00:00
<PledgesTable data={allPledges} transferPledgeAmounts={transferPledgeAmounts} fundProfiles={fundProfiles} />
<FunderProfilesTable />
2018-12-15 20:15:17 +00:00
<AddFunder appendFundProfile={appendFundProfile} />
<Divider variant="middle" />
<CreateFunding refreshTable={appendPledges} />
</div>
}
</FundingContext.Consumer>
)
}
export default FundsManagement