From 43e28788d7763de61d5190e8cca406077b8bdd9a Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Fri, 19 Aug 2016 14:47:49 -0700 Subject: [PATCH] Create replacement logo for non-webgl --- ui/app/components/mascot.js | 10 ++++++++-- ui/app/unlock.js | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/app/components/mascot.js b/ui/app/components/mascot.js index ddd51f8ba..e99720e1b 100644 --- a/ui/app/components/mascot.js +++ b/ui/app/components/mascot.js @@ -34,10 +34,16 @@ Mascot.prototype.render = function () { } Mascot.prototype.componentDidMount = function () { - if (!this.logo) return var targetDivId = 'metamask-mascot-container' var container = document.getElementById(targetDivId) - container.appendChild(this.logo.canvas) + if (!this.logo) { + var staticLogo = document.createElement('img') + staticLogo.src = 'images/icon-128.png' + staticLogo.style.marginBottom = '20px' + container.appendChild(staticLogo) + } else { + container.appendChild(this.logo.canvas) + } } Mascot.prototype.componentWillUnmount = function () { diff --git a/ui/app/unlock.js b/ui/app/unlock.js index a7896d640..7cc1699c3 100644 --- a/ui/app/unlock.js +++ b/ui/app/unlock.js @@ -3,10 +3,11 @@ const Component = require('react').Component const h = require('react-hyperscript') const connect = require('react-redux').connect const actions = require('./actions') -const Mascot = require('./components/mascot') const getCaretCoordinates = require('textarea-caret') const EventEmitter = require('events').EventEmitter +const Mascot = require('./components/mascot') + module.exports = connect(mapStateToProps)(UnlockScreen) inherits(UnlockScreen, Component)