Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^0.99.0-beta.7",
"@polkadot/api-contract": "^0.99.0-beta.7",
"@polkadot/api": "^0.99.0-beta.9",
"@polkadot/api-contract": "^0.99.0-beta.9",
"@polkadot/keyring": "^1.7.1",
"@polkadot/types": "^0.99.0-beta.7",
"@polkadot/types": "^0.99.0-beta.9",
"@polkadot/util": "^1.7.1",
"@polkadot/util-crypto": "^1.7.1",
"babel-core": "^7.0.0-bridge.0",
Expand Down
1 change: 0 additions & 1 deletion packages/app-accounts/src/modals/Backup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export default function ({ address, onClose }: Props): React.ReactElement<Props>
return (
<Modal
className='app--accounts-Modal'
dimmer='inverted'
open
>
<Modal.Header>{t('Backup account')}</Modal.Header>
Expand Down
1 change: 0 additions & 1 deletion packages/app-accounts/src/modals/ChangePass.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class ChangePass extends TxComponent<Props, State> {
return (
<Modal
className='app--accounts-Modal'
dimmer='inverted'
open
>
<Modal.Header>{t('Change account password')}</Modal.Header>
Expand Down
1 change: 0 additions & 1 deletion packages/app-accounts/src/modals/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ function Create ({ className, onClose, onStatusChange, seed: propsSeed, t, type:
return (
<Modal
className={className}
dimmer='inverted'
open
>
<Modal.Header>{t('Add an account via seed')}</Modal.Header>
Expand Down
5 changes: 1 addition & 4 deletions packages/app-accounts/src/modals/CreateConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ interface Props extends I18nProps {

function CreateConfirmation ({ address, name, onClose, onCommit, t }: Props): React.ReactElement<Props> | null {
return (
<Modal
dimmer='inverted'
open
>
<Modal open>
<Modal.Header>
{t('Important notice')}
</Modal.Header>
Expand Down
1 change: 0 additions & 1 deletion packages/app-accounts/src/modals/Derive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ function Derive ({ className, from, onClose, t }: Props): React.ReactElement {
return (
<Modal
className={className}
dimmer='inverted'
open
>
<Modal.Header>{t('Derive account from pair')}</Modal.Header>
Expand Down
5 changes: 1 addition & 4 deletions packages/app-accounts/src/modals/Import.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ class Import extends TxComponent<Props, State> {
const { isFileValid, isPassValid } = this.state;

return (
<Modal
dimmer='inverted'
open
>
<Modal open>
<Modal.Header>{t('Add via backup file')}</Modal.Header>
{this.renderInput()}
<Modal.Actions>
Expand Down
1 change: 0 additions & 1 deletion packages/app-accounts/src/modals/Qr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function QrModal ({ className, onClose, onStatusChange, t }: Props): React.React
return (
<Modal
className={className}
dimmer='inverted'
open
>
<Modal.Header>{t('Add account via Qr')}</Modal.Header>
Expand Down
1 change: 0 additions & 1 deletion packages/app-accounts/src/modals/Transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ function Transfer ({ className, onClose, recipientId: propRecipientId, senderId:
return (
<Modal
className='app--accounts-Modal'
dimmer='inverted'
open
>
<Modal.Header>{t('Send funds')}</Modal.Header>
Expand Down
5 changes: 1 addition & 4 deletions packages/app-address-book/src/modals/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ function Create ({ onClose, onStatusChange, t }: Props): React.ReactElement<Prop
};

return (
<Modal
dimmer='inverted'
open
>
<Modal open>
<Modal.Header>{t('Add an address')}</Modal.Header>
<Modal.Content>
<AddressRow
Expand Down
2 changes: 1 addition & 1 deletion packages/app-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.7.5",
"@polkadot/api-contract": "^0.99.0-beta.7",
"@polkadot/api-contract": "^0.99.0-beta.9",
"@polkadot/react-components": "^0.38.0-beta.51"
}
}
1 change: 0 additions & 1 deletion packages/app-contracts/src/Contracts/Call.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ function Call (props: Props): React.ReactElement<Props> | null {
return (
<Modal
className={[className || '', 'app--contracts-Modal'].join(' ')}
dimmer='inverted'
onClose={onClose}
open={isOpen}
>
Expand Down
1 change: 0 additions & 1 deletion packages/app-contracts/src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class ContractModal<P extends ContractModalProps, S extends ContractModalState>
return (
<Modal
className='app--contracts-Modal'
dimmer='inverted'
onClose={this.onClose}
open={isOpen}
>
Expand Down
1 change: 0 additions & 1 deletion packages/app-contracts/src/RemoveABI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ function RemoveABI ({ code, onClose, onRemove, t }: Props): React.ReactElement<P
return (
<Modal
className='app--accounts-Modal'
dimmer='inverted'
onClose={onClose}
open
>
Expand Down
39 changes: 10 additions & 29 deletions packages/app-council/src/Motions/Motion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,23 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.

import { Proposal as ProposalType, Votes } from '@polkadot/types/interfaces';
import { DerivedCouncilProposal } from '@polkadot/api-derive/types';
import { I18nProps } from '@polkadot/react-components/types';

import BN from 'bn.js';
import React from 'react';
import { Option } from '@polkadot/types';

import { AddressMini, Voting } from '@polkadot/react-components';
import { withCalls, withMulti } from '@polkadot/react-api';
import ProposalCell from '@polkadot/app-democracy/Overview/ProposalCell';
import { formatNumber } from '@polkadot/util';

import translate from '../translate';

interface Props extends I18nProps {
chain_bestNumber?: BN;
hash: string;
proposal: ProposalType | null;
votes: Votes | null;
motion: DerivedCouncilProposal;
}

function Motion ({ className, hash, proposal, t, votes }: Props): React.ReactElement<Props> | null {
if (!proposal || !votes) {
function Motion ({ className, motion: { hash, proposal, votes }, t }: Props): React.ReactElement<Props> | null {
if (!votes) {
return null;
}

Expand All @@ -33,7 +27,11 @@ function Motion ({ className, hash, proposal, t, votes }: Props): React.ReactEle
return (
<tr className={className}>
<td className='number top'><h1>{formatNumber(index)}</h1></td>
<ProposalCell className='top' proposalHash={hash} proposal={proposal} />
<ProposalCell
className='top'
proposalHash={hash}
proposal={proposal}
/>
<td className='number top'>
<label>{t('threshold')}</label>
{formatNumber(ayes.length)}/{formatNumber(threshold)}
Expand Down Expand Up @@ -70,21 +68,4 @@ function Motion ({ className, hash, proposal, t, votes }: Props): React.ReactEle
);
}

export default withMulti(
Motion,
translate,
withCalls<Props>(
['query.council.proposalOf', {
paramName: 'hash',
propName: 'proposal',
transform: (value: Option<ProposalType>): ProposalType | null =>
value.unwrapOr(null)
}],
['query.council.voting', {
paramName: 'hash',
propName: 'votes',
transform: (value: Option<Votes>): Votes | null =>
value.unwrapOr(null)
}]
)
);
export default translate(Motion);
10 changes: 5 additions & 5 deletions packages/app-council/src/Motions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.

import { Hash } from '@polkadot/types/interfaces';
import { DerivedCouncilProposals, DerivedCouncilProposal } from '@polkadot/api-derive/types';
import { I18nProps } from '@polkadot/react-components/types';

import React from 'react';
Expand All @@ -13,7 +13,7 @@ import Propose from './Propose';
import translate from '../translate';

interface Props extends I18nProps {
motions?: Hash[];
motions?: DerivedCouncilProposals;
}

function Proposals ({ className, motions, t }: Props): React.ReactElement<Props> {
Expand All @@ -24,10 +24,10 @@ function Proposals ({ className, motions, t }: Props): React.ReactElement<Props>
? (
<Table>
<Table.Body>
{motions?.map((hash: Hash): React.ReactNode => (
{motions?.map((motion: DerivedCouncilProposal): React.ReactNode => (
<Motion
hash={hash.toHex()}
key={hash.toHex()}
key={motion.hash.toHex()}
motion={motion}
/>
))}
</Table.Body>
Expand Down
2 changes: 1 addition & 1 deletion packages/app-council/src/Overview/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function Summary ({ bestNumber, className, electionsInfo: { members, candidateCo
</CardSummary>
</section>
)}
{bestNumber && termDuration && termDuration.gtn(0) && (
{bestNumber && termDuration?.gtn(0) && (
<section>
<CardSummary
label={t('term progress')}
Expand Down
4 changes: 2 additions & 2 deletions packages/app-council/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.

import { Hash } from '@polkadot/types/interfaces';
import { DerivedCouncilProposals } from '@polkadot/api-derive/types';
import { AppProps, BareProps, I18nProps } from '@polkadot/react-components/types';

import React from 'react';
Expand All @@ -23,7 +23,7 @@ interface Props extends AppProps, BareProps, I18nProps {}
function App ({ basePath, className, t }: Props): React.ReactElement<Props> {
const { api } = useApi();
const { pathname } = useLocation();
const motions = useCall<Hash[]>(api.query.council.proposals, []);
const motions = useCall<DerivedCouncilProposals>(api.derive.council.proposals, []);

return (
<main className={className}>
Expand Down
4 changes: 2 additions & 2 deletions packages/app-council/src/useCounter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.

import { Hash } from '@polkadot/types/interfaces';
import { DerivedCouncilProposals } from '@polkadot/api-derive/types';

import { useState, useEffect } from 'react';
import { useApi, useCall } from '@polkadot/react-hooks';

export default function useCounter (): number {
const { api, isApiReady } = useApi();
const motions = useCall<Hash[]>(isApiReady ? api.query.council?.proposals : undefined, []);
const motions = useCall<DerivedCouncilProposals>(isApiReady ? api.derive.council.proposals : undefined, []);
const [counter, setCounter] = useState(0);

useEffect((): void => {
Expand Down
5 changes: 4 additions & 1 deletion packages/app-democracy/src/Overview/DispatchEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ function DispatchEntry ({ blockNumber, hash, referendumIndex, t }: Props): React
</>
)}
</td>
<ProposalCell proposalHash={hash} proposal={proposal} />
<ProposalCell
proposalHash={hash}
proposal={proposal}
/>
</tr>
);
}
Expand Down
6 changes: 5 additions & 1 deletion packages/app-democracy/src/Overview/Externals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ function Externals ({ className, t }: Props): React.ReactElement<Props> | null {
<td className='number together top'>
{expanded && <FormatBalance label={<label>{t('locked')}</label>} value={expanded.balance} />}
</td>
<ProposalCell className='top' proposalHash={hash} proposal={expanded?.proposal} />
<ProposalCell
className='top'
proposalHash={hash}
proposal={expanded?.proposal}
/>
</tr>
</Table.Body>
</Table>
Expand Down
1 change: 0 additions & 1 deletion packages/app-democracy/src/Overview/PreImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ function PreImage ({ className, onClose, t }: Props): React.ReactElement<Props>
return (
<Modal
className={className}
dimmer='inverted'
open
>
<Modal.Header>{t('Submit preimage')}</Modal.Header>
Expand Down
6 changes: 5 additions & 1 deletion packages/app-democracy/src/Overview/Proposal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ function Proposal ({ className, t, value: { balance, hash, index, proposal, prop
<td className='number together top'>
<FormatBalance label={<label>{t('locked')}</label>} value={balance} />
</td>
<ProposalCell className='top' proposalHash={hash} proposal={proposal} />
<ProposalCell
className='top'
proposalHash={hash}
proposal={proposal}
/>
<td className='top seconding'>
{seconding.length !== 0 && (
<details>
Expand Down
1 change: 0 additions & 1 deletion packages/app-democracy/src/Overview/Propose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function Propose ({ className, onClose, t }: Props): React.ReactElement<Props> {
return (
<Modal
className={className}
dimmer='inverted'
open
>
<Modal.Header>{t('Submit proposal')}</Modal.Header>
Expand Down
6 changes: 5 additions & 1 deletion packages/app-democracy/src/Overview/Referendum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ function Referendum ({ chain_bestNumber, className, democracy_referendumVotesFor
return (
<tr className={className}>
<td className='number top'><h1>{formatNumber(value.index)}</h1></td>
<ProposalCell className='top' proposalHash={value.hash} proposal={value.proposal} />
<ProposalCell
className='top'
proposalHash={value.hash}
proposal={value.proposal}
/>
<td className='number together top'>
<label>{t('remaining')}</label>
{formatNumber(value.info.end.sub(chain_bestNumber).subn(1))} blocks
Expand Down
1 change: 0 additions & 1 deletion packages/app-democracy/src/Overview/Seconding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function Seconding ({ depositors, proposalId, t }: Props): React.ReactElement<Pr
<>
{isSecondingOpen && (
<Modal
dimmer='inverted'
open
size='small'
>
Expand Down
Loading