aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-04-01 09:04:13 +0800
committerkumavis <aaron@kumavis.me>2017-04-01 09:04:13 +0800
commitaa06183c64b79316a4622e25791c29e785c7bce0 (patch)
tree4711fb76510b379cd6b7bc3fb2e07e87a0ef8b8b /ui
parent810f5881f6ad9fea9bcb25ea1ccaf9cdeb2c744f (diff)
downloadtangerine-wallet-browser-aa06183c64b79316a4622e25791c29e785c7bce0.tar
tangerine-wallet-browser-aa06183c64b79316a4622e25791c29e785c7bce0.tar.gz
tangerine-wallet-browser-aa06183c64b79316a4622e25791c29e785c7bce0.tar.bz2
tangerine-wallet-browser-aa06183c64b79316a4622e25791c29e785c7bce0.tar.lz
tangerine-wallet-browser-aa06183c64b79316a4622e25791c29e785c7bce0.tar.xz
tangerine-wallet-browser-aa06183c64b79316a4622e25791c29e785c7bce0.tar.zst
tangerine-wallet-browser-aa06183c64b79316a4622e25791c29e785c7bce0.zip
ui - use global.platform for extension interaction
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/account-info-link.js3
-rw-r--r--ui/app/components/buy-button-subview.js3
-rw-r--r--ui/app/components/shift-list-item.js5
-rw-r--r--ui/app/info.js24
4 files changed, 13 insertions, 22 deletions
diff --git a/ui/app/components/account-info-link.js b/ui/app/components/account-info-link.js
index 74bc7f40e..6526ab502 100644
--- a/ui/app/components/account-info-link.js
+++ b/ui/app/components/account-info-link.js
@@ -3,7 +3,6 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits
const Tooltip = require('./tooltip')
const genAccountLink = require('../../lib/account-link')
-const extension = require('extensionizer')
module.exports = AccountInfoLink
@@ -35,7 +34,7 @@ AccountInfoLink.prototype.render = function () {
style: {
margin: '5px',
},
- onClick () { extension.tabs.create({ url }) },
+ onClick () { global.platform.openWindow({ url }) },
}),
]),
])
diff --git a/ui/app/components/buy-button-subview.js b/ui/app/components/buy-button-subview.js
index 19279d1f6..2b1675b6d 100644
--- a/ui/app/components/buy-button-subview.js
+++ b/ui/app/components/buy-button-subview.js
@@ -5,7 +5,6 @@ const connect = require('react-redux').connect
const actions = require('../actions')
const CoinbaseForm = require('./coinbase-form')
const ShapeshiftForm = require('./shapeshift-form')
-const extension = require('extensionizer')
const Loading = require('./loading')
const TabBar = require('./tab-bar')
@@ -142,7 +141,7 @@ BuyButtonSubview.prototype.formVersionSubview = function () {
}
BuyButtonSubview.prototype.navigateTo = function (url) {
- extension.tabs.create({ url })
+ global.platform.openWindow({ url })
}
BuyButtonSubview.prototype.backButtonContext = function () {
diff --git a/ui/app/components/shift-list-item.js b/ui/app/components/shift-list-item.js
index da991f75f..96a7cba6e 100644
--- a/ui/app/components/shift-list-item.js
+++ b/ui/app/components/shift-list-item.js
@@ -4,7 +4,6 @@ const h = require('react-hyperscript')
const connect = require('react-redux').connect
const vreme = new (require('vreme'))
const explorerLink = require('../../lib/explorer-link')
-const extension = require('extensionizer')
const actions = require('../actions')
const addressSummary = require('../util').addressSummary
@@ -172,9 +171,7 @@ ShiftListItem.prototype.renderInfo = function () {
width: '200px',
overflow: 'hidden',
},
- onClick: () => extension.tabs.create({
- url,
- }),
+ onClick: () => global.platform.openWindow({ url }),
}, [
h('div', {
style: {
diff --git a/ui/app/info.js b/ui/app/info.js
index fa51ae41c..a6fdeb315 100644
--- a/ui/app/info.js
+++ b/ui/app/info.js
@@ -3,7 +3,6 @@ const Component = require('react').Component
const h = require('react-hyperscript')
const connect = require('react-redux').connect
const actions = require('./actions')
-const extension = require('extensionizer')
module.exports = connect(mapStateToProps)(InfoScreen)
@@ -17,13 +16,8 @@ function InfoScreen () {
}
InfoScreen.prototype.render = function () {
- var state = this.props
- var manifest
- try {
- manifest = extension.runtime.getManifest()
- } catch (e) {
- manifest = { version: '2.0.0' }
- }
+ const state = this.props
+ const version = global.platform.getVersion()
return (
h('.flex-column.flex-grow', [
@@ -53,7 +47,7 @@ InfoScreen.prototype.render = function () {
style: {
marginBottom: '10px',
},
- }, `Version: ${manifest.version}`),
+ }, `Version: ${version}`),
]),
h('div', {
@@ -110,10 +104,12 @@ InfoScreen.prototype.render = function () {
onClick (event) { this.navigateTo(event.target.href) },
}, [
h('img.icon-size', {
- src: manifest.icons['128'],
+ src: 'images/icon-128.png',
style: {
- filter: 'grayscale(100%)', /* IE6-9 */
- WebkitFilter: 'grayscale(100%)', /* Microsoft Edge and Firefox 35+ */
+ // IE6-9
+ filter: 'grayscale(100%)',
+ // Microsoft Edge and Firefox 35+
+ WebkitFilter: 'grayscale(100%)',
},
}),
h('div.info', 'Visit our web site'),
@@ -139,7 +135,7 @@ InfoScreen.prototype.render = function () {
h('a.info', {
target: '_blank',
style: { width: '85vw' },
- onClick () { extension.tabs.create({url: 'mailto:help@metamask.io?subject=Feedback'}) },
+ onClick () { this.navigateTo('mailto:help@metamask.io?subject=Feedback') },
}, 'Email us!'),
]),
@@ -158,5 +154,5 @@ InfoScreen.prototype.render = function () {
}
InfoScreen.prototype.navigateTo = function (url) {
- extension.tabs.create({ url })
+ global.platform.openWindow({ url })
}