diff --git a/packages/app-accounts/src/Creator.tsx b/packages/app-accounts/src/Creator.tsx index fdab594d3b..67618a6d7f 100644 --- a/packages/app-accounts/src/Creator.tsx +++ b/packages/app-accounts/src/Creator.tsx @@ -8,6 +8,7 @@ import React from 'react'; import Button from '@polkadot/ui-app/Button'; import Input from '@polkadot/ui-app/Input'; +import { InputAddress } from '@polkadot/ui-app/InputAddress'; import Password from '@polkadot/ui-app/Password'; import classes from '@polkadot/ui-app/util/classes'; import keyring from '@polkadot/ui-keyring/index'; @@ -212,11 +213,12 @@ class Creator extends React.PureComponent { onCommit = (): void => { const { onBack } = this.props; const { name, password, seed } = this.state; - - keyring.createAccount( + const pair = keyring.createAccount( formatSeed(seed), password, { name } ); + InputAddress.setLastValue('account', pair.address()); + onBack(); } diff --git a/packages/app-addresses/src/Creator.tsx b/packages/app-addresses/src/Creator.tsx index ff48476f20..daddf8ae71 100644 --- a/packages/app-addresses/src/Creator.tsx +++ b/packages/app-addresses/src/Creator.tsx @@ -8,6 +8,7 @@ import React from 'react'; import Button from '@polkadot/ui-app/Button'; import Input from '@polkadot/ui-app/Input'; +import { InputAddress } from '@polkadot/ui-app/InputAddress'; import classes from '@polkadot/ui-app/util/classes'; import keyring from '@polkadot/ui-keyring/index'; import addressDecode from '@polkadot/util-keyring/address/decode'; @@ -167,6 +168,7 @@ class Creator extends React.PureComponent { const { address, name } = this.state; keyring.saveAddress(address, { name }); + InputAddress.setLastValue('address', address); onBack(); } diff --git a/packages/app-extrinsics/src/Account.tsx b/packages/app-extrinsics/src/Account.tsx index fb56761d52..59bdd94349 100644 --- a/packages/app-extrinsics/src/Account.tsx +++ b/packages/app-extrinsics/src/Account.tsx @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. -import { KeyringOption$Type } from '@polkadot/ui-keyring/types'; +import { KeyringOption$Type } from '@polkadot/ui-keyring/options/types'; import { I18nProps } from '@polkadot/ui-app/types'; import React from 'react'; diff --git a/packages/app-extrinsics/src/Nonce.tsx b/packages/app-extrinsics/src/Nonce.tsx index 66822a2bc8..e440dde029 100644 --- a/packages/app-extrinsics/src/Nonce.tsx +++ b/packages/app-extrinsics/src/Nonce.tsx @@ -13,13 +13,13 @@ import RxNonce from '@polkadot/ui-react-rx/Nonce'; type Props = BareProps & { label: string, - onChange: (value: BN) => void, + rxChange: (value: BN) => void, value?: Uint8Array }; export default class Nonce extends React.PureComponent { render () { - const { className, label, style, onChange, value } = this.props; + const { className, label, style, rxChange, value } = this.props; if (!value) { return null; @@ -36,7 +36,7 @@ export default class Nonce extends React.PureComponent { > diff --git a/packages/app-extrinsics/src/Selection.tsx b/packages/app-extrinsics/src/Selection.tsx index 974c3433b4..740ab12150 100644 --- a/packages/app-extrinsics/src/Selection.tsx +++ b/packages/app-extrinsics/src/Selection.tsx @@ -65,7 +65,7 @@ class Selection extends React.PureComponent { label={t('display.nonce', { defaultValue: 'with an index' })} - onChange={this.onChangeNonce} + rxChange={this.onChangeNonce} value={publicKey} /> diff --git a/packages/app-rpc/src/Account.tsx b/packages/app-rpc/src/Account.tsx index 93270e799c..54dbf008ab 100644 --- a/packages/app-rpc/src/Account.tsx +++ b/packages/app-rpc/src/Account.tsx @@ -79,7 +79,7 @@ class Account extends React.PureComponent { > diff --git a/packages/app-storage/src/Selection.tsx b/packages/app-storage/src/Selection.tsx index 094564f392..3cfebbfca0 100644 --- a/packages/app-storage/src/Selection.tsx +++ b/packages/app-storage/src/Selection.tsx @@ -59,6 +59,7 @@ class Selection extends React.PureComponent { /> @@ -107,7 +108,11 @@ class Selection extends React.PureComponent { } onChangeKey = (key: SectionItem): void => { - this.nextState({ key } as State); + this.nextState({ + isValid: false, + key, + params: [] + }); } onChangeParams = (params: RawParams = []): void => { diff --git a/packages/apps/src/NodeInfo.tsx b/packages/apps/src/NodeInfo.tsx index 1fb3f01f39..9be681cec4 100644 --- a/packages/apps/src/NodeInfo.tsx +++ b/packages/apps/src/NodeInfo.tsx @@ -19,8 +19,6 @@ type Props = I18nProps & {}; const pkgJson = require('../package.json'); -console.log('@polkadot/apps', pkgJson.version); - function updateTestInfo (chain?: string) { keyring.setTestMode(isTestChain(chain)); } @@ -35,7 +33,7 @@ class NodeInfo extends React.PureComponent { label={t('info.chain', { defaultValue: 'chain: ' })} - onChange={updateTestInfo} + rxChange={updateTestInfo} /> extends React.PureComponent> { + componentDidMount () { + const { defaultValue, value } = this.props; + const startValue = isUndefined(value) + ? defaultValue + : value; + + if (startValue) { + this.onChange(null, { value: startValue }); + } + } + render () { const { className, defaultValue, isDisabled, isError, label, onSearch, options, placeholder, style, withLabel, value } = this.props; @@ -56,7 +68,7 @@ export default class Dropdown