mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-13 00:41:02 +00:00
Cleanup issues, allow travis build (#1)
* Cleanup issues, allow travis build * Add missing xmlserializer package * xmlserializer as dev dep
This commit is contained in:
@@ -5,26 +5,20 @@
|
||||
import './KeyPair.css';
|
||||
|
||||
import React from 'react';
|
||||
import { AccountId } from '@polkadot/types';
|
||||
import IdentityIcon from '@polkadot/ui-app/IdentityIcon';
|
||||
import { withMulti, withObservable } from '@polkadot/ui-react-rx/with/index';
|
||||
import IdentityIcon from '@polkadot/ui-identicon/index';
|
||||
|
||||
type Props = {
|
||||
address: string,
|
||||
className?: string,
|
||||
name: string,
|
||||
sessionValidators?: Array<AccountId>,
|
||||
style?: {
|
||||
[index: string]: string
|
||||
}
|
||||
};
|
||||
|
||||
class KeyPair extends React.PureComponent<Props> {
|
||||
export default class KeyPair extends React.PureComponent<Props> {
|
||||
render () {
|
||||
const { address, className, name, sessionValidators = [], style } = this.props;
|
||||
const isValidator = sessionValidators.find((validator) =>
|
||||
validator.toString() === address
|
||||
);
|
||||
const { address, className, name, style } = this.props;
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -33,7 +27,6 @@ class KeyPair extends React.PureComponent<Props> {
|
||||
>
|
||||
<IdentityIcon
|
||||
className='ui--KeyPair-icon'
|
||||
isHighlight={!!isValidator}
|
||||
size={32}
|
||||
value={address}
|
||||
/>
|
||||
@@ -47,8 +40,3 @@ class KeyPair extends React.PureComponent<Props> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default withMulti(
|
||||
KeyPair,
|
||||
withObservable('sessionValidators')
|
||||
);
|
||||
|
||||
@@ -5,13 +5,17 @@
|
||||
import { KeyringSectionOption } from './types';
|
||||
|
||||
import React from 'react';
|
||||
import toShortAddress from '@polkadot/ui-app/util/toShortAddress';
|
||||
import { isUndefined } from '@polkadot/util';
|
||||
|
||||
import KeyPair from './KeyPair';
|
||||
|
||||
export default function createItem (address: string, _name?: string): KeyringSectionOption {
|
||||
const name = _name === undefined
|
||||
? toShortAddress(address)
|
||||
const name = isUndefined(_name)
|
||||
? (
|
||||
(address.length > 15)
|
||||
? `${address.slice(0, 7)}…${address.slice(-7)}`
|
||||
: address
|
||||
)
|
||||
: _name;
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user