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:
parent
6763c1e8d9
commit
e97ce8b926
@ -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>
|
||||
|
||||
@ -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 } })
|
||||
|
||||
Loading…
Reference in New Issue
Block a user