diff --git a/app/components/projects/BackProject.jsx b/app/components/projects/BackProject.jsx index 46bc84c..0e366e2 100644 --- a/app/components/projects/BackProject.jsx +++ b/app/components/projects/BackProject.jsx @@ -8,6 +8,8 @@ import { useProjectData, useProfileData } from './hooks' import Divider from '@material-ui/core/Divider' import TextField from '@material-ui/core/TextField' import MenuItem from '@material-ui/core/MenuItem' +import { toEther } from '../../utils/conversions' +import { getTokenLabel } from '../../utils/currencies' const styles = theme => ({ root: { @@ -100,7 +102,7 @@ const SubmissionSection = ({ classes, profiles, delegatePledges }) => { > {filteredPledges.map(pledge => ( - {`Pledge no: ${pledge.idPledge}`} + {`Pledge no: ${pledge.idPledge} - Amount: ${toEther(pledge.pledgeData.amount)} ${getTokenLabel(pledge.pledgeData.token)}`} ))} } diff --git a/app/components/projects/hooks.js b/app/components/projects/hooks.js index 3517d8e..c29ed2e 100644 --- a/app/components/projects/hooks.js +++ b/app/components/projects/hooks.js @@ -45,6 +45,12 @@ async function getProjectAssets(projectId, setState){ }) } +async function getPledge(dPledge) { + const pledge = await dPledge.pledge.fetch() + dPledge.pledgeData = pledge + return dPledge +} + async function fetchAndAddDelegateProfiles(account, setState) { const profiles = await getDelegateProfiles(account) setState(profiles) @@ -57,7 +63,9 @@ async function fetchAndAddDelegatePledges(profiles, setState) { dPledges.push(delegatePledges) }) const resolved = await Promise.all(dPledges) - setState(unnest(resolved)) + const unnested = unnest(resolved) + const expanded = await Promise.all(unnested.map(getPledge)) + setState(expanded) } export function useProfileData(profiles) {