diff --git a/src/js/components/common/Header.js b/src/js/components/common/Header.js index 2fe37ee7..6136aed6 100644 --- a/src/js/components/common/Header.js +++ b/src/js/components/common/Header.js @@ -47,7 +47,7 @@ const A = styled.a` } `; -const Header = () => ( +const Header = (): React$Element => ( diff --git a/src/js/components/wallet/aside/CoinSelection.js b/src/js/components/wallet/aside/CoinSelection.js index 550f65d6..10445424 100644 --- a/src/js/components/wallet/aside/CoinSelection.js +++ b/src/js/components/wallet/aside/CoinSelection.js @@ -1,54 +1,61 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { NavLink } from 'react-router-dom'; -import navigationConstants from '~/js/constants/navigation'; - -class CoinSelection extends Component { - getBaseUrl() { - const { selectedDevice } = this.props.wallet; - let baseUrl = ''; - if (selectedDevice && selectedDevice.features) { - baseUrl = `/device/${selectedDevice.features.device_id}`; - if (selectedDevice.instance) { - baseUrl += `:${selectedDevice.instance}`; - } +/* @flow */ + + +import React from 'react'; +import { Link, NavLink } from 'react-router-dom'; + +import type { Props } from './index'; +import type { TrezorDevice } from '~/flowtype'; + +const CoinSelection = (props: Props): React$Element => { + const { location } = props.router; + const { config } = props.localStorage; + const { selectedDevice } = props.wallet; + + let baseUrl: string = ''; + if (selectedDevice && selectedDevice.features) { + baseUrl = `/device/${selectedDevice.features.device_id}`; + if (selectedDevice.instance) { + baseUrl += `:${selectedDevice.instance}`; } - return baseUrl; } - render() { - const { config } = this.props.localStorage; + const walletCoins = config.coins.map((item) => { + const url = `${baseUrl}/network/${item.network}/account/0`; + const className = `coin ${item.network}`; return ( -
- {config.coins.map(item => ( - { item.name } - - ))} -
- Other coins (You will be redirected) -
- {navigationConstants.map(item => ( - {item.coinName} - - ))} - + + { item.name } + ); - } -} + }); -CoinSelection.propTypes = { - config: PropTypes.object, - wallet: PropTypes.object, - selectedDevice: PropTypes.object, - localStorage: PropTypes.object, + return ( +
+ { walletCoins } +
+ Other coins (You will be redirected) +
+ + Bitcoin + + + Litecoin + + + Bitcoin Cash + + + Bitcoin Gold + + + Dash + + + Zcash + +
+ ); }; export default CoinSelection; \ No newline at end of file diff --git a/src/js/components/wallet/pages/DeviceSettings.js b/src/js/components/wallet/pages/DeviceSettings.js index f14f5484..a02a2f62 100644 --- a/src/js/components/wallet/pages/DeviceSettings.js +++ b/src/js/components/wallet/pages/DeviceSettings.js @@ -6,7 +6,8 @@ import colors from '~/js/config/colors'; import ICONS from '~/js/constants/icons'; import { connect } from 'react-redux'; -const Section = styled.section``; +const Section = styled.section` +`; const P = styled.p` padding: 12px 0px 24px 0px; @@ -27,7 +28,7 @@ const Row = styled.div` padding-bottom: 98px; `; -const DeviceSettings = () => ( +export const DeviceSettings = () => (