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 -2
View File
@@ -9,11 +9,11 @@ import { isUndefined } from '@polkadot/util';
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)
? (
(address.length > 15)
? `${address.slice(0, 7)}${address.slice(-7)}`
? `${address.slice(0, 6)}${address.slice(-6)}`
: address
)
: _name;
@@ -24,6 +24,7 @@ export default function createItem (address: string, _name?: string): KeyringSec
text: (
<KeyPair
address={address}
isUppercase={isUppercase}
name={name}
/>
),