mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
tweaking styling
This commit is contained in:
parent
dc7bd3c628
commit
41be4714c2
@ -3,25 +3,30 @@ const createElement = require('react').createElement
|
||||
const blockies = require("ethereum-blockies");
|
||||
|
||||
class BlockiesIdenticon extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
getOpts () {
|
||||
return {
|
||||
seed: this.props.seed || "foo",
|
||||
color: this.props.color || "#dfe",
|
||||
bgcolor: this.props.bgcolor || "#a71",
|
||||
size: this.props.size || 15,
|
||||
scale: this.props.scale || 3,
|
||||
spotcolor: this.props.spotcolor || "#000"
|
||||
seed: this.props.seed,
|
||||
color: this.props.color,
|
||||
bgcolor: this.props.bgcolor,
|
||||
size: this.props.size,
|
||||
scale: this.props.scale,
|
||||
spotcolor: this.props.spotcolor,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.draw();
|
||||
}
|
||||
|
||||
draw() {
|
||||
blockies.render(this.getOpts(), this.canvas);
|
||||
}
|
||||
|
||||
render() {
|
||||
return createElement("canvas", {ref: canvas => this.canvas = canvas});
|
||||
}
|
||||
|
@ -32,9 +32,22 @@ IdenticonComponent.prototype.render = function () {
|
||||
return address
|
||||
? (
|
||||
useBlockie
|
||||
? h(BlockiesIdenticon, {
|
||||
seed: address,
|
||||
})
|
||||
? h('div', {
|
||||
className: `${className} identicon`,
|
||||
style: {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
height: diameter,
|
||||
width: diameter,
|
||||
borderRadius: diameter / 2,
|
||||
overflow: 'hidden',
|
||||
},
|
||||
}, [
|
||||
h(BlockiesIdenticon, {
|
||||
seed: address
|
||||
})
|
||||
])
|
||||
: h('div', {
|
||||
className: `${className} identicon`,
|
||||
key: 'identicon-' + address,
|
||||
|
Loading…
Reference in New Issue
Block a user