1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Convert Mascot component to use JSX (#7535)

This commit is contained in:
Whymarrh Whitby 2019-11-24 01:29:18 -03:30 committed by GitHub
parent c51914c1a5
commit 439fce8901
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,5 @@
import React, { Component } from 'react'
const inherits = require('util').inherits
const Component = require('react').Component
const h = require('react-hyperscript')
const metamaskLogo = require('metamask-logo')
const debounce = require('debounce')
@ -20,15 +19,17 @@ function Mascot ({width = '200', height = '200'}) {
this.unfollowMouse = this.logo.setFollowMouse.bind(this.logo, false)
}
Mascot.prototype.render = function () {
Mascot.prototype.render = function Mascot () {
// this is a bit hacky
// the event emitter is on `this.props`
// and we dont get that until render
this.handleAnimationEvents()
return h('#metamask-mascot-container', {
style: { zIndex: 0 },
})
return (
<div
id="metamask-mascot-container"
style={{ zIndex: 0 }}
/>
)
}
Mascot.prototype.componentDidMount = function () {