1import React from 'react';
2import PropTypes from 'prop-types';
3import makeBlockie from 'ethereum-blockies-base64';
4import Button from './Button';
5import { invert } from '../../lib/state';
7const isValidAddress = address => /^0x[0-9a-fA-F]{40}$/.test(address);
9class ShowBlockie extends React.Component {
17 this.toggle = this.toggle.bind(this);
18 // this.close = this.close.bind(this)
21 toggle = () => this.setState(invert('open', this.state));
24 const { props, state } = this;
26 const display = state.open ? '' : 'super-hidden';
28 const isValid = isValidAddress(props.address);
31 <div className={`flex flex-column items-start ${props.className}`}>
37 {state.open ? 'Hide Blockie' : 'Display Blockie'}
43 className={`${display} mt-2`}
45 src={makeBlockie(props.address)}
57ShowBlockie.propTypes = {
58 className: PropTypes.string,
59 children: PropTypes.node,
60 style: PropTypes.object,
63ShowBlockie.defaultProps = {
70export default ShowBlockie;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list