Skip to content
AccountCard.js 1.11 KiB
Newer Older
Amaury Martiny's avatar
Amaury Martiny committed
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
Amaury Martiny's avatar
Amaury Martiny committed
// SPDX-License-Identifier: BSD-3-Clause
Amaury Martiny's avatar
Amaury Martiny committed

import React from 'react';
import Blockies from 'react-blockies';
import PropTypes from 'prop-types';

import Card from '../Card';
import Placeholder from '../Placeholder';

const AccountCard = ({ address, animate, name, ...otherProps }) => (
Amaury Martiny's avatar
Amaury Martiny committed
  <Card {...otherProps}>
    <div className='account'>
      <div className='account_avatar'>
        {address ? (
          <Blockies seed={address.toLowerCase()} />
        ) : (
          <Placeholder animate={animate} height={36} width={36} />
Amaury Martiny's avatar
Amaury Martiny committed
        )}
      </div>
      <div className='account_information'>
        {name ? (
          <div className='account_name'>{name}</div>
        ) : (
          <Placeholder animate={animate} height={18} width={100} />
Amaury Martiny's avatar
Amaury Martiny committed
        )}
        <div className='account_address'>
          {address || <Placeholder animate={animate} height={12} width={150} />}
Amaury Martiny's avatar
Amaury Martiny committed
        </div>
      </div>
    </div>
  </Card>
);

AccountCard.propTypes = {
  address: PropTypes.string,
  name: PropTypes.string
};

export default AccountCard;