diff --git a/.123trigger b/.123trigger index 0cfbf08886..00750edc07 100644 --- a/.123trigger +++ b/.123trigger @@ -1 +1 @@ -2 +3 diff --git a/package.json b/package.json index 4dacf6c0b5..5d09cd4bca 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "packages/*" ], "resolutions": { - "@polkadot/api": "^0.96.0-beta.5", - "@polkadot/api-contract": "^0.96.0-beta.5", + "@polkadot/api": "^0.96.0-beta.7", + "@polkadot/api-contract": "^0.96.0-beta.7", "@polkadot/keyring": "^1.6.1", - "@polkadot/types": "^0.96.0-beta.5", + "@polkadot/types": "^0.96.0-beta.7", "@polkadot/util": "^1.6.1", "@polkadot/util-crypto": "^1.6.1", "babel-core": "^7.0.0-bridge.0", diff --git a/packages/app-accounts/src/Account.tsx b/packages/app-accounts/src/Account.tsx index 8d74cb85ad..946068394f 100644 --- a/packages/app-accounts/src/Account.tsx +++ b/packages/app-accounts/src/Account.tsx @@ -128,7 +128,7 @@ function Account ({ address, className, t }: Props): React.ReactElement { type='account' value={address} withExplorer - withIndex + withIndexOrAddress={false} withTags > {address && ( diff --git a/packages/app-accounts/src/modals/Create.tsx b/packages/app-accounts/src/modals/Create.tsx index db2e891b1f..9f1540fb4a 100644 --- a/packages/app-accounts/src/modals/Create.tsx +++ b/packages/app-accounts/src/modals/Create.tsx @@ -193,6 +193,7 @@ function Create ({ className, onClose, onStatusChange, seed: propsSeed, t, type:

{t('We will provide you with a generated backup file after your account is created. As long as you have access to your account you can always download this file later by clicking on "Backup" button from the Accounts section.')}

diff --git a/packages/app-accounts/src/modals/Import.tsx b/packages/app-accounts/src/modals/Import.tsx index f24f93f7d6..dc71c38fd3 100644 --- a/packages/app-accounts/src/modals/Import.tsx +++ b/packages/app-accounts/src/modals/Import.tsx @@ -76,6 +76,7 @@ class Import extends TxComponent { { type='address' value={address} withExplorer - withIndex + withIndexOrAddress={false} withTags > {address && current && ( diff --git a/packages/app-address-book/src/modals/Create.tsx b/packages/app-address-book/src/modals/Create.tsx index 9a5c9436ad..968c546d4e 100644 --- a/packages/app-address-book/src/modals/Create.tsx +++ b/packages/app-address-book/src/modals/Create.tsx @@ -85,6 +85,7 @@ function Create ({ onClose, onStatusChange, t }: Props): React.ReactElement { - + {voters && voters.length !== 0 && ( + + )} ); } diff --git a/packages/app-council/src/Overview/Member.tsx b/packages/app-council/src/Overview/Member.tsx index 1a23435d51..a4e19eb5f9 100644 --- a/packages/app-council/src/Overview/Member.tsx +++ b/packages/app-council/src/Overview/Member.tsx @@ -21,8 +21,11 @@ function Member ({ address, t, voters }: Props): React.ReactElement { - + {voters && voters.length !== 0 && ( + + )} ); } diff --git a/packages/app-council/src/Overview/Vote.tsx b/packages/app-council/src/Overview/Vote.tsx index fecb8bf672..c35b634190 100644 --- a/packages/app-council/src/Overview/Vote.tsx +++ b/packages/app-council/src/Overview/Vote.tsx @@ -52,7 +52,7 @@ const Candidate = styled.div` min-width: calc(50% - 1rem); border-radius: 0.5rem; border: 1px solid #eee; - padding: 0.25rem; + padding: 0.75rem 0.5rem 0.25rem; margin: 0.25rem; transition: all 0.2s; @@ -71,6 +71,11 @@ const Candidate = styled.div` &.nay { background-color: rgba(0, 0, 0, 0.05); } + + .ui--Row-children { + text-align: right; + width: 100%; + } `; class Vote extends TxModal { @@ -212,6 +217,7 @@ class Vote extends TxModal { defaultName={isMember ? t('member') : t('candidate')} isInline value={accountId} + withIndexOrAddress > | null { - if (!voters || !voters.length) { - return null; - } - return (
diff --git a/packages/app-staking/src/Actions/Accounts.tsx b/packages/app-staking/src/Actions/Accounts.tsx index 2efcc14009..88d0a3c537 100644 --- a/packages/app-staking/src/Actions/Accounts.tsx +++ b/packages/app-staking/src/Actions/Accounts.tsx @@ -43,7 +43,7 @@ function Accounts ({ allAccounts, allStashes, className, myControllers, recently const [isNewStakeOpen, setIsNewStateOpen] = useState(false); const myStashes = getMyStashes(myControllers, allAccounts); const stashOptions = allStashes.map((stashId): KeyringSectionOption => - createOption(stashId, getAddressName(stashId, 'account')) + createOption(stashId, getAddressName(stashId, 'account') as string) ); const isEmpty = !isNewStakeOpen && (!myStashes || myStashes.length === 0); diff --git a/packages/react-api/package.json b/packages/react-api/package.json index 4f2a2a62a5..58344e8d93 100644 --- a/packages/react-api/package.json +++ b/packages/react-api/package.json @@ -31,7 +31,7 @@ "homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme", "dependencies": { "@babel/runtime": "^7.6.3", - "@polkadot/api": "^0.96.0-beta.5", + "@polkadot/api": "^0.96.0-beta.7", "@polkadot/extension-dapp": "^0.14.0-beta.0", "edgeware-node-types": "^1.0.10", "rxjs-compat": "^6.5.3" diff --git a/packages/react-components/src/AddressRow.tsx b/packages/react-components/src/AddressRow.tsx index 75682596e9..8d55dd3a06 100644 --- a/packages/react-components/src/AddressRow.tsx +++ b/packages/react-components/src/AddressRow.tsx @@ -30,10 +30,12 @@ export interface Props extends I18nProps, RowProps { isValid?: boolean; label?: string; nicks_nameOf?: Option<[Bytes, Balance] & Codec>; + noDefaultNameOpacity?: boolean; value: AccountId | AccountIndex | Address | string | null; withAddressOrName?: boolean; withBalance?: boolean | BalanceActiveType; withIndex?: boolean; + withIndexOrAddress?: boolean; withValidatorPrefs?: boolean | ValidatorPrefsType; } @@ -49,7 +51,7 @@ class AddressRow extends Row { this.state = this.createState(); } - public static getDerivedStateFromProps ({ accounts_idAndIndex = [], defaultName, nicks_nameOf, type, value }: Props, prevState: State): State | null { + public static getDerivedStateFromProps ({ accounts_idAndIndex = [], defaultName, nicks_nameOf, noDefaultNameOpacity, type, value }: Props, prevState: State): State | null { const [_accountId] = accounts_idAndIndex; const accountId = _accountId || value; const address = accountId @@ -58,7 +60,8 @@ class AddressRow extends Row { const nickName = nicks_nameOf && nicks_nameOf.isSome ? u8aToString(nicks_nameOf.unwrap()[0]) : undefined; - const name = nickName || getAddressName(address, type, false, defaultName || '') || ''; + const nameHolder = defaultName || ''; + const name = nickName || getAddressName(address, type, false, noDefaultNameOpacity ? nameHolder : {nameHolder}) || ''; const tags = getAddressTags(address, type); const state: Partial = { tags }; let hasChanged = false; @@ -69,7 +72,7 @@ class AddressRow extends Row { } if (!prevState.isEditingName && name !== prevState.name) { - state.name = name; + state.name = name as string; hasChanged = true; } @@ -117,7 +120,7 @@ class AddressRow extends Row { return { ...this.state, address, - name, + name: name as string, tags }; } @@ -138,7 +141,13 @@ class AddressRow extends Row { } private renderAddress (): React.ReactNode { + const { accounts_idAndIndex = [], withIndexOrAddress = true } = this.props; const { address } = this.state; + const [, accountIndex] = accounts_idAndIndex; + + if (accountIndex && withIndexOrAddress) { + return null; + } return (
@@ -153,10 +162,10 @@ class AddressRow extends Row { } private renderAccountIndex (): React.ReactNode { - const { accounts_idAndIndex = [], withIndex = true } = this.props; + const { accounts_idAndIndex = [], withIndex = true, withIndexOrAddress = true } = this.props; const [, accountIndex] = accounts_idAndIndex; - if (!accountIndex || !withIndex) { + if (!accountIndex || !(withIndex || withIndexOrAddress)) { return null; } @@ -247,9 +256,9 @@ class AddressRow extends Row { } catch (error) { keyring.saveAddress(address, meta); } - - this.setState({ isEditingName: false }); } + + this.setState({ isEditingName: false }); } protected saveTags = (): void => { @@ -280,9 +289,9 @@ export { export default withMulti( styled(AddressRow as React.ComponentClass)` - ${styles}, - .ui--Row-accountId+.ui--Row-accountIndex { - margin-top: -0.25rem; + ${styles} + .ui--Row-placeholder { + opacity: 0.5; } `, translate, diff --git a/packages/react-components/src/InputAddress/index.tsx b/packages/react-components/src/InputAddress/index.tsx index 0ee91be19e..6aa9e9d8e5 100644 --- a/packages/react-components/src/InputAddress/index.tsx +++ b/packages/react-components/src/InputAddress/index.tsx @@ -198,7 +198,7 @@ class InputAddress extends React.PureComponent { ); } - private renderLabel = ({ value }: KeyringSectionOption): string | undefined => { + private renderLabel = ({ value }: KeyringSectionOption): React.ReactNode => { if (!value) { return undefined; } diff --git a/packages/react-components/src/Row.tsx b/packages/react-components/src/Row.tsx index c5186d733f..366af16bde 100644 --- a/packages/react-components/src/Row.tsx +++ b/packages/react-components/src/Row.tsx @@ -275,7 +275,7 @@ export default class Row

extends React.P const { address, isEditingName, name } = this.state; const withName = name !== defaultName; - // can't be both editable and copiable + // can't be both editable and copyable return isEditingName ? (