diff --git a/public/data/appConfig.json b/public/data/appConfig.json index 2520b4cb..7f23c006 100644 --- a/public/data/appConfig.json +++ b/public/data/appConfig.json @@ -149,7 +149,7 @@ "url": "https://api.coingecko.com/api/v3/coins/ripple" } ], - + "transactions": false, "supportedBrowsers": { "chrome": { "version": 59, diff --git a/src/actions/TrezorConnectActions.js b/src/actions/TrezorConnectActions.js index 446c59b6..e9aa5ac9 100644 --- a/src/actions/TrezorConnectActions.js +++ b/src/actions/TrezorConnectActions.js @@ -159,10 +159,12 @@ export const init = (): AsyncAction => async ( if (buildUtils.isDev()) { // eslint-disable-next-line - window.__TREZOR_CONNECT_SRC = - typeof LOCAL === 'string' ? LOCAL : 'https://sisyfos.trezor.io/connect/'; // eslint-disable-line no-underscore-dangle - // window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://localhost:8088/'; // eslint-disable-line no-underscore-dangle + window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' + ? LOCAL + : 'https://connect.sldev.cz/feature/eth-ripple-get-account-info/'; // eslint-disable-line no-underscore-dangle window.TrezorConnect = TrezorConnect; + // typeof LOCAL === 'string' ? LOCAL : 'https://sisyfos.trezor.io/connect/'; // eslint-disable-line no-underscore-dangle + // window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://localhost:8088/'; // eslint-disable-line no-underscore-dangle } try { diff --git a/src/support/routes.js b/src/support/routes.js index 77f84172..e57d4160 100644 --- a/src/support/routes.js +++ b/src/support/routes.js @@ -77,6 +77,11 @@ export const routes: Array = [ pattern: '/device/:device', fields: ['device'], }, + { + name: 'wallet-account-transactions', + pattern: '/device/:device/network/:network/account/:account/transactions', + fields: ['device', 'network', 'account', 'transactions'], + }, { name: 'wallet-account-summary', pattern: '/device/:device/network/:network/account/:account', diff --git a/src/views/Wallet/components/TopNavigationAccount/index.js b/src/views/Wallet/components/TopNavigationAccount/index.js index b092c67b..df7263dc 100644 --- a/src/views/Wallet/components/TopNavigationAccount/index.js +++ b/src/views/Wallet/components/TopNavigationAccount/index.js @@ -109,6 +109,16 @@ class TopNavigationAccount extends React.PureComponent { + {config.transactions && ( + + + + + + )} diff --git a/src/views/Wallet/components/TopNavigationAccount/index.messages.js b/src/views/Wallet/components/TopNavigationAccount/index.messages.js index 31571ad9..303eacaf 100644 --- a/src/views/Wallet/components/TopNavigationAccount/index.messages.js +++ b/src/views/Wallet/components/TopNavigationAccount/index.messages.js @@ -3,6 +3,11 @@ import { defineMessages } from 'react-intl'; import type { Messages } from 'flowtype'; const definedMessages: Messages = defineMessages({ + TR_NAV_TRANSACTIONS: { + id: 'TR_NAV_TRANSACTIONS', + defaultMessage: 'Transactions', + description: 'Title of the navigation tab that contains tx history.', + }, TR_NAV_SUMMARY: { id: 'TR_NAV_SUMMARY', defaultMessage: 'Summary', diff --git a/src/views/Wallet/views/Account/Transactions/bitcoin/index.js b/src/views/Wallet/views/Account/Transactions/bitcoin/index.js new file mode 100644 index 00000000..c4bea72d --- /dev/null +++ b/src/views/Wallet/views/Account/Transactions/bitcoin/index.js @@ -0,0 +1,13 @@ +import React from 'react'; +import Title from 'views/Wallet/components/Title'; +import Content from 'views/Wallet/components/Content'; + +const BitcoinTransactions = () => { + return ( + + Bitcoin Transactions + + ); +}; + +export default BitcoinTransactions; diff --git a/src/views/Wallet/views/Account/Transactions/ethereum/index.js b/src/views/Wallet/views/Account/Transactions/ethereum/index.js new file mode 100644 index 00000000..4a98a978 --- /dev/null +++ b/src/views/Wallet/views/Account/Transactions/ethereum/index.js @@ -0,0 +1,13 @@ +import React from 'react'; +import Title from 'views/Wallet/components/Title'; +import Content from 'views/Wallet/components/Content'; + +const EthereumTransactions = () => { + return ( + + Ethereum Transactions + + ); +}; + +export default EthereumTransactions; diff --git a/src/views/Wallet/views/Account/Transactions/index.js b/src/views/Wallet/views/Account/Transactions/index.js new file mode 100644 index 00000000..dd301b36 --- /dev/null +++ b/src/views/Wallet/views/Account/Transactions/index.js @@ -0,0 +1,38 @@ +/* @flow */ +import React from 'react'; +import { connect } from 'react-redux'; + +import type { State } from 'flowtype'; + +import EthereumTransactions from './ethereum'; +import RippleTransactions from './ripple'; +import BitcoinTransactions from './bitcoin'; + +export type BaseProps = {| + selectedAccount: $ElementType, + localStorage: $ElementType, +|}; + +export default connect( + (state: State): BaseProps => ({ + selectedAccount: state.selectedAccount, + localStorage: state.localStorage, + }), + null +)((props: BaseProps) => { + const { config } = props.localStorage; + if (!config.transactions) return null; // turn off by feature tag + const { network } = props.selectedAccount; + if (!network || !config) return null; + + switch (network.type) { + case 'ethereum': + return ; + case 'ripple': + return ; + case 'bitcoin': + return ; + default: + return null; + } +}); diff --git a/src/views/Wallet/views/Account/Transactions/ripple/index.js b/src/views/Wallet/views/Account/Transactions/ripple/index.js new file mode 100644 index 00000000..9146f477 --- /dev/null +++ b/src/views/Wallet/views/Account/Transactions/ripple/index.js @@ -0,0 +1,13 @@ +import React from 'react'; +import Title from 'views/Wallet/components/Title'; +import Content from 'views/Wallet/components/Content'; + +const RippleTransactions = () => { + return ( + + Ripple Transactions + + ); +}; + +export default RippleTransactions; diff --git a/src/views/index.js b/src/views/index.js index c8191b6b..db5444a0 100644 --- a/src/views/index.js +++ b/src/views/index.js @@ -18,6 +18,7 @@ import InstallBridge from 'views/Landing/views/InstallBridge/Container'; // wallet views import WalletContainer from 'views/Wallet'; import AccountSummary from 'views/Wallet/views/Account/Summary'; +import AccountTransactions from 'views/Wallet/views/Account/Transactions'; import AccountSend from 'views/Wallet/views/Account/Send'; import AccountReceive from 'views/Wallet/views/Account/Receive'; import AccountSignVerify from 'views/Wallet/views/Account/SignVerify/Container'; @@ -109,6 +110,10 @@ const App = () => ( path={getPattern('wallet-account-summary')} component={AccountSummary} /> +