Introduce alliance motions (#7924)
This commit is contained in:
parent
2d62db7cc8
commit
ce63011ee4
@ -15,9 +15,11 @@ import Summary from './Summary';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
isVoter?: boolean;
|
||||
members?: MemberType[];
|
||||
rule?: Rule;
|
||||
unscrupelous?: Unscrupelous;
|
||||
voters?: string[];
|
||||
}
|
||||
|
||||
function Overview ({ className, members, rule, unscrupelous }: Props): React.ReactElement<Props> {
|
||||
|
||||
@ -5,6 +5,7 @@ import React, { useRef } from 'react';
|
||||
import { Route, Switch } from 'react-router';
|
||||
|
||||
import { Tabs } from '@polkadot/react-components';
|
||||
import { useCollectiveMembers } from '@polkadot/react-hooks';
|
||||
|
||||
import Announcements from './Announcements';
|
||||
import Overview from './Overview';
|
||||
@ -22,6 +23,7 @@ interface Props {
|
||||
|
||||
function AllianceApp ({ basePath, className }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
const { isMember: isVoter, members: voters } = useCollectiveMembers('allianceMotion');
|
||||
const accouncements = useAnnoucements();
|
||||
const members = useMembers();
|
||||
const rule = useRule();
|
||||
@ -58,9 +60,11 @@ function AllianceApp ({ basePath, className }: Props): React.ReactElement<Props>
|
||||
</Route>
|
||||
<Route>
|
||||
<Overview
|
||||
isVoter={isVoter}
|
||||
members={members}
|
||||
rule={rule}
|
||||
unscrupelous={unscrupelous}
|
||||
voters={voters}
|
||||
/>
|
||||
</Route>
|
||||
</Switch>
|
||||
|
||||
@ -27,7 +27,7 @@ export type TxDefs = SubmittableExtrinsic<'promise'> | IExtrinsic | Call | TxDef
|
||||
|
||||
export type TxSource<T extends TxDefs> = [T, boolean];
|
||||
|
||||
export type CollectiveType = 'council' | 'membership' | 'technicalCommittee';
|
||||
export type CollectiveType = 'allianceMotion' | 'council' | 'membership' | 'technicalCommittee';
|
||||
|
||||
export interface ModalState {
|
||||
isOpen: boolean;
|
||||
|
||||
@ -24,7 +24,7 @@ const OPT = {
|
||||
function useCollectiveMembersImpl (collective: CollectiveType): Result {
|
||||
const { api } = useApi();
|
||||
const { allAccounts, hasAccounts } = useAccounts();
|
||||
const retrieved = useCall<string[]>(hasAccounts && api.derive[collective]?.members, undefined, OPT);
|
||||
const retrieved = useCall<string[]>(hasAccounts && api.derive[collective as 'council']?.members, undefined, OPT);
|
||||
|
||||
return useMemo(
|
||||
() => ({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user