import React from 'react'; import PropTypes from 'prop-types'; import makeBlockie from 'ethereum-blockies-base64'; import Button from './Button'; import { invert } from '../../lib/state'; const isValidAddress = address => /^0x[0-9a-fA-F]{40}$/.test(address); class ShowBlockie extends React.Component { constructor(props) { super(props); this.state = { open: false, }; this.toggle = this.toggle.bind(this); // this.close = this.close.bind(this) } toggle = () => this.setState(invert('open', this.state)); render() { const { props, state } = this; const display = state.open ? '' : 'super-hidden'; const isValid = isValidAddress(props.address); return (