Skip to content
AccountCard.js 968 B
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 PropTypes from 'prop-types';

Amaury Martiny's avatar
Amaury Martiny committed
import { Address } from './Address';
import { Avatar } from './Avatar';
import { Card } from '../Card';
Amaury Martiny's avatar
Amaury Martiny committed
import { Information } from './Information';
import { Name } from './Name';
Amaury Martiny's avatar
Amaury Martiny committed

export const AccountCard = ({
  address,
  name,
  type,
  shortAddress,
  ...otherProps
}) => (
Amaury Martiny's avatar
Amaury Martiny committed
  <Card {...otherProps}>
Amaury Martiny's avatar
Amaury Martiny committed
    <div className='account'>
      <Avatar address={address} type={type} />
      <Information>
        <Name name={name} />
        <Address address={address} short={shortAddress} />
      </Information>
Amaury Martiny's avatar
Amaury Martiny committed
    </div>
  </Card>
);

AccountCard.Address = Address;
AccountCard.Avatar = Avatar;
AccountCard.Information = Information;
AccountCard.Name = Name;

Amaury Martiny's avatar
Amaury Martiny committed
AccountCard.propTypes = {
  address: PropTypes.string,
  name: PropTypes.string,
  shortAddress: PropTypes.bool
Amaury Martiny's avatar
Amaury Martiny committed
};