2018-09-15 23:46:40 -07:00
|
|
|
import React from 'react';
|
|
|
|
import { Spin } from 'antd';
|
2018-09-27 13:39:37 -07:00
|
|
|
import AddressRow from 'components/AddressRow';
|
2018-09-17 08:55:20 -07:00
|
|
|
import Placeholder from 'components/Placeholder';
|
|
|
|
import UnitDisplay from 'components/UnitDisplay';
|
2018-09-15 23:46:40 -07:00
|
|
|
|
2018-12-21 10:27:39 -08:00
|
|
|
const ContributorsBlock = () => {
|
|
|
|
// TODO: Get contributors from proposal
|
|
|
|
console.warn('TODO: Get contributors from proposal for Proposal/Contributors/index.tsx');
|
|
|
|
const proposal = { contributors: [] as any };
|
2018-09-15 23:46:40 -07:00
|
|
|
let content;
|
2018-12-21 10:27:39 -08:00
|
|
|
if (proposal) {
|
|
|
|
if (proposal.contributors.length) {
|
|
|
|
content = proposal.contributors.map((contributor: any) => (
|
2018-09-27 13:39:37 -07:00
|
|
|
<AddressRow
|
2018-09-16 12:59:32 -07:00
|
|
|
key={contributor.address}
|
|
|
|
address={contributor.address}
|
2018-12-27 09:41:26 -08:00
|
|
|
secondary={
|
|
|
|
<UnitDisplay value={contributor.contributionAmount} symbol="ZEC" />
|
|
|
|
}
|
2018-09-16 12:59:32 -07:00
|
|
|
/>
|
|
|
|
));
|
|
|
|
} else {
|
2018-09-17 08:53:50 -07:00
|
|
|
content = (
|
|
|
|
<Placeholder
|
|
|
|
style={{ minHeight: '220px' }}
|
|
|
|
title="No contributors found"
|
|
|
|
subtitle={`
|
2018-09-17 09:01:01 -07:00
|
|
|
No contributions have been made to this proposal.
|
|
|
|
Check back later once there's been at least one contribution.
|
2018-09-17 08:53:50 -07:00
|
|
|
`}
|
|
|
|
/>
|
|
|
|
);
|
2018-09-16 12:59:32 -07:00
|
|
|
}
|
2018-09-15 23:46:40 -07:00
|
|
|
} else {
|
|
|
|
content = <Spin />;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2018-09-22 09:44:55 -07:00
|
|
|
<div className="Proposal-top-side-block">
|
2018-12-21 10:27:39 -08:00
|
|
|
{proposal.contributors.length ? (
|
2018-09-16 12:59:32 -07:00
|
|
|
<>
|
2018-09-22 09:44:55 -07:00
|
|
|
<h1 className="Proposal-top-main-block-title">Contributors</h1>
|
|
|
|
<div className="Proposal-top-main-block">{content}</div>
|
2018-09-16 12:59:32 -07:00
|
|
|
</>
|
|
|
|
) : (
|
|
|
|
content
|
|
|
|
)}
|
2018-09-22 09:44:55 -07:00
|
|
|
</div>
|
2018-09-15 23:46:40 -07:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ContributorsBlock;
|