diff --git a/package.json b/package.json index 62795433..e1217a56 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "license": "LGPL-3.0+", "scripts": { - "dev": "babel-node ./webpack/server.js --library", + "dev": "babel-node ./webpack/server.js --connect", "dev:library": "babel-node ./webpack/server.js --library", "dev:connect": "babel-node ./webpack/server.js --connect", "build": "rm -rf build && webpack --config ./webpack/webpack.config.prod.babel.js", diff --git a/src/images/browser-chrome.png b/src/images/browser-chrome.png new file mode 100644 index 00000000..29573624 Binary files /dev/null and b/src/images/browser-chrome.png differ diff --git a/src/images/browser-firefox.png b/src/images/browser-firefox.png new file mode 100644 index 00000000..577e6dc0 Binary files /dev/null and b/src/images/browser-firefox.png differ diff --git a/src/js/components/landing/ConnectDevice.js b/src/js/components/landing/ConnectDevice.js index f5dcb671..7fb78238 100644 --- a/src/js/components/landing/ConnectDevice.js +++ b/src/js/components/landing/ConnectDevice.js @@ -1,36 +1,57 @@ /* @flow */ 'use strict'; -import React from 'react'; -import Header from '../common/Header'; -import Footer from '../common/Footer'; +import React, { Component } from 'react'; +import TrezorConnect from 'trezor-connect'; -export default (props: any): any => { - return ( -
-
+export default class InstallBridge extends Component { + + componentDidUpdate() { + if (this.props.transport.indexOf('webusb') >= 0) + TrezorConnect.renderWebUSBButton(); + } + + render() { + let webusb = null; + let connectClaim = 'Connect TREZOR to continue'; + let and = null; + let bridgeClaim = null; + if (this.props.transport.indexOf('webusb') >= 0) { + webusb = ; + connectClaim = 'Connect TREZOR'; + and =

and

; + bridgeClaim = Device not recognized? Try installing the TREZOR Bridge.; + } + + return (
-

The private bank in your hands.

+

The private bank in your hands.

TREZOR Wallet is an easy-to-use interface for your TREZOR.

TREZOR Wallet allows you to easily control your funds, manage your balance and initiate transfers.

- - - - - - - - - Connect TREZOR to continue + + + + + + + + + + { connectClaim } + +

+ { and } + { webusb } +
+
+

+ { bridgeClaim } + Don't have TREZOR? Get one

- {/*

Don't have TREZOR? Get one

*/}
-
-

Don't have TREZOR? Get one

-
- ); + ); + } } \ No newline at end of file diff --git a/src/js/components/landing/InstallBridge.js b/src/js/components/landing/InstallBridge.js new file mode 100644 index 00000000..a3c3fac4 --- /dev/null +++ b/src/js/components/landing/InstallBridge.js @@ -0,0 +1,64 @@ +/* @flow */ +'use strict'; + +import React, { Component } from 'react'; +import Select from 'react-select'; + +type State = { + version: string; + target: string; + url: string; +} + +const installers = [ + { id: 'Windows', value: 'trezor-bridge-2.0.11-win32-install.exe', label: 'Windows' }, + { id: 'macOS', value: 'trezor-bridge-2.0.11.pkg', label: 'Mac OS X' }, + { id: 'Linux', value: 'trezor-bridge_2.0.11_amd64.deb', label: 'Linux 64-bit (deb)' }, + { id: 'Linux-rpm', value: 'trezor-bridge_2.0.11_amd64.rpm', label: 'Linux 64-bit (rpm)' }, + { value: 'trezor-bridge_2.0.11_amd32.deb', label: 'Linux 32-bit (deb)' }, + { value: 'trezor-bridge_2.0.11_amd32.rpm', label: 'Linux 32-bit (rpm)' }, +]; + +export default class InstallBridge extends Component { + + state: State; + + constructor(props) { + super(props); + + const currentTarget = installers.find(i => i.id === props.browserState.osname); + this.state = { + version: '2.0.11', + target: currentTarget, + url: 'https://wallet.trezor.io/data/bridge/2.0.11/' + }; + } + + onChange(value) { + this.setState({ + target: value + }); + } + + render() { + const url = `${ this.state.url }${ this.state.target.value }`; + return ( +
+

TREZOR Bridge. Version 2.0.11

+

New communication tool to facilitate the connection between your TREZOR and your internet browser.

+
+