blowfish/src/renderer/screens/Preferences/Accounts/Saved.jsx

41 lines
980 B
React
Raw Normal View History

2019-09-09 00:13:38 +02:00
import React from 'react'
import PropTypes from 'prop-types'
import { toDataUrl } from 'ethereum-blockies'
import posed, { PoseGroup } from 'react-pose'
import { fadeIn } from '../../../components/Animations'
import styles from './Saved.module.css'
const Item = posed.li(fadeIn)
const Saved = ({ accounts, handleDelete }) => (
<PoseGroup>
{accounts.map(account => {
const identicon = account && toDataUrl(account)
return (
<Item key={account}>
<div>
<img className={styles.identicon} src={identicon} alt="Blockies" />
{account}
</div>
<button
className={styles.delete}
onClick={e => handleDelete(e, account)}
title="Remove account"
>
&times;
</button>
</Item>
)
})}
</PoseGroup>
)
Saved.propTypes = {
accounts: PropTypes.array.isRequired,
handleDelete: PropTypes.func.isRequired
}
export default Saved