diff --git a/packages/page-claims/src/Claim.tsx b/packages/page-claims/src/Claim.tsx index a7cb2cd495..34a56435b2 100644 --- a/packages/page-claims/src/Claim.tsx +++ b/packages/page-claims/src/Claim.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/app-123code authors & contributors +// Copyright 2017-2020 @polkadot/app-claims authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/page-claims/src/index.tsx b/packages/page-claims/src/index.tsx index 6084415452..5eb630746b 100644 --- a/packages/page-claims/src/index.tsx +++ b/packages/page-claims/src/index.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/app-123code authors & contributors +// Copyright 2017-2020 @polkadot/app-claims authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/page-claims/src/secp256k1.d.ts b/packages/page-claims/src/secp256k1.d.ts index 190c68fb51..f555d4d441 100644 --- a/packages/page-claims/src/secp256k1.d.ts +++ b/packages/page-claims/src/secp256k1.d.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/app-123code authors & contributors +// Copyright 2017-2020 @polkadot/app-claims authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/page-claims/src/util.ts b/packages/page-claims/src/util.ts index 4ae7afe14d..a8b453ea77 100644 --- a/packages/page-claims/src/util.ts +++ b/packages/page-claims/src/util.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/app-123code authors & contributors +// Copyright 2017-2020 @polkadot/app-claims authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/page-staking/src/Targets/index.tsx b/packages/page-staking/src/Targets/index.tsx index 1d2ceb68c1..b9b6b5505b 100644 --- a/packages/page-staking/src/Targets/index.tsx +++ b/packages/page-staking/src/Targets/index.tsx @@ -36,6 +36,7 @@ const PERBILL = new BN(1_000_000_000); function sortValidators (list: ValidatorInfo[]): ValidatorInfo[] { return list + .filter((a) => a.bondTotal.gtn(0)) .sort((a, b): number => b.commissionPer - a.commissionPer) .map((info, index): ValidatorInfo => { info.rankComm = index + 1; diff --git a/packages/page-treasury/src/Overview/Approve.tsx b/packages/page-treasury/src/Overview/Approve.tsx deleted file mode 100644 index 4dda9e66e2..0000000000 --- a/packages/page-treasury/src/Overview/Approve.tsx +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2017-2020 @polkadot/app-treasury authors & contributors -// This software may be modified and distributed under the terms -// of the Apache-2.0 license. See the LICENSE file for details. - -import { AccountId, BlockNumber } from '@polkadot/types/interfaces'; -import { ApiProps } from '@polkadot/react-api/types'; -import { I18nProps } from '@polkadot/react-components/types'; - -import React from 'react'; -import { Button, Dropdown } from '@polkadot/react-components'; -import { withMulti, withApi, withCalls } from '@polkadot/react-api/hoc'; -import TxModal, { TxModalProps, TxModalState } from '@polkadot/react-components/TxModal'; - -import translate from '../translate'; - -interface Props extends I18nProps, ApiProps, TxModalProps { - isApproved?: boolean; - proposalInfo?: React.ReactNode; - proposalId: string; - threshold: number; -} - -interface State extends TxModalState { - isApproving: boolean; -} - -class Approve extends TxModal { - public state: State = { - ...this.defaultState, - isApproving: false - }; - - private approveOptions = (): { text: string; value: boolean }[] => [ - { text: this.props.t('Aye, I approve'), value: true }, - { text: this.props.t('Nay, I do not approve'), value: false } - ] - - protected headerText = (): string => this.props.t('Approve or reject proposal'); - - protected txMethod = (): string => 'council.propose'; - - protected txParams = (): [number, any] => { - const { api, proposalId, threshold } = this.props; - const { isApproving } = this.state; - - const method = isApproving ? 'approveProposal' : 'rejectProposal'; - const spendProposal = api.tx.treasury[method](proposalId); - - return [threshold, spendProposal]; - } - - protected renderTrigger = (): React.ReactNode => { - const { api, t } = this.props; - - // disable voting for 1.x (we only use elections here) - if (!api.query.elections) { - return null; - } - - return ( -
- -
- ); - } - - protected renderPreContent = (): React.ReactNode => { - const { proposalInfo = null } = this.props; - - if (!proposalInfo) { - return null; - } - - return proposalInfo; - } - - protected renderContent = (): React.ReactNode => { - const { t } = this.props; - const { isApproving } = this.state; - - return ( - - ); - } - - private onChangeApproving = (isApproving: boolean): void => { - this.setState({ isApproving }); - } -} - -export default withMulti( - Approve, - translate, - withApi, - withCalls( - ['query.elections.members', { - propName: 'threshold', - transform: (value: [AccountId, BlockNumber][]): number => - Math.ceil(value.length * 0.5) - }] - ) -); diff --git a/packages/react-components/src/AddressInfo.tsx b/packages/react-components/src/AddressInfo.tsx index 679f5aac2e..a503fb8d2c 100644 --- a/packages/react-components/src/AddressInfo.tsx +++ b/packages/react-components/src/AddressInfo.tsx @@ -266,13 +266,15 @@ function renderBalances (props: Props, allAccounts: string[], t: (key: string) =