Introduce alliance motions (#7924)

This commit is contained in:
Jaco 2022-07-28 10:44:08 +02:00 committed by GitHub
parent 2d62db7cc8
commit ce63011ee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -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> {

View File

@ -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>

View File

@ -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;

View File

@ -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(
() => ({