// Copyright 2017-2018 @polkadot/app-staking authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. import { BareProps } from '@polkadot/ui-app/types'; import BN from 'bn.js'; import React from 'react'; import IdentityIcon from '@polkadot/ui-react/IdentityIcon'; import classes from './util/classes'; import toShortAddress from './util/toShortAddress'; import Balance from './Balance'; type Props = BareProps & { balance?: BN | Array, isShort?: boolean, value?: string, withBalance?: boolean }; export default class AddressMini extends React.PureComponent { render () { const { className, isShort = true, style, value } = this.props; if (!value) { return null; } return (
{isShort ? toShortAddress(value) : value}
{this.renderBalance()}
); } private renderBalance () { const { balance, value, withBalance = false } = this.props; if (!withBalance || !value) { return null; } return ( ); } }