mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
hotfix - identicon jazz bug
This commit is contained in:
parent
d9d442ed1f
commit
c8640537e6
@ -12,6 +12,9 @@ Heres some utilities for preparing the data uri:
|
|||||||
|
|
||||||
build a template using pure svg:
|
build a template using pure svg:
|
||||||
|
|
||||||
|
generate uri
|
||||||
|
'data:image/svg+xml;charset=utf-8,'+encodeURIComponent(svgSrc)
|
||||||
|
|
||||||
<svg xmlns='http://www.w3.org/2000/svg'
|
<svg xmlns='http://www.w3.org/2000/svg'
|
||||||
width='1000px' height='500px' viewBox='0 0 200 100'>
|
width='1000px' height='500px' viewBox='0 0 200 100'>
|
||||||
<rect x='0' y='0' width='100%' height='100%' fill='white' />
|
<rect x='0' y='0' width='100%' height='100%' fill='white' />
|
||||||
|
@ -14,7 +14,6 @@ function IdenticonComponent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
IdenticonComponent.prototype.render = function() {
|
IdenticonComponent.prototype.render = function() {
|
||||||
debugger
|
|
||||||
return (
|
return (
|
||||||
h('div', {
|
h('div', {
|
||||||
key: 'identicon-' + this.props.address,
|
key: 'identicon-' + this.props.address,
|
||||||
@ -38,8 +37,13 @@ IdenticonComponent.prototype.componentDidMount = function(){
|
|||||||
var numericRepresentation = jsNumberForAddress(address)
|
var numericRepresentation = jsNumberForAddress(address)
|
||||||
|
|
||||||
var container = findDOMNode(this)
|
var container = findDOMNode(this)
|
||||||
|
// jazzicon with hack to fix inline svg error
|
||||||
var identicon = jazzicon(this.diameter, numericRepresentation)
|
var identicon = jazzicon(this.diameter, numericRepresentation)
|
||||||
container.appendChild(identicon)
|
var identiconSrc = identicon.innerHTML
|
||||||
|
var dataUri = 'data:image/svg+xml;charset=utf-8,'+encodeURIComponent(identiconSrc)
|
||||||
|
var img = document.createElement('img')
|
||||||
|
img.src = dataUri
|
||||||
|
container.appendChild(img)
|
||||||
}
|
}
|
||||||
|
|
||||||
function jsNumberForAddress(address) {
|
function jsNumberForAddress(address) {
|
||||||
|
Loading…
Reference in New Issue
Block a user