diff options
author | Jason Clark <jason@longview.tech> | 2017-11-26 06:11:29 +0800 |
---|---|---|
committer | Jason Clark <jason@longview.tech> | 2017-11-26 06:11:29 +0800 |
commit | bd48d858f4226da889760e259377637164f3099c (patch) | |
tree | 8a3b51f7a6bf86d441d03d57fd3e85cd4992cd68 | |
parent | 1b89ceb63aa7d96912eb32c8766ef566479dde41 (diff) | |
download | tangerine-wallet-browser-bd48d858f4226da889760e259377637164f3099c.tar tangerine-wallet-browser-bd48d858f4226da889760e259377637164f3099c.tar.gz tangerine-wallet-browser-bd48d858f4226da889760e259377637164f3099c.tar.bz2 tangerine-wallet-browser-bd48d858f4226da889760e259377637164f3099c.tar.lz tangerine-wallet-browser-bd48d858f4226da889760e259377637164f3099c.tar.xz tangerine-wallet-browser-bd48d858f4226da889760e259377637164f3099c.tar.zst tangerine-wallet-browser-bd48d858f4226da889760e259377637164f3099c.zip |
fixing blockies display issues
-rw-r--r-- | ui/app/components/identicon.js | 12 | ||||
-rw-r--r-- | ui/app/settings.js | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js index 3e2349dbe..7a3bd5394 100644 --- a/ui/app/components/identicon.js +++ b/ui/app/components/identicon.js @@ -67,10 +67,11 @@ IdenticonComponent.prototype.componentDidMount = function () { // eslint-disable-next-line react/no-find-dom-node var container = findDOMNode(this) + const diameter = props.diameter || this.defaultDiameter + if (useBlockie) { _generateBlockie(container, address) } else { - const diameter = props.diameter || this.defaultDiameter _generateJazzicon(container, address, diameter) } } @@ -91,18 +92,21 @@ IdenticonComponent.prototype.componentDidUpdate = function () { container.removeChild(children[i]) } + const diameter = props.diameter || this.defaultDiameter + if (useBlockie) { - _generateBlockie(container, address) + _generateBlockie(container, address, diameter) } else { - const diameter = props.diameter || this.defaultDiameter _generateJazzicon(container, address, diameter) } } } -function _generateBlockie(container, address) { +function _generateBlockie(container, address, diameter) { const img = new Image() img.src = toDataUrl(address) + const dia = !diameter || diameter < 50 ? 50 : diameter + img.height, img.width = dia * 1.25 container.appendChild(img) } diff --git a/ui/app/settings.js b/ui/app/settings.js index 949cbfb26..caa36d2b8 100644 --- a/ui/app/settings.js +++ b/ui/app/settings.js @@ -57,7 +57,7 @@ class Settings extends Component { return h('div.settings__content-row', [ h('div.settings__content-item', [ - h('span', 'Use Blockie Identicon'), + h('span', 'Use Blockies Identicon'), ]), h('div.settings__content-item', [ h('div.settings__content-item-col', [ |