Display council members, runners-up & candidates on one screen (#2267)

* Display council members, runnersup & candidates on one screen

* Remove location check
This commit is contained in:
Jaco Greeff 2020-02-11 16:19:28 +01:00 committed by GitHub
parent 6763c1e8d9
commit e97ce8b926
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 21 deletions

View File

@ -6,7 +6,6 @@ import { DerivedElectionsInfo } from '@polkadot/api-derive/types';
import { AccountId, BlockNumber } from '@polkadot/types/interfaces';
import React from 'react';
import { useLocation } from 'react-router-dom';
import { registry } from '@polkadot/react-api';
import { Button } from '@polkadot/react-components';
import { useApi, useCall } from '@polkadot/react-hooks';
@ -51,32 +50,25 @@ export default function Overview ({ className }: Props): React.ReactElement<Prop
return result;
}, {})
});
const { pathname } = useLocation();
const electionsInfo = _electionsInfo || NULL_INFO;
return (
<div className={className}>
{pathname === '/council' && (
<>
<Summary
bestNumber={bestNumber}
electionsInfo={electionsInfo}
/>
<Button.Group>
<SubmitCandidacy electionsInfo={electionsInfo} />
<Button.Or />
<Vote electionsInfo={electionsInfo} />
</Button.Group>
</>
)}
<Summary
bestNumber={bestNumber}
electionsInfo={electionsInfo}
/>
<Button.Group>
<SubmitCandidacy electionsInfo={electionsInfo} />
<Button.Or />
<Vote electionsInfo={electionsInfo} />
</Button.Group>
<Members
allVotes={allVotes}
className={pathname === '/council' ? '' : 'council--hidden'}
electionsInfo={electionsInfo}
/>
<Candidates
allVotes={allVotes}
className={pathname === '/council' ? 'council--hidden' : ''}
electionsInfo={electionsInfo}
/>
</div>

View File

@ -33,10 +33,6 @@ function CouncilApp ({ basePath, className }: Props): React.ReactElement<Props>
name: 'overview',
text: t('Council overview')
},
{
name: 'candidates',
text: t('Candidates')
},
{
name: 'motions',
text: t('Motions ({{count}})', { replace: { count: numMotions } })