Adjust society vote outputs (#4894)

This commit is contained in:
Jaco Greeff 2021-03-21 22:19:55 +01:00 committed by GitHub
parent 9052e7e231
commit 110070aa12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -70,6 +70,11 @@ function Member ({ bestNumber, className = '', value: { accountId, isCandidateVo
[bestNumber, payouts]
);
const votedOn = useMemo(
() => [isCandidateVoter && t('Candidate'), isDefenderVoter && t('Defender')].filter((s): s is string => !!s),
[isCandidateVoter, isDefenderVoter, t]
);
return (
<tr className={className}>
<td className='address'>
@ -127,8 +132,7 @@ function Member ({ bestNumber, className = '', value: { accountId, isCandidateVo
/>
)}
</td>
<td>{isDefenderVoter && t<string>('defender')}</td>
<td>{isCandidateVoter && t<string>('candidate')}</td>
<td className='together'>{votedOn.join(', ')}</td>
<td className='number'>{formatNumber(strikes)}</td>
<td className='button start'>
<DesignKusama accountId={accountId} />

View File

@ -22,7 +22,7 @@ function Members ({ className = '', mapMembers }: Props): React.ReactElement<Pro
const headerRef = useRef([
[t('members'), 'start', 3],
[t('round voting'), 'start', 2],
[t('voted on'), 'start'],
[t('strikes')],
[]
]);