Short address length, uppercase option (#121)

* Short address length, uppercase option

* Update CHANGELOG
This commit is contained in:
Jaco Greeff
2019-05-08 13:15:03 +02:00
committed by GitHub
parent 903f9a5eb9
commit f97cc8710c
9 changed files with 51 additions and 44 deletions
+3 -1
View File
@@ -1,8 +1,10 @@
# 0.38.1 # 0.38.1
- Sorting of keyring addresses - Sorting of keyring addresses
- Fix JSON import defaults - Fix JSON import defaults (previously detection was not working for old accounts)
- Display icons using publicKey (not the encoded address) - Display icons using publicKey (not the encoded address)
- Ensure only a single instance of ui-keyring is loaded
- Adjust short address option display (keyring options)
# 0.37.1 # 0.37.1
+1 -1
View File
@@ -25,7 +25,7 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.4.4", "@babel/core": "^7.4.4",
"@babel/runtime": "^7.4.4", "@babel/runtime": "^7.4.4",
"@polkadot/dev-react": "^0.30.0-beta.3", "@polkadot/dev-react": "^0.30.0-beta.4",
"@polkadot/ts": "^0.1.56", "@polkadot/ts": "^0.1.56",
"empty": "^0.10.1", "empty": "^0.10.1",
"gh-pages": "^2.0.1" "gh-pages": "^2.0.1"
+2 -2
View File
@@ -24,8 +24,8 @@
"react": "*" "react": "*"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^0.90.0-beta.1", "@polkadot/keyring": "^0.90.0-beta.4",
"@polkadot/util-crypto": "^0.90.0-beta.1", "@polkadot/util-crypto": "^0.90.0-beta.4",
"xmlserializer": "^0.6.1" "xmlserializer": "^0.6.1"
} }
} }
+3 -3
View File
@@ -16,9 +16,9 @@
"styled-components": "^4.2.0" "styled-components": "^4.2.0"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^0.90.0-beta.1", "@polkadot/keyring": "^0.90.0-beta.4",
"@polkadot/types": "^0.78.0-beta.1", "@polkadot/types": "^0.78.0-beta.13",
"@polkadot/util": "^0.90.0-beta.1" "@polkadot/util": "^0.90.0-beta.4"
}, },
"peerDependencies": { "peerDependencies": {
"@polkadot/keyring": "*", "@polkadot/keyring": "*",
+7 -3
View File
@@ -9,6 +9,7 @@ import IdentityIcon from '@polkadot/ui-identicon';
type Props = { type Props = {
address: string, address: string,
className?: string, className?: string,
isUppercase: boolean,
name: string, name: string,
style?: { style?: {
[index: string]: string [index: string]: string
@@ -44,14 +45,17 @@ const Wrapper = styled.div`
flex: 1 0; flex: 1 0;
margin-left: 3rem; margin-left: 3rem;
overflow: hidden; overflow: hidden;
text-transform: uppercase;
text-overflow: ellipsis; text-overflow: ellipsis;
&.uppercase {
text-transform: uppercase;
}
} }
`; `;
export default class KeyPair extends React.PureComponent<Props> { export default class KeyPair extends React.PureComponent<Props> {
render () { render () {
const { address, className, name, style } = this.props; const { address, className, isUppercase, name, style } = this.props;
return ( return (
<Wrapper <Wrapper
@@ -63,7 +67,7 @@ export default class KeyPair extends React.PureComponent<Props> {
size={32} size={32}
value={address} value={address}
/> />
<div className='name'> <div className={`name ${isUppercase ? 'uppercase' : 'normalcase'}`}>
{name} {name}
</div> </div>
<div className='address'> <div className='address'>
+3 -2
View File
@@ -9,11 +9,11 @@ import { isUndefined } from '@polkadot/util';
import KeyPair from './KeyPair'; import KeyPair from './KeyPair';
export default function createItem (address: string, _name?: string): KeyringSectionOption { export default function createItem (address: string, _name?: string, isUppercase: boolean = true): KeyringSectionOption {
const name = isUndefined(_name) const name = isUndefined(_name)
? ( ? (
(address.length > 15) (address.length > 15)
? `${address.slice(0, 7)}${address.slice(-7)}` ? `${address.slice(0, 6)}${address.slice(-6)}`
: address : address
) )
: _name; : _name;
@@ -24,6 +24,7 @@ export default function createItem (address: string, _name?: string): KeyringSec
text: ( text: (
<KeyPair <KeyPair
address={address} address={address}
isUppercase={isUppercase}
name={name} name={name}
/> />
), ),
+1 -1
View File
@@ -14,7 +14,7 @@
"store": "^2.0.12" "store": "^2.0.12"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/util": "^0.90.0-beta.1" "@polkadot/util": "^0.90.0-beta.4"
}, },
"peerDependencies": { "peerDependencies": {
"@polkadot/util": "*" "@polkadot/util": "*"
+1 -1
View File
@@ -12,7 +12,7 @@
"@babel/runtime": "^7.4.4" "@babel/runtime": "^7.4.4"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/types": "^0.78.0-beta.1" "@polkadot/types": "^0.78.0-beta.13"
}, },
"peerDependencies": { "peerDependencies": {
"@polkadot/types": "*" "@polkadot/types": "*"
+30 -30
View File
@@ -1765,15 +1765,15 @@
universal-user-agent "^2.0.0" universal-user-agent "^2.0.0"
url-template "^2.0.8" url-template "^2.0.8"
"@polkadot/dev-react@^0.30.0-beta.3": "@polkadot/dev-react@^0.30.0-beta.4":
version "0.30.0-beta.3" version "0.30.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/dev-react/-/dev-react-0.30.0-beta.3.tgz#68f1ef50bb67caef02fc9de983659e0c3018f10f" resolved "https://registry.yarnpkg.com/@polkadot/dev-react/-/dev-react-0.30.0-beta.4.tgz#72c18b482a39c37d7d488ff353382c6a40ee148f"
integrity sha512-hghhdSf+mLeXmIJgBGrSzgu4zVQTJ5QrFoAl8QjzBuvNHErrVvtQ7FtDi3gZCcEaOaHa3sSApgh3HTesHD0bIg== integrity sha512-DCna2LmQXpfmvWMMB0tQCKJM2P0D5qtQR7AcbMS1sqf+kieJT1F+++5t64fcJYwENYZ1oJrAW5bHhsuBvfzIGA==
dependencies: dependencies:
"@babel/core" "^7.4.4" "@babel/core" "^7.4.4"
"@babel/plugin-syntax-dynamic-import" "^7.2.0" "@babel/plugin-syntax-dynamic-import" "^7.2.0"
"@babel/preset-react" "^7.0.0" "@babel/preset-react" "^7.0.0"
"@polkadot/dev" "^0.30.0-beta.3" "@polkadot/dev" "^0.30.0-beta.4"
"@types/react" "^16.8.14" "@types/react" "^16.8.14"
"@types/react-dom" "^16.8.4" "@types/react-dom" "^16.8.4"
"@types/styled-components" "4.1.8" "@types/styled-components" "4.1.8"
@@ -1801,10 +1801,10 @@
webpack-plugin-serve "^0.8.0" webpack-plugin-serve "^0.8.0"
worker-loader "^2.0.0" worker-loader "^2.0.0"
"@polkadot/dev@^0.30.0-beta.3": "@polkadot/dev@^0.30.0-beta.4":
version "0.30.0-beta.3" version "0.30.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.30.0-beta.3.tgz#22ed6cfa735520f75e43020cf6673ec4d376ee48" resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.30.0-beta.4.tgz#10403838cba964a21d2cc6740fdb74c9b9244038"
integrity sha512-mb4d+OJfWRx/pmsOKH29rRUq0Htoxl8MdIufnbikIW9aTROK5yULhkeB7SUKuYglVFhr+z1HGDx7MYBzDqjrhA== integrity sha512-ugJkBxvGOebSQQSL+zhIPAHUdnNxy5qGSUPnSh+7ss5g2rYzf6zIpUIlAJ78heF+vmTebD+6VmjwW9jQ7XbnCA==
dependencies: dependencies:
"@babel/cli" "^7.4.4" "@babel/cli" "^7.4.4"
"@babel/core" "^7.4.4" "@babel/core" "^7.4.4"
@@ -1838,14 +1838,14 @@
typescript "^3.4.5" typescript "^3.4.5"
vuepress "^1.0.0-alpha.47" vuepress "^1.0.0-alpha.47"
"@polkadot/keyring@^0.90.0-beta.1": "@polkadot/keyring@^0.90.0-beta.4":
version "0.90.0-beta.1" version "0.90.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-0.90.0-beta.1.tgz#e6220c837c0acb79c4a1a82974cb911736cfca4e" resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-0.90.0-beta.4.tgz#3b3ada2e1945025aeca5acf345b0023965682dc8"
integrity sha512-Mt3GeBb4+F3uLSY3Cgt3pY9C1AdyDJxcfcig2am1zIRTdOXPk4tadIWOAFfLHCGw4w7Sv8vo9+Kb061/5vv4EA== integrity sha512-t3NEC2hIJri5metrTXOQpoKjpnuL+RIe7uAFhlXByaMgS+92bEPkcFamuza91L8bVxJvCxbhYWNl0P6hnv+7lw==
dependencies: dependencies:
"@babel/runtime" "^7.4.4" "@babel/runtime" "^7.4.4"
"@polkadot/util" "^0.90.0-beta.1" "@polkadot/util" "^0.90.0-beta.4"
"@polkadot/util-crypto" "^0.90.0-beta.1" "@polkadot/util-crypto" "^0.90.0-beta.4"
"@types/bs58" "^4.0.0" "@types/bs58" "^4.0.0"
bs58 "^4.0.1" bs58 "^4.0.1"
@@ -1854,22 +1854,22 @@
resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.56.tgz#ffd6e9c95704a7fb90b918193b9dc5c440114b27" resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.56.tgz#ffd6e9c95704a7fb90b918193b9dc5c440114b27"
integrity sha512-wnt4zXxZXyz6WaubTO/I+nUElwV2DogFzdl6CrKfVn2PTWp8uHN06W9s40FH57ORtmQfDr9rLRP8Nq+oIyElbg== integrity sha512-wnt4zXxZXyz6WaubTO/I+nUElwV2DogFzdl6CrKfVn2PTWp8uHN06W9s40FH57ORtmQfDr9rLRP8Nq+oIyElbg==
"@polkadot/types@^0.78.0-beta.1": "@polkadot/types@^0.78.0-beta.13":
version "0.78.0-beta.1" version "0.78.0-beta.13"
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-0.78.0-beta.1.tgz#f1fc4324487cdf7d9448994c73062b6210529551" resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-0.78.0-beta.13.tgz#9d0df1b57b9b6455f5c2a4f9fce605ee1455fc20"
integrity sha512-vXFeuNB+gAgrkmfEv3d+otDASnu+sKB36fVPSImtBxczTemiMN+3AkVPXb7lBC0x9E7bCnm9p7WlYgj0Z/n9zw== integrity sha512-2y0eIggWoijQUbUHitt3SBxYOIIqENxaQrYehijcOtgcoz48mkIXNPL9ETI7tsFCLK313Wts+Y4tGXqKJwX8qA==
dependencies: dependencies:
"@babel/runtime" "^7.4.4" "@babel/runtime" "^7.4.4"
"@polkadot/keyring" "^0.90.0-beta.1" "@polkadot/keyring" "^0.90.0-beta.4"
"@polkadot/util" "^0.90.0-beta.1" "@polkadot/util" "^0.90.0-beta.4"
"@polkadot/util-crypto@^0.90.0-beta.1": "@polkadot/util-crypto@^0.90.0-beta.4":
version "0.90.0-beta.1" version "0.90.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.90.0-beta.1.tgz#e826c5b6dd315418ba9f5789492c81b69ec43bd0" resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.90.0-beta.4.tgz#a4ceb7003836b87c50d65009d09e3fb9b94fb9ab"
integrity sha512-Chl7y4FzJMoFNmTlBC1Uvos1qReWS5ZdV24DcAG15g5GCKsQRSyYX1fU0nudXTxBAIROmEr28pHdihQn4HTdfg== integrity sha512-lxtnbKgIVP84I9g3NlNx52+YoqlmEvmWr48nxHuTQEsoNt348GwSwGlIv4laMXJ+WP2PSAqSvWtJbK8L7a4gpA==
dependencies: dependencies:
"@babel/runtime" "^7.4.4" "@babel/runtime" "^7.4.4"
"@polkadot/util" "^0.90.0-beta.1" "@polkadot/util" "^0.90.0-beta.4"
"@polkadot/wasm-crypto" "^0.9.1" "@polkadot/wasm-crypto" "^0.9.1"
"@types/bip39" "^2.4.2" "@types/bip39" "^2.4.2"
"@types/pbkdf2" "^3.0.0" "@types/pbkdf2" "^3.0.0"
@@ -1883,10 +1883,10 @@
tweetnacl "^1.0.1" tweetnacl "^1.0.1"
xxhashjs "^0.2.2" xxhashjs "^0.2.2"
"@polkadot/util@^0.90.0-beta.1": "@polkadot/util@^0.90.0-beta.4":
version "0.90.0-beta.1" version "0.90.0-beta.4"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.90.0-beta.1.tgz#e70c5120f1fb20e9c78983598dc6e17030ab7550" resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.90.0-beta.4.tgz#b682e67216cb5b4145dec3a9a082df4f8a10d0b2"
integrity sha512-gRF6DWq/PVtD4EnVxyta8tuiAG2j3mvP88xcyMcWDqENZfw43Rnor+bT9YhsZ0AkLuad4KbPOw3cWbVnBPIoIg== integrity sha512-8zAFLjPvOgryfRTs7BWr+ITyj4FQmWBwPMoKvw4sbGw8KxzcOegXIoi5rLW9VtSq7UqCKE6wi8s1lYF5PDnBbA==
dependencies: dependencies:
"@babel/runtime" "^7.4.4" "@babel/runtime" "^7.4.4"
"@types/bn.js" "^4.11.5" "@types/bn.js" "^4.11.5"