A Metamask fork with Infura removed and default networks editable
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ciphermask/ui/app/components/pages/create-account/connect-hardware/connect-screen.js

79 lines
2.5 KiB

6 years ago
const { Component } = require('react')
const PropTypes = require('prop-types')
const h = require('react-hyperscript')
6 years ago
class ConnectScreen extends Component {
6 years ago
constructor (props, context) {
super(props)
}
renderUnsupportedBrowser () {
return (
6 years ago
h('div', {}, [
h('div.hw-connect', [
h('h3.hw-connect__title', {}, this.context.t('browserNotSupported')),
h('p.hw-connect__msg', {}, this.context.t('chromeRequiredForTrezor')),
6 years ago
]),
h(
'button.btn-primary.btn--large',
{
onClick: () => global.platform.openWindow({
url: 'https://google.com/chrome',
}),
},
6 years ago
this.context.t('downloadGoogleChrome')
),
])
6 years ago
)
}
renderConnectScreen () {
return (
h('div.new-account-connect-form', {}, [
h('div.hw-connect', [
h('h3.hw-connect__title', {}, this.context.t('trezorHardwareWallet')),
h('p.hw-connect__msg', {}, this.context.t('connectToTrezorHelp')),
h('p.hw-connect__msg', {}, [
this.context.t('connectToTrezorTrouble'),
6 years ago
h('a.hw-connect__link', {
href: 'https://support.metamask.io/',
target: '_blank',
}, ` ${this.context.t('learnMore')}`),
]),
]),
h(
6 years ago
'button.btn-primary.btn--large',
{ onClick: this.props.connectToTrezor.bind(this) },
6 years ago
this.props.btnText
),
h('div.hw-connect__get-trezor', {}, [
h('a', {
href: 'https://shop.trezor.io/?a=metamask',
target: '_blank',
}, this.context.t('getYourTrezor')),
]),
])
)
6 years ago
}
render () {
if (this.props.browserSupported) {
return this.renderConnectScreen()
6 years ago
}
6 years ago
return this.renderUnsupportedBrowser()
6 years ago
}
}
ConnectScreen.propTypes = {
connectToTrezor: PropTypes.func.isRequired,
btnText: PropTypes.string.isRequired,
browserSupported: PropTypes.bool.isRequired,
6 years ago
}
ConnectScreen.contextTypes = {
t: PropTypes.func,
}
6 years ago
module.exports = ConnectScreen