mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Convert TokenMenuDropdown component to use JSX (#7552)
This commit is contained in:
parent
d948a3b195
commit
666277b4fa
@ -1,6 +1,5 @@
|
|||||||
const Component = require('react').Component
|
import PropTypes from 'prop-types'
|
||||||
const PropTypes = require('prop-types')
|
import React, { Component } from 'react'
|
||||||
const h = require('react-hyperscript')
|
|
||||||
const inherits = require('util').inherits
|
const inherits = require('util').inherits
|
||||||
const connect = require('react-redux').connect
|
const connect = require('react-redux').connect
|
||||||
const actions = require('../../../store/actions')
|
const actions = require('../../../store/actions')
|
||||||
@ -40,29 +39,29 @@ TokenMenuDropdown.prototype.onClose = function (e) {
|
|||||||
this.props.onClose()
|
this.props.onClose()
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenMenuDropdown.prototype.render = function () {
|
TokenMenuDropdown.prototype.render = function TokenMenuDropdown () {
|
||||||
const { showHideTokenConfirmationModal } = this.props
|
const { showHideTokenConfirmationModal } = this.props
|
||||||
|
|
||||||
return h(Menu, { className: 'token-menu-dropdown', isShowing: true }, [
|
return (
|
||||||
h(CloseArea, {
|
<Menu className="token-menu-dropdown" isShowing>
|
||||||
onClick: this.onClose,
|
<CloseArea onClick={this.onClose} />
|
||||||
}),
|
<Item
|
||||||
h(Item, {
|
onClick={(e) => {
|
||||||
onClick: (e) => {
|
e.stopPropagation()
|
||||||
e.stopPropagation()
|
showHideTokenConfirmationModal(this.props.token)
|
||||||
showHideTokenConfirmationModal(this.props.token)
|
this.props.onClose()
|
||||||
this.props.onClose()
|
}}
|
||||||
},
|
text={this.context.t('hideToken')}
|
||||||
text: this.context.t('hideToken'),
|
/>
|
||||||
}),
|
<Item
|
||||||
h(Item, {
|
onClick={(e) => {
|
||||||
onClick: (e) => {
|
e.stopPropagation()
|
||||||
e.stopPropagation()
|
const url = genAccountLink(this.props.token.address, this.props.network)
|
||||||
const url = genAccountLink(this.props.token.address, this.props.network)
|
global.platform.openWindow({ url })
|
||||||
global.platform.openWindow({ url })
|
this.props.onClose()
|
||||||
this.props.onClose()
|
}}
|
||||||
},
|
text={this.context.t('viewOnEtherscan')}
|
||||||
text: this.context.t('viewOnEtherscan'),
|
/>
|
||||||
}),
|
</Menu>
|
||||||
])
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user