forked from austintgriffith/dapparatus
-
Notifications
You must be signed in to change notification settings - Fork 2
/
blockie.js
38 lines (33 loc) · 776 Bytes
/
blockie.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React, { Component } from 'react';
import deepmerge from 'deepmerge';
let defaultConfig = {}
defaultConfig.DEBUG = false;
defaultConfig.size = 2
import Blockies from 'react-blockies';
class Blockie extends Component {
constructor(props) {
super(props);
let config = defaultConfig
if(props.config) {
config = deepmerge(config, props.config)
}
this.state = {
config:config
}
}
render() {
let address = this.props.address
if(address && typeof address == "string"){
address = address.toLowerCase()
}else{
address = "0x0000000000000000000000000000000000000000"
}
return (
<Blockies
seed={address}
scale={this.state.config.size}
/>
)
}
}
export default Blockie;