address PR comments

This commit is contained in:
Daniel Ternyak 2018-09-17 10:53:50 -05:00
parent 934c39ada4
commit 2eff37c401
No known key found for this signature in database
GPG Key ID: DF212D2DC5D0E245
4 changed files with 18 additions and 10 deletions

View File

@ -177,7 +177,6 @@ class CreateProposal extends React.Component<Props, State> {
const milestoneAmounts = milestones.map(milestone =>
Wei(milestoneToMilestoneAmount(milestone, targetInWei)),
);
console.log('milestoneAmounts', milestoneAmounts);
const immediateFirstMilestonePayout = milestones[0].immediatePayout;
const contractData = {

View File

@ -3,6 +3,9 @@ import { Spin } from 'antd';
import { CrowdFund } from 'modules/proposals/reducers';
import UserRow from 'components/UserRow';
import * as ProposalStyled from '../styled';
import Placeholder from '../../Placeholder';
import { fromWei } from '../../../utils/units';
import UnitDisplay from '../../UnitDisplay';
interface Props {
crowdFund: CrowdFund;
@ -16,11 +19,20 @@ const ContributorsBlock = ({ crowdFund }: Props) => {
<UserRow
key={contributor.address}
address={contributor.address}
amount={contributor.contributionAmount}
secondary={<UnitDisplay value={contributor.contributionAmount} symbol="ETH" />}
/>
));
} else {
content = <h5>No contributors found.</h5>;
content = (
<Placeholder
style={{ minHeight: '220px' }}
title="No contributors found"
subtitle={`
It appears that your campaign hasn't yet been funded.
Check back later once you've received at least one contribution!
`}
/>
);
}
} else {
content = <Spin />;

View File

@ -2,14 +2,13 @@ import React from 'react';
import ShortAddress from 'components/ShortAddress';
import Identicon from 'components/Identicon';
import * as Styled from './styled';
import { Wei, fromWei } from 'utils/units';
interface Props {
address: string;
amount?: Wei;
secondary?: React.ReactNode;
}
const UserRow = ({ address, amount }: Props) => (
const UserRow = ({ address, secondary }: Props) => (
<Styled.Container>
<Styled.Avatar>
<Identicon address={address} />
@ -18,9 +17,7 @@ const UserRow = ({ address, amount }: Props) => (
<Styled.InfoMain>
<ShortAddress address={address} />
</Styled.InfoMain>
{amount && (
<Styled.InfoSecondary>{fromWei(amount, 'ether')} ETH</Styled.InfoSecondary>
)}
{secondary && <Styled.InfoSecondary>{secondary}</Styled.InfoSecondary>}
</Styled.Info>
</Styled.Container>
);

View File

@ -29,7 +29,7 @@ export async function getCrowdFundState(
? 0
: balance
.mul(new BN(100))
.divRound(target)
.div(target)
.toNumber();
const amountVotingForRefund = isRaiseGoalReached
? Wei(await crowdFundContract.methods.amountVotingForRefund().call({ from: account }))