mirror of
https://github.com/trezor/trezor-wallet
synced 2025-05-09 10:28:47 +00:00
Make better imports
This commit is contained in:
parent
b3bfff997a
commit
52fcaa3d8c
15
.babelrc
15
.babelrc
@ -15,9 +15,18 @@
|
|||||||
"polyfill": false,
|
"polyfill": false,
|
||||||
"regenerator": true
|
"regenerator": true
|
||||||
}],
|
}],
|
||||||
["babel-plugin-root-import", {
|
["module-resolver", {
|
||||||
"rootPathSuffix": "./src",
|
"root": ["."],
|
||||||
"rootPathPrefix": "~"
|
"alias": {
|
||||||
|
"config": "./src/js/config",
|
||||||
|
"constants": "./src/js/constants",
|
||||||
|
"components": "./src/js/components",
|
||||||
|
"actions": "./src/js/actions",
|
||||||
|
"reducers": "./src/js/reducers",
|
||||||
|
"support": "./src/js/support",
|
||||||
|
"utils": "./src/js/utils",
|
||||||
|
"services": "./src/js/services"
|
||||||
|
}
|
||||||
}],
|
}],
|
||||||
"babel-plugin-styled-components"
|
"babel-plugin-styled-components"
|
||||||
],
|
],
|
||||||
|
@ -25,16 +25,15 @@
|
|||||||
"spaced-comment": 0
|
"spaced-comment": 0
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"react",
|
|
||||||
"import",
|
"import",
|
||||||
|
"react",
|
||||||
"jest",
|
"jest",
|
||||||
"flowtype"
|
"flowtype"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"import/parser": "babel-eslint",
|
|
||||||
"import/resolver": {
|
"import/resolver": {
|
||||||
"babel-plugin-root-import": {}
|
"babel-module": {}
|
||||||
},
|
},
|
||||||
"import/ignore": [
|
"import/ignore": [
|
||||||
"\\.(scss|less|css)$"
|
"\\.(scss|less|css)$"
|
||||||
]
|
]
|
||||||
|
16
jsonconfig.json
Normal file
16
jsonconfig.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"*": [
|
||||||
|
"src/*"
|
||||||
|
],
|
||||||
|
"components/*": [
|
||||||
|
"./js/config/*"
|
||||||
|
],
|
||||||
|
"config/*": [
|
||||||
|
"./js/config/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -70,7 +70,7 @@
|
|||||||
"babel-cli": "^6.24.1",
|
"babel-cli": "^6.24.1",
|
||||||
"babel-eslint": "^8.2.6",
|
"babel-eslint": "^8.2.6",
|
||||||
"babel-loader": "^7.1.5",
|
"babel-loader": "^7.1.5",
|
||||||
"babel-plugin-root-import": "5",
|
"babel-plugin-module-resolver": "^3.1.1",
|
||||||
"babel-plugin-styled-components": "^1.5.1",
|
"babel-plugin-styled-components": "^1.5.1",
|
||||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||||
"babel-plugin-transform-flow-strip-types": "^6.22.0",
|
"babel-plugin-transform-flow-strip-types": "^6.22.0",
|
||||||
@ -81,11 +81,11 @@
|
|||||||
"babel-preset-react": "^6.24.1",
|
"babel-preset-react": "^6.24.1",
|
||||||
"css-loader": "0.28.11",
|
"css-loader": "0.28.11",
|
||||||
"duplicate-package-checker-webpack-plugin": "^3.0.0",
|
"duplicate-package-checker-webpack-plugin": "^3.0.0",
|
||||||
"eslint": "^4",
|
"eslint": "^5.3.0",
|
||||||
"eslint-config-airbnb": "^17.0.0",
|
"eslint-config-airbnb": "^17.0.0",
|
||||||
"eslint-import-resolver-babel-plugin-root-import": "^1.1.1",
|
"eslint-import-resolver-babel-module": "^4.0.0",
|
||||||
"eslint-plugin-flowtype": "^2.50.0",
|
"eslint-plugin-flowtype": "^2.50.0",
|
||||||
"eslint-plugin-import": "^2.13.0",
|
"eslint-plugin-import": "^2.14.0",
|
||||||
"eslint-plugin-jest": "^21.18.0",
|
"eslint-plugin-jest": "^21.18.0",
|
||||||
"eslint-plugin-jsx-a11y": "^6.1.1",
|
"eslint-plugin-jsx-a11y": "^6.1.1",
|
||||||
"eslint-plugin-react": "^7.10.0",
|
"eslint-plugin-react": "^7.10.0",
|
||||||
@ -94,7 +94,6 @@
|
|||||||
"jest": "^23.4.2",
|
"jest": "^23.4.2",
|
||||||
"less": "^3.0.1",
|
"less": "^3.0.1",
|
||||||
"less-loader": "4.1.0",
|
"less-loader": "4.1.0",
|
||||||
"styled-components-stylefmt": "^0.1.5",
|
|
||||||
"stylelint": "^9.4.0",
|
"stylelint": "^9.4.0",
|
||||||
"stylelint-config-standard": "^18.2.0",
|
"stylelint-config-standard": "^18.2.0",
|
||||||
"stylelint-config-styled-components": "^0.1.1",
|
"stylelint-config-styled-components": "^0.1.1",
|
||||||
|
@ -11,25 +11,25 @@ import type {
|
|||||||
PlainDispatch as ReduxPlainDispatch,
|
PlainDispatch as ReduxPlainDispatch,
|
||||||
} from 'redux';
|
} from 'redux';
|
||||||
|
|
||||||
import type { Reducers, ReducersState } from '~/js/reducers';
|
import type { Reducers, ReducersState } from 'reducers';
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
import type { SelectedAccountAction } from '~/js/actions/SelectedAccountActions';
|
import type { SelectedAccountAction } from 'actions/SelectedAccountActions';
|
||||||
import type { AccountAction } from '~/js/actions/AccountsActions';
|
import type { AccountAction } from 'actions/AccountsActions';
|
||||||
import type { DiscoveryAction } from '~/js/actions/DiscoveryActions';
|
import type { DiscoveryAction } from 'actions/DiscoveryActions';
|
||||||
import type { StorageAction } from '~/js/actions/LocalStorageActions';
|
import type { StorageAction } from 'actions/LocalStorageActions';
|
||||||
import type { LogAction } from '~/js/actions/LogActions';
|
import type { LogAction } from 'actions/LogActions';
|
||||||
import type { ModalAction } from '~/js/actions/ModalActions';
|
import type { ModalAction } from 'actions/ModalActions';
|
||||||
import type { NotificationAction } from '~/js/actions/NotificationActions';
|
import type { NotificationAction } from 'actions/NotificationActions';
|
||||||
import type { PendingTxAction } from '~/js/actions/PendingTxActions';
|
import type { PendingTxAction } from 'actions/PendingTxActions';
|
||||||
import type { ReceiveAction } from '~/js/actions/ReceiveActions';
|
import type { ReceiveAction } from 'actions/ReceiveActions';
|
||||||
import type { SendFormAction } from '~/js/actions/SendFormActions';
|
import type { SendFormAction } from 'actions/SendFormActions';
|
||||||
import type { SummaryAction } from '~/js/actions/SummaryActions';
|
import type { SummaryAction } from 'actions/SummaryActions';
|
||||||
import type { TokenAction } from '~/js/actions/TokenActions';
|
import type { TokenAction } from 'actions/TokenActions';
|
||||||
import type { TrezorConnectAction } from '~/js/actions/TrezorConnectActions';
|
import type { TrezorConnectAction } from 'actions/TrezorConnectActions';
|
||||||
import type { WalletAction } from '~/js/actions/WalletActions';
|
import type { WalletAction } from 'actions/WalletActions';
|
||||||
import type { Web3Action } from '~/js/actions/Web3Actions';
|
import type { Web3Action } from 'actions/Web3Actions';
|
||||||
import type { FiatRateAction } from '~/js/services/CoinmarketcapService'; // this service has no action file, all is written inside one file
|
import type { FiatRateAction } from 'services/CoinmarketcapService'; // this service has no action file, all is written inside one file
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
Device,
|
Device,
|
||||||
@ -68,7 +68,7 @@ export type UnknownDevice = $Exact<{
|
|||||||
+label: string,
|
+label: string,
|
||||||
+features: null,
|
+features: null,
|
||||||
state: ?string,
|
state: ?string,
|
||||||
|
|
||||||
remember: boolean; // device should be remembered
|
remember: boolean; // device should be remembered
|
||||||
connected: boolean; // device is connected
|
connected: boolean; // device is connected
|
||||||
available: boolean; // device cannot be used because of features.passphrase_protection is different then expected
|
available: boolean; // device cannot be used because of features.passphrase_protection is different then expected
|
||||||
@ -135,12 +135,12 @@ export type Action =
|
|||||||
export type State = ReducersState;
|
export type State = ReducersState;
|
||||||
|
|
||||||
// reexport reduces types
|
// reexport reduces types
|
||||||
export type { Coin } from '~/js/reducers/LocalStorageReducer';
|
export type { Coin } from 'reducers/LocalStorageReducer';
|
||||||
export type { Account } from '~/js/reducers/AccountsReducer';
|
export type { Account } from 'reducers/AccountsReducer';
|
||||||
export type { Discovery } from '~/js/reducers/DiscoveryReducer';
|
export type { Discovery } from 'reducers/DiscoveryReducer';
|
||||||
export type { Token } from '~/js/reducers/TokensReducer';
|
export type { Token } from 'reducers/TokensReducer';
|
||||||
export type { Web3Instance } from '~/js/reducers/Web3Reducer';
|
export type { Web3Instance } from 'reducers/Web3Reducer';
|
||||||
export type { PendingTx } from '~/js/reducers/PendingTxReducer';
|
export type { PendingTx } from 'reducers/PendingTxReducer';
|
||||||
|
|
||||||
export type Accounts = $ElementType<State, 'accounts'>;
|
export type Accounts = $ElementType<State, 'accounts'>;
|
||||||
export type LocalStorage = $ElementType<State, 'localStorage'>;
|
export type LocalStorage = $ElementType<State, 'localStorage'>;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
import * as ACCOUNT from './constants/account';
|
import * as ACCOUNT from './constants/account';
|
||||||
import type { Action, TrezorDevice } from '~/flowtype';
|
import type { Action, TrezorDevice } from 'flowtype';
|
||||||
import type { State } from '../reducers/AccountsReducer';
|
import type { State } from '../reducers/AccountsReducer';
|
||||||
|
|
||||||
export type AccountAction =
|
export type AccountAction =
|
||||||
|
@ -14,7 +14,7 @@ import { setBalance as setTokenBalance } from './TokenActions';
|
|||||||
|
|
||||||
import type {
|
import type {
|
||||||
ThunkAction, AsyncAction, Action, GetState, Dispatch, TrezorDevice,
|
ThunkAction, AsyncAction, Action, GetState, Dispatch, TrezorDevice,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
import type { Discovery, State } from '../reducers/DiscoveryReducer';
|
import type { Discovery, State } from '../reducers/DiscoveryReducer';
|
||||||
|
|
||||||
|
@ -11,11 +11,11 @@ import { JSONRequest, httpRequest } from '../utils/networkUtils';
|
|||||||
|
|
||||||
import type {
|
import type {
|
||||||
ThunkAction, AsyncAction, GetState, Dispatch, TrezorDevice,
|
ThunkAction, AsyncAction, GetState, Dispatch, TrezorDevice,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
import type { Config, Coin, TokensCollection } from '../reducers/LocalStorageReducer';
|
import type { Config, Coin, TokensCollection } from '../reducers/LocalStorageReducer';
|
||||||
|
|
||||||
import AppConfigJSON from '~/data/appConfig.json';
|
import AppConfigJSON from 'data/appConfig.json';
|
||||||
import Erc20AbiJSON from '~/data/ERC20Abi.json';
|
import Erc20AbiJSON from 'data/ERC20Abi.json';
|
||||||
|
|
||||||
export type StorageAction = {
|
export type StorageAction = {
|
||||||
type: typeof STORAGE.READY,
|
type: typeof STORAGE.READY,
|
||||||
|
@ -5,7 +5,7 @@ import * as LOG from './constants/log';
|
|||||||
|
|
||||||
import type {
|
import type {
|
||||||
Action, ThunkAction, GetState, Dispatch,
|
Action, ThunkAction, GetState, Dispatch,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
import type { LogEntry } from '../reducers/LogReducer';
|
import type { LogEntry } from '../reducers/LogReducer';
|
||||||
|
|
||||||
export type LogAction = {
|
export type LogAction = {
|
||||||
|
@ -8,7 +8,7 @@ import * as CONNECT from './constants/TrezorConnect';
|
|||||||
|
|
||||||
import type {
|
import type {
|
||||||
ThunkAction, AsyncAction, Action, GetState, Dispatch, TrezorDevice,
|
ThunkAction, AsyncAction, Action, GetState, Dispatch, TrezorDevice,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
import type { State } from '../reducers/ModalReducer';
|
import type { State } from '../reducers/ModalReducer';
|
||||||
|
|
||||||
export type ModalAction = {
|
export type ModalAction = {
|
||||||
|
@ -5,7 +5,7 @@ import * as NOTIFICATION from './constants/notification';
|
|||||||
|
|
||||||
import type {
|
import type {
|
||||||
Action, AsyncAction, GetState, Dispatch, RouterLocationState,
|
Action, AsyncAction, GetState, Dispatch, RouterLocationState,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
import type { CallbackAction } from '../reducers/NotificationReducer';
|
import type { CallbackAction } from '../reducers/NotificationReducer';
|
||||||
|
|
||||||
export type NotificationAction = {
|
export type NotificationAction = {
|
||||||
|
@ -10,7 +10,7 @@ import type { State } from '../reducers/ReceiveReducer';
|
|||||||
|
|
||||||
import type {
|
import type {
|
||||||
TrezorDevice, ThunkAction, AsyncAction, Action, GetState, Dispatch,
|
TrezorDevice, ThunkAction, AsyncAction, Action, GetState, Dispatch,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
export type ReceiveAction = {
|
export type ReceiveAction = {
|
||||||
type: typeof RECEIVE.INIT,
|
type: typeof RECEIVE.INIT,
|
||||||
|
@ -22,7 +22,7 @@ import type {
|
|||||||
GetState,
|
GetState,
|
||||||
Dispatch,
|
Dispatch,
|
||||||
State,
|
State,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
|
|
||||||
export type SelectedAccountAction = {
|
export type SelectedAccountAction = {
|
||||||
|
@ -28,7 +28,7 @@ import type {
|
|||||||
AsyncAction,
|
AsyncAction,
|
||||||
RouterLocationState,
|
RouterLocationState,
|
||||||
TrezorDevice,
|
TrezorDevice,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
import type { State as AccountState } from '../reducers/SelectedAccountReducer';
|
import type { State as AccountState } from '../reducers/SelectedAccountReducer';
|
||||||
import type { Web3Instance } from '../reducers/Web3Reducer';
|
import type { Web3Instance } from '../reducers/Web3Reducer';
|
||||||
import type { Config, Coin } from '../reducers/LocalStorageReducer';
|
import type { Config, Coin } from '../reducers/LocalStorageReducer';
|
||||||
|
@ -6,7 +6,7 @@ import type {
|
|||||||
ThunkAction,
|
ThunkAction,
|
||||||
GetState,
|
GetState,
|
||||||
Dispatch,
|
Dispatch,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
const PREFIX: string = 'trezor:draft-tx:';
|
const PREFIX: string = 'trezor:draft-tx:';
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import { initialState } from '../reducers/SummaryReducer';
|
|||||||
|
|
||||||
import type {
|
import type {
|
||||||
ThunkAction, AsyncAction, Action, GetState, Dispatch,
|
ThunkAction, AsyncAction, Action, GetState, Dispatch,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
import type { State } from '../reducers/SummaryReducer';
|
import type { State } from '../reducers/SummaryReducer';
|
||||||
import type { Token } from '../reducers/TokensReducer';
|
import type { Token } from '../reducers/TokensReducer';
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import { getTokenInfoAsync, getTokenBalanceAsync } from './Web3Actions';
|
|||||||
|
|
||||||
import type {
|
import type {
|
||||||
GetState, AsyncAction, Action, Dispatch,
|
GetState, AsyncAction, Action, Dispatch,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
import type { State, Token } from '../reducers/TokensReducer';
|
import type { State, Token } from '../reducers/TokensReducer';
|
||||||
import type { Account } from '../reducers/AccountsReducer';
|
import type { Account } from '../reducers/AccountsReducer';
|
||||||
import type { NetworkToken } from '../reducers/LocalStorageReducer';
|
import type { NetworkToken } from '../reducers/LocalStorageReducer';
|
||||||
|
@ -32,7 +32,7 @@ import type {
|
|||||||
AsyncAction,
|
AsyncAction,
|
||||||
TrezorDevice,
|
TrezorDevice,
|
||||||
RouterLocationState,
|
RouterLocationState,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
|
|
||||||
export type TrezorConnectAction = {
|
export type TrezorConnectAction = {
|
||||||
|
@ -22,7 +22,7 @@ import type
|
|||||||
Dispatch,
|
Dispatch,
|
||||||
GetState,
|
GetState,
|
||||||
State,
|
State,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
export type WalletAction = {
|
export type WalletAction = {
|
||||||
type: typeof WALLET.SET_INITIAL_URL,
|
type: typeof WALLET.SET_INITIAL_URL,
|
||||||
|
@ -21,7 +21,7 @@ import type {
|
|||||||
GetState,
|
GetState,
|
||||||
Action,
|
Action,
|
||||||
AsyncAction,
|
AsyncAction,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
import type { Account } from '../reducers/AccountsReducer';
|
import type { Account } from '../reducers/AccountsReducer';
|
||||||
import type { PendingTx } from '../reducers/PendingTxReducer';
|
import type { PendingTx } from '../reducers/PendingTxReducer';
|
||||||
|
@ -2,7 +2,7 @@ import styled, { css } from 'styled-components';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import colors from '~/js/config/colors';
|
import colors from 'config/colors';
|
||||||
|
|
||||||
const Wrapper = styled.button`
|
const Wrapper = styled.button`
|
||||||
padding: 12px 24px;
|
padding: 12px 24px;
|
||||||
|
@ -5,8 +5,8 @@ import { getYear } from 'date-fns';
|
|||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import colors from '~/js/config/colors';
|
import colors from 'config/colors';
|
||||||
import * as LogActions from '~/js/actions/LogActions';
|
import * as LogActions from 'actions/LogActions';
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import colors from '~/js/config/colors';
|
import colors from 'config/colors';
|
||||||
|
|
||||||
const Wrapper = styled.header`
|
const Wrapper = styled.header`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
import colors from '~/js/config/colors';
|
import colors from 'config/colors';
|
||||||
|
|
||||||
const baseStyles = css`
|
const baseStyles = css`
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
|
|
||||||
import * as LogActions from '~/js/actions/LogActions';
|
import * as LogActions from 'actions/LogActions';
|
||||||
import type { State, Dispatch } from '~/flowtype';
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
|
||||||
const Log = (props: Props): ?React$Element<string> => {
|
const Log = (props: Props): ?React$Element<string> => {
|
||||||
if (!props.log.opened) return null;
|
if (!props.log.opened) return null;
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import * as NOTIFICATION from '~/js/actions/constants/notification';
|
import * as NOTIFICATION from 'actions/constants/notification';
|
||||||
import * as NotificationActions from '~/js/actions/NotificationActions';
|
import * as NotificationActions from 'actions/NotificationActions';
|
||||||
import type { Action, State, Dispatch } from '~/flowtype';
|
import type { Action, State, Dispatch } from 'flowtype';
|
||||||
import Loader from './LoaderCircle';
|
import Loader from './LoaderCircle';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import TrezorConnect from 'trezor-connect';
|
import TrezorConnect from 'trezor-connect';
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
|
|
||||||
import type { State, TrezorDevice } from '~/flowtype';
|
import type { State, TrezorDevice } from 'flowtype';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
transport: $PropertyType<$ElementType<State, 'connect'>, 'transport'>;
|
transport: $PropertyType<$ElementType<State, 'connect'>, 'transport'>;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
import installers from '~/js/constants/bridge';
|
import installers from 'constants/bridge';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import Select from 'react-select';
|
import Select from 'react-select';
|
||||||
import Preloader from './Preloader';
|
import Preloader from './Preloader';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Preloader from './Preloader';
|
import Preloader from './Preloader';
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
import ConnectDevice from './ConnectDevice';
|
import ConnectDevice from './ConnectDevice';
|
||||||
import InstallBridge from './InstallBridge';
|
import InstallBridge from './InstallBridge';
|
||||||
import LocalStorageError from './LocalStorageError';
|
import LocalStorageError from './LocalStorageError';
|
||||||
|
@ -8,7 +8,7 @@ import { connect } from 'react-redux';
|
|||||||
import LandingPage from './LandingPage';
|
import LandingPage from './LandingPage';
|
||||||
|
|
||||||
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
||||||
import type { State, Dispatch } from '~/flowtype';
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
|
||||||
export type StateProps = {
|
export type StateProps = {
|
||||||
localStorage: $ElementType<State, 'localStorage'>,
|
localStorage: $ElementType<State, 'localStorage'>,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { findAccount } from '~/js/reducers/AccountsReducer';
|
import { findAccount } from 'reducers/AccountsReducer';
|
||||||
|
|
||||||
import type { Props } from './index';
|
import type { Props } from './index';
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { getNewInstance } from '~/js/reducers/DevicesReducer';
|
import { getNewInstance } from 'reducers/DevicesReducer';
|
||||||
import type { Props } from './index';
|
import type { Props } from './index';
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
|
@ -10,8 +10,8 @@ import { CSSTransition, Transition } from 'react-transition-group';
|
|||||||
|
|
||||||
import { UI } from 'trezor-connect';
|
import { UI } from 'trezor-connect';
|
||||||
|
|
||||||
import { default as ModalActions } from '~/js/actions/ModalActions';
|
import { default as ModalActions } from 'actions/ModalActions';
|
||||||
import { default as ReceiveActions } from '~/js/actions/ReceiveActions';
|
import { default as ReceiveActions } from 'actions/ReceiveActions';
|
||||||
|
|
||||||
import Pin from './Pin';
|
import Pin from './Pin';
|
||||||
import InvalidPin from './InvalidPin';
|
import InvalidPin from './InvalidPin';
|
||||||
@ -22,12 +22,12 @@ import ConfirmAddress, { ConfirmUnverifiedAddress } from './ConfirmAddress';
|
|||||||
import RememberDevice, { ForgetDevice } from './RememberDevice';
|
import RememberDevice, { ForgetDevice } from './RememberDevice';
|
||||||
import DuplicateDevice from './DuplicateDevice';
|
import DuplicateDevice from './DuplicateDevice';
|
||||||
|
|
||||||
import * as RECEIVE from '~/js/actions/constants/receive';
|
import * as RECEIVE from 'actions/constants/receive';
|
||||||
import * as MODAL from '~/js/actions/constants/modal';
|
import * as MODAL from 'actions/constants/modal';
|
||||||
import * as CONNECT from '~/js/actions/constants/TrezorConnect';
|
import * as CONNECT from 'actions/constants/TrezorConnect';
|
||||||
|
|
||||||
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
||||||
import type { State, Dispatch } from '~/flowtype';
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
|
||||||
type OwnProps = { }
|
type OwnProps = { }
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Notification } from '~/js/components/common/Notification';
|
import { Notification } from 'components/common/Notification';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
State, TrezorDevice, Action, ThunkAction,
|
State, TrezorDevice, Action, ThunkAction,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
import type { Account } from '~/js/reducers/AccountsReducer';
|
import type { Account } from 'reducers/AccountsReducer';
|
||||||
import type { Discovery } from '~/js/reducers/DiscoveryReducer';
|
import type { Discovery } from 'reducers/DiscoveryReducer';
|
||||||
|
|
||||||
export type StateProps = {
|
export type StateProps = {
|
||||||
className: string;
|
className: string;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
|
|
||||||
import Tooltip from 'rc-tooltip';
|
import Tooltip from 'rc-tooltip';
|
||||||
import { QRCode } from 'react-qr-svg';
|
import { QRCode } from 'react-qr-svg';
|
||||||
|
|
||||||
import SelectedAccount from '../SelectedAccount';
|
import SelectedAccount from '../SelectedAccount';
|
||||||
import { Notification } from '~/js/components/common/Notification';
|
import { Notification } from 'components/common/Notification';
|
||||||
|
|
||||||
import type { Props } from './index';
|
import type { Props } from './index';
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@ import React, { Component, PropTypes } from 'react';
|
|||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { default as ReceiveActions } from '~/js/actions/ReceiveActions';
|
import { default as ReceiveActions } from 'actions/ReceiveActions';
|
||||||
import * as TokenActions from '~/js/actions/TokenActions';
|
import * as TokenActions from 'actions/TokenActions';
|
||||||
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
||||||
import Receive from './Receive';
|
import Receive from './Receive';
|
||||||
|
|
||||||
import type { State, Dispatch } from '~/flowtype';
|
import type { State, Dispatch } from 'flowtype';
|
||||||
import type {
|
import type {
|
||||||
StateProps as BaseStateProps,
|
StateProps as BaseStateProps,
|
||||||
DispatchProps as BaseDispatchProps,
|
DispatchProps as BaseDispatchProps,
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ColorHash from 'color-hash';
|
import ColorHash from 'color-hash';
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
import ScaleText from 'react-scale-text';
|
import ScaleText from 'react-scale-text';
|
||||||
|
|
||||||
import { findAccountTokens } from '~/js/reducers/TokensReducer';
|
import { findAccountTokens } from 'reducers/TokensReducer';
|
||||||
|
|
||||||
import type { Coin } from '~/js/reducers/LocalStorageReducer';
|
import type { Coin } from 'reducers/LocalStorageReducer';
|
||||||
import type { Token } from '~/js/reducers/TokensReducer';
|
import type { Token } from 'reducers/TokensReducer';
|
||||||
import type { Props as BaseProps } from './index';
|
import type { Props as BaseProps } from './index';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
@ -3,18 +3,18 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import Select from 'react-select';
|
import Select from 'react-select';
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
import AdvancedForm from './AdvancedForm';
|
import AdvancedForm from './AdvancedForm';
|
||||||
import PendingTransactions from './PendingTransactions';
|
import PendingTransactions from './PendingTransactions';
|
||||||
import { FeeSelectValue, FeeSelectOption } from './FeeSelect';
|
import { FeeSelectValue, FeeSelectOption } from './FeeSelect';
|
||||||
import SelectedAccount from '../SelectedAccount';
|
import SelectedAccount from '../SelectedAccount';
|
||||||
import { findAccountTokens } from '~/js/reducers/TokensReducer';
|
import { findAccountTokens } from 'reducers/TokensReducer';
|
||||||
import { calculate, validation } from '~/js/actions/SendFormActions';
|
import { calculate, validation } from 'actions/SendFormActions';
|
||||||
|
|
||||||
import { findToken } from '~/js/reducers/TokensReducer';
|
import { findToken } from 'reducers/TokensReducer';
|
||||||
|
|
||||||
import type { Props } from './index';
|
import type { Props } from './index';
|
||||||
import type { Token } from '~/flowtype';
|
import type { Token } from 'flowtype';
|
||||||
|
|
||||||
export default class SendContainer extends Component<Props> {
|
export default class SendContainer extends Component<Props> {
|
||||||
componentWillReceiveProps(newProps: Props) {
|
componentWillReceiveProps(newProps: Props) {
|
||||||
|
@ -5,12 +5,12 @@ import * as React from 'react';
|
|||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { default as SendFormActions } from '~/js/actions/SendFormActions';
|
import { default as SendFormActions } from 'actions/SendFormActions';
|
||||||
import * as SessionStorageActions from '~/js/actions/SessionStorageActions';
|
import * as SessionStorageActions from 'actions/SessionStorageActions';
|
||||||
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
||||||
import SendForm from './SendForm';
|
import SendForm from './SendForm';
|
||||||
|
|
||||||
import type { State, Dispatch } from '~/flowtype';
|
import type { State, Dispatch } from 'flowtype';
|
||||||
import type { StateProps as BaseStateProps, DispatchProps as BaseDispatchProps } from '../SelectedAccount';
|
import type { StateProps as BaseStateProps, DispatchProps as BaseDispatchProps } from '../SelectedAccount';
|
||||||
|
|
||||||
type OwnProps = { }
|
type OwnProps = { }
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
import colors from '~/js/config/colors';
|
import colors from 'config/colors';
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import { Async as AsyncSelect } from 'react-select';
|
import { Async as AsyncSelect } from 'react-select';
|
||||||
import Tooltip from 'rc-tooltip';
|
import Tooltip from 'rc-tooltip';
|
||||||
|
|
||||||
import { resolveAfter } from '~/js/utils/promiseUtils';
|
import { resolveAfter } from 'utils/promiseUtils';
|
||||||
import SelectedAccount from '../SelectedAccount';
|
import SelectedAccount from '../SelectedAccount';
|
||||||
import { Notification } from '~/js/components/common/Notification';
|
import { Notification } from 'components/common/Notification';
|
||||||
import SummaryDetails from './SummaryDetails.js';
|
import SummaryDetails from './SummaryDetails.js';
|
||||||
import SummaryTokens from './SummaryTokens.js';
|
import SummaryTokens from './SummaryTokens.js';
|
||||||
import * as stateUtils from '~/js/reducers/utils';
|
import * as stateUtils from 'reducers/utils';
|
||||||
|
|
||||||
import type { Props } from './index';
|
import type { Props } from './index';
|
||||||
import type { NetworkToken } from '~/js/reducers/LocalStorageReducer';
|
import type { NetworkToken } from 'reducers/LocalStorageReducer';
|
||||||
|
|
||||||
const StyledH2 = styled(H2)`
|
const StyledH2 = styled(H2)`
|
||||||
padding: 20px 48px;
|
padding: 20px 48px;
|
||||||
|
@ -5,7 +5,7 @@ import React from 'react';
|
|||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
|
|
||||||
import type { Props as BaseProps } from './index';
|
import type { Props as BaseProps } from './index';
|
||||||
import type { Coin } from '~/js/reducers/LocalStorageReducer';
|
import type { Coin } from 'reducers/LocalStorageReducer';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
// coin: $PropertyType<$ElementType<BaseProps, 'selectedAccount'>, 'coin'>,
|
// coin: $PropertyType<$ElementType<BaseProps, 'selectedAccount'>, 'coin'>,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ColorHash from 'color-hash';
|
import ColorHash from 'color-hash';
|
||||||
import ScaleText from 'react-scale-text';
|
import ScaleText from 'react-scale-text';
|
||||||
import * as stateUtils from '~/js/reducers/utils';
|
import * as stateUtils from 'reducers/utils';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
|
|
||||||
import type { Props as BaseProps } from './index';
|
import type { Props as BaseProps } from './index';
|
||||||
|
@ -7,10 +7,10 @@ import { connect } from 'react-redux';
|
|||||||
|
|
||||||
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
||||||
import Summary from './Summary';
|
import Summary from './Summary';
|
||||||
import * as SummaryActions from '~/js/actions/SummaryActions';
|
import * as SummaryActions from 'actions/SummaryActions';
|
||||||
import * as TokenActions from '~/js/actions/TokenActions';
|
import * as TokenActions from 'actions/TokenActions';
|
||||||
|
|
||||||
import type { State, Dispatch } from '~/flowtype';
|
import type { State, Dispatch } from 'flowtype';
|
||||||
import type { StateProps as BaseStateProps, DispatchProps as BaseDispatchProps } from '../SelectedAccount';
|
import type { StateProps as BaseStateProps, DispatchProps as BaseDispatchProps } from '../SelectedAccount';
|
||||||
|
|
||||||
type OwnProps = { }
|
type OwnProps = { }
|
||||||
|
@ -5,13 +5,13 @@ import React, { PureComponent } from 'react';
|
|||||||
import { Link, NavLink } from 'react-router-dom';
|
import { Link, NavLink } from 'react-router-dom';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
|
|
||||||
import { findDeviceAccounts } from '~/js/reducers/AccountsReducer';
|
import { findDeviceAccounts } from 'reducers/AccountsReducer';
|
||||||
import * as stateUtils from '~/js/reducers/utils';
|
import * as stateUtils from 'reducers/utils';
|
||||||
import Loader from '~/js/components/common/LoaderCircle';
|
import Loader from 'components/common/LoaderCircle';
|
||||||
import Tooltip from 'rc-tooltip';
|
import Tooltip from 'rc-tooltip';
|
||||||
|
|
||||||
import type { Props } from './index';
|
import type { Props } from './index';
|
||||||
import type { TrezorDevice, Accounts } from '~/flowtype';
|
import type { TrezorDevice, Accounts } from 'flowtype';
|
||||||
|
|
||||||
const AccountSelection = (props: Props): ?React$Element<string> => {
|
const AccountSelection = (props: Props): ?React$Element<string> => {
|
||||||
const selected = props.wallet.selectedDevice;
|
const selected = props.wallet.selectedDevice;
|
||||||
|
@ -12,7 +12,7 @@ import CoinSelection from './CoinSelection';
|
|||||||
import StickyContainer from './StickyContainer';
|
import StickyContainer from './StickyContainer';
|
||||||
|
|
||||||
import type { Props } from './index';
|
import type { Props } from './index';
|
||||||
import type { TrezorDevice } from '~/flowtype';
|
import type { TrezorDevice } from 'flowtype';
|
||||||
|
|
||||||
|
|
||||||
type TransitionMenuProps = {
|
type TransitionMenuProps = {
|
||||||
|
@ -5,7 +5,7 @@ import React from 'react';
|
|||||||
import { Link, NavLink } from 'react-router-dom';
|
import { Link, NavLink } from 'react-router-dom';
|
||||||
|
|
||||||
import type { Props } from './index';
|
import type { Props } from './index';
|
||||||
import type { TrezorDevice } from '~/flowtype';
|
import type { TrezorDevice } from 'flowtype';
|
||||||
|
|
||||||
const CoinSelection = (props: Props): React$Element<string> => {
|
const CoinSelection = (props: Props): React$Element<string> => {
|
||||||
const { location } = props.router;
|
const { location } = props.router;
|
||||||
|
@ -6,7 +6,7 @@ import Select from 'react-select';
|
|||||||
import TrezorConnect from 'trezor-connect';
|
import TrezorConnect from 'trezor-connect';
|
||||||
|
|
||||||
import type { Props } from './index';
|
import type { Props } from './index';
|
||||||
import type { TrezorDevice } from '~/flowtype';
|
import type { TrezorDevice } from 'flowtype';
|
||||||
|
|
||||||
export const DeviceSelect = (props: Props) => {
|
export const DeviceSelect = (props: Props) => {
|
||||||
const { devices } = props;
|
const { devices } = props;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import raf from 'raf';
|
import raf from 'raf';
|
||||||
import { getViewportHeight, getScrollY } from '~/js/utils/windowUtils';
|
import { getViewportHeight, getScrollY } from 'utils/windowUtils';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
location: string,
|
location: string,
|
||||||
|
@ -6,13 +6,13 @@ import { bindActionCreators } from 'redux';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { withRouter } from 'react-router-dom';
|
import { withRouter } from 'react-router-dom';
|
||||||
|
|
||||||
import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
|
import * as TrezorConnectActions from 'actions/TrezorConnectActions';
|
||||||
import { toggleDeviceDropdown } from '~/js/actions/WalletActions';
|
import { toggleDeviceDropdown } from 'actions/WalletActions';
|
||||||
|
|
||||||
import Aside from './Aside';
|
import Aside from './Aside';
|
||||||
|
|
||||||
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
||||||
import type { State, Dispatch } from '~/flowtype';
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ import Notifications from '../common/Notification';
|
|||||||
import Log from '../common/Log';
|
import Log from '../common/Log';
|
||||||
|
|
||||||
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
||||||
import type { State, Dispatch } from '~/flowtype';
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
|
||||||
type WalletContainerProps = {
|
type WalletContainerProps = {
|
||||||
wallet: $ElementType<State, 'wallet'>,
|
wallet: $ElementType<State, 'wallet'>,
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { Notification } from '~/js/components/common/Notification';
|
import { Notification } from 'components/common/Notification';
|
||||||
import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
|
import * as TrezorConnectActions from 'actions/TrezorConnectActions';
|
||||||
|
|
||||||
import type { State, Dispatch } from '~/flowtype';
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
acquiring: boolean;
|
acquiring: boolean;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ import React from 'react';
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
import DashboardImg from '~/images/dashboard.png';
|
import DashboardImg from 'images/dashboard.png';
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
import Icon from '~/js/components/common/Icon';
|
import Icon from 'components/common/Icon';
|
||||||
import colors from '~/js/config/colors';
|
import colors from 'config/colors';
|
||||||
import Button from '~/js/components/common/Button';
|
import Button from 'components/common/Button';
|
||||||
import ICONS from '~/js/constants/icons';
|
import ICONS from 'constants/icons';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
const Section = styled.section`
|
const Section = styled.section`
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
import { H2 } from '~/js/components/common/Heading';
|
import { H2 } from 'components/common/Heading';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { Notification } from '~/js/components/common/Notification';
|
import { Notification } from 'components/common/Notification';
|
||||||
import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
|
import * as TrezorConnectActions from 'actions/TrezorConnectActions';
|
||||||
|
|
||||||
import type { State, Dispatch } from '~/flowtype';
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
acquiring: boolean;
|
acquiring: boolean;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import baseStyles from '~/js/support/BaseStyles';
|
import baseStyles from 'support/BaseStyles';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
import App from './router';
|
import App from './router';
|
||||||
import { onBeforeUnload } from './actions/WalletActions';
|
import { onBeforeUnload } from './actions/WalletActions';
|
||||||
import styles from '~/styles/index.less';
|
import styles from 'styles/index.less';
|
||||||
|
|
||||||
const root: ?HTMLElement = document.getElementById('root');
|
const root: ?HTMLElement = document.getElementById('root');
|
||||||
if (root) {
|
if (root) {
|
||||||
|
@ -5,7 +5,7 @@ import * as CONNECT from '../actions/constants/TrezorConnect';
|
|||||||
import * as WALLET from '../actions/constants/wallet';
|
import * as WALLET from '../actions/constants/wallet';
|
||||||
import * as ACCOUNT from '../actions/constants/account';
|
import * as ACCOUNT from '../actions/constants/account';
|
||||||
|
|
||||||
import type { Action, TrezorDevice } from '~/flowtype';
|
import type { Action, TrezorDevice } from 'flowtype';
|
||||||
import type {
|
import type {
|
||||||
AccountCreateAction,
|
AccountCreateAction,
|
||||||
AccountSetBalanceAction,
|
AccountSetBalanceAction,
|
||||||
|
@ -6,7 +6,7 @@ import type { Device } from 'trezor-connect';
|
|||||||
import * as CONNECT from '../actions/constants/TrezorConnect';
|
import * as CONNECT from '../actions/constants/TrezorConnect';
|
||||||
import * as WALLET from '../actions/constants/wallet';
|
import * as WALLET from '../actions/constants/wallet';
|
||||||
|
|
||||||
import type { Action, TrezorDevice } from '~/flowtype';
|
import type { Action, TrezorDevice } from 'flowtype';
|
||||||
|
|
||||||
export type State = Array<TrezorDevice>;
|
export type State = Array<TrezorDevice>;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import * as ACCOUNT from '../actions/constants/account';
|
|||||||
import * as CONNECT from '../actions/constants/TrezorConnect';
|
import * as CONNECT from '../actions/constants/TrezorConnect';
|
||||||
import * as WALLET from '../actions/constants/wallet';
|
import * as WALLET from '../actions/constants/wallet';
|
||||||
|
|
||||||
import type { Action, TrezorDevice } from '~/flowtype';
|
import type { Action, TrezorDevice } from 'flowtype';
|
||||||
import type {
|
import type {
|
||||||
DiscoveryStartAction,
|
DiscoveryStartAction,
|
||||||
DiscoveryWaitingAction,
|
DiscoveryWaitingAction,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import { RATE_UPDATE } from '../services/CoinmarketcapService';
|
import { RATE_UPDATE } from '../services/CoinmarketcapService';
|
||||||
|
|
||||||
import type { Action } from '~/flowtype';
|
import type { Action } from 'flowtype';
|
||||||
import type { FiatRateAction } from '../services/CoinmarketcapService';
|
import type { FiatRateAction } from '../services/CoinmarketcapService';
|
||||||
|
|
||||||
export type Fiat = {
|
export type Fiat = {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import * as STORAGE from '../actions/constants/localStorage';
|
import * as STORAGE from '../actions/constants/localStorage';
|
||||||
|
|
||||||
import type { Action } from '~/flowtype';
|
import type { Action } from 'flowtype';
|
||||||
|
|
||||||
export type Coin = {
|
export type Coin = {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import * as LOG from '../actions/constants/log';
|
import * as LOG from '../actions/constants/log';
|
||||||
import type { Action } from '~/flowtype';
|
import type { Action } from 'flowtype';
|
||||||
|
|
||||||
export type LogEntry = {
|
export type LogEntry = {
|
||||||
time: number;
|
time: number;
|
||||||
|
@ -6,7 +6,7 @@ import * as RECEIVE from '../actions/constants/receive';
|
|||||||
import * as MODAL from '../actions/constants/modal';
|
import * as MODAL from '../actions/constants/modal';
|
||||||
import * as CONNECT from '../actions/constants/TrezorConnect';
|
import * as CONNECT from '../actions/constants/TrezorConnect';
|
||||||
|
|
||||||
import type { Action, TrezorDevice } from '~/flowtype';
|
import type { Action, TrezorDevice } from 'flowtype';
|
||||||
|
|
||||||
export type State = {
|
export type State = {
|
||||||
opened: false;
|
opened: false;
|
||||||
|
@ -5,7 +5,7 @@ import { LOCATION_CHANGE } from 'react-router-redux';
|
|||||||
import * as NOTIFICATION from '../actions/constants/notification';
|
import * as NOTIFICATION from '../actions/constants/notification';
|
||||||
import { DEVICE } from 'trezor-connect';
|
import { DEVICE } from 'trezor-connect';
|
||||||
|
|
||||||
import type { Action } from '~/flowtype';
|
import type { Action } from 'flowtype';
|
||||||
|
|
||||||
export type CallbackAction = {
|
export type CallbackAction = {
|
||||||
label: string;
|
label: string;
|
||||||
|
@ -5,7 +5,7 @@ import * as PENDING from '../actions/constants/pendingTx';
|
|||||||
import * as SEND from '../actions/constants/send';
|
import * as SEND from '../actions/constants/send';
|
||||||
import * as WEB3 from '../actions/constants/web3';
|
import * as WEB3 from '../actions/constants/web3';
|
||||||
|
|
||||||
import type { Action } from '~/flowtype';
|
import type { Action } from 'flowtype';
|
||||||
import type { SendTxAction } from '../actions/SendFormActions';
|
import type { SendTxAction } from '../actions/SendFormActions';
|
||||||
|
|
||||||
export type PendingTx = {
|
export type PendingTx = {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
import { UI } from 'trezor-connect';
|
import { UI } from 'trezor-connect';
|
||||||
import * as RECEIVE from '../actions/constants/receive';
|
import * as RECEIVE from '../actions/constants/receive';
|
||||||
import * as ACCOUNT from '../actions/constants/account';
|
import * as ACCOUNT from '../actions/constants/account';
|
||||||
import type { Action } from '~/flowtype';
|
import type { Action } from 'flowtype';
|
||||||
|
|
||||||
|
|
||||||
export type State = {
|
export type State = {
|
||||||
|
@ -11,7 +11,7 @@ import type {
|
|||||||
PendingTx,
|
PendingTx,
|
||||||
Discovery,
|
Discovery,
|
||||||
Web3Instance,
|
Web3Instance,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
export type State = {
|
export type State = {
|
||||||
location?: string;
|
location?: string;
|
||||||
|
@ -10,7 +10,7 @@ import * as WALLET from '../actions/constants/wallet';
|
|||||||
|
|
||||||
import { getFeeLevels } from '../actions/SendFormActions';
|
import { getFeeLevels } from '../actions/SendFormActions';
|
||||||
|
|
||||||
import type { Action } from '~/flowtype';
|
import type { Action } from 'flowtype';
|
||||||
import type {
|
import type {
|
||||||
Web3UpdateGasPriceAction,
|
Web3UpdateGasPriceAction,
|
||||||
} from '../actions/Web3Actions';
|
} from '../actions/Web3Actions';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import * as ACCOUNT from '../actions/constants/account';
|
import * as ACCOUNT from '../actions/constants/account';
|
||||||
import * as SUMMARY from '../actions/constants/summary';
|
import * as SUMMARY from '../actions/constants/summary';
|
||||||
import type { Action } from '~/flowtype';
|
import type { Action } from 'flowtype';
|
||||||
import type { NetworkToken } from './LocalStorageReducer';
|
import type { NetworkToken } from './LocalStorageReducer';
|
||||||
|
|
||||||
export type State = {
|
export type State = {
|
||||||
|
@ -5,7 +5,7 @@ import * as CONNECT from '../actions/constants/TrezorConnect';
|
|||||||
import * as WALLET from '../actions/constants/wallet';
|
import * as WALLET from '../actions/constants/wallet';
|
||||||
import * as TOKEN from '../actions/constants/token';
|
import * as TOKEN from '../actions/constants/token';
|
||||||
|
|
||||||
import type { Action, TrezorDevice } from '~/flowtype';
|
import type { Action, TrezorDevice } from 'flowtype';
|
||||||
import type { Account } from './AccountsReducer';
|
import type { Account } from './AccountsReducer';
|
||||||
|
|
||||||
export type Token = {
|
export type Token = {
|
||||||
|
@ -6,7 +6,7 @@ import type { Device } from 'trezor-connect';
|
|||||||
import * as CONNECT from '../actions/constants/TrezorConnect';
|
import * as CONNECT from '../actions/constants/TrezorConnect';
|
||||||
import * as WALLET from '../actions/constants/wallet';
|
import * as WALLET from '../actions/constants/wallet';
|
||||||
|
|
||||||
import type { Action, TrezorDevice } from '~/flowtype';
|
import type { Action, TrezorDevice } from 'flowtype';
|
||||||
|
|
||||||
export type SelectedDevice = {
|
export type SelectedDevice = {
|
||||||
id: string; // could be device path if unacquired or features.device_id
|
id: string; // could be device path if unacquired or features.device_id
|
||||||
|
@ -9,7 +9,7 @@ import * as WALLET from '../actions/constants/wallet';
|
|||||||
import * as CONNECT from '../actions/constants/TrezorConnect';
|
import * as CONNECT from '../actions/constants/TrezorConnect';
|
||||||
|
|
||||||
|
|
||||||
import type { Action, RouterLocationState, TrezorDevice } from '~/flowtype';
|
import type { Action, RouterLocationState, TrezorDevice } from 'flowtype';
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
ready: boolean;
|
ready: boolean;
|
||||||
|
@ -7,7 +7,7 @@ import type { ContractFactory } from 'web3';
|
|||||||
import * as STORAGE from '../actions/constants/localStorage';
|
import * as STORAGE from '../actions/constants/localStorage';
|
||||||
import * as WEB3 from '../actions/constants/web3';
|
import * as WEB3 from '../actions/constants/web3';
|
||||||
|
|
||||||
import type { Action } from '~/flowtype';
|
import type { Action } from 'flowtype';
|
||||||
import type {
|
import type {
|
||||||
Web3UpdateBlockAction,
|
Web3UpdateBlockAction,
|
||||||
Web3UpdateGasPriceAction,
|
Web3UpdateGasPriceAction,
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
|
|
||||||
import * as LogActions from '~/js/actions/LogActions';
|
import * as LogActions from 'actions/LogActions';
|
||||||
import * as STORAGE from '~/js/actions/constants/localStorage';
|
import * as STORAGE from 'actions/constants/localStorage';
|
||||||
import * as WALLET from '~/js/actions/constants/wallet';
|
import * as WALLET from 'actions/constants/wallet';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
@ -22,7 +22,7 @@ import type {
|
|||||||
Token,
|
Token,
|
||||||
PendingTx,
|
PendingTx,
|
||||||
Web3Instance,
|
Web3Instance,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
export const getSelectedDevice = (state: State): ?TrezorDevice => {
|
export const getSelectedDevice = (state: State): ?TrezorDevice => {
|
||||||
const locationState = state.router.location.state;
|
const locationState = state.router.location.state;
|
||||||
|
@ -5,7 +5,7 @@ import { Provider } from 'react-redux';
|
|||||||
import { ConnectedRouter } from 'react-router-redux';
|
import { ConnectedRouter } from 'react-router-redux';
|
||||||
import store, { history } from '../store';
|
import store, { history } from '../store';
|
||||||
|
|
||||||
import ErrorBoundary from '~/js/support/ErrorBoundary';
|
import ErrorBoundary from 'support/ErrorBoundary';
|
||||||
|
|
||||||
import LandingPageContainer from '../components/landing';
|
import LandingPageContainer from '../components/landing';
|
||||||
import WalletContainer from '../components/wallet';
|
import WalletContainer from '../components/wallet';
|
||||||
|
@ -14,7 +14,7 @@ import type {
|
|||||||
Action,
|
Action,
|
||||||
AsyncAction,
|
AsyncAction,
|
||||||
GetState,
|
GetState,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
import type { Config, FiatValueTicker } from '../reducers/LocalStorageReducer';
|
import type { Config, FiatValueTicker } from '../reducers/LocalStorageReducer';
|
||||||
|
|
||||||
export const RATE_UPDATE: 'rate__update' = 'rate__update';
|
export const RATE_UPDATE: 'rate__update' = 'rate__update';
|
||||||
|
@ -25,9 +25,9 @@ import type {
|
|||||||
Action,
|
Action,
|
||||||
AsyncAction,
|
AsyncAction,
|
||||||
GetState,
|
GetState,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
import type { TrezorDevice } from '~/flowtype';
|
import type { TrezorDevice } from 'flowtype';
|
||||||
import type { Account } from '../reducers/AccountsReducer';
|
import type { Account } from '../reducers/AccountsReducer';
|
||||||
import type { Token } from '../reducers/TokensReducer';
|
import type { Token } from '../reducers/TokensReducer';
|
||||||
import type { PendingTx } from '../reducers/PendingTxReducer';
|
import type { PendingTx } from '../reducers/PendingTxReducer';
|
||||||
|
@ -16,7 +16,7 @@ import type {
|
|||||||
Action,
|
Action,
|
||||||
AsyncAction,
|
AsyncAction,
|
||||||
GetState,
|
GetState,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
const exclude: Array<string> = [
|
const exclude: Array<string> = [
|
||||||
ADD, OPEN, CLOSE,
|
ADD, OPEN, CLOSE,
|
||||||
|
@ -19,7 +19,7 @@ import type {
|
|||||||
GetState,
|
GetState,
|
||||||
RouterLocationState,
|
RouterLocationState,
|
||||||
TrezorDevice,
|
TrezorDevice,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Middleware used for init application and managing router path.
|
* Middleware used for init application and managing router path.
|
||||||
|
@ -26,7 +26,7 @@ import type {
|
|||||||
AsyncAction,
|
AsyncAction,
|
||||||
GetState,
|
GetState,
|
||||||
RouterLocationState,
|
RouterLocationState,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
const TrezorConnectService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispatch) => (action: Action): Action => {
|
const TrezorConnectService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispatch) => (action: Action): Action => {
|
||||||
const prevState: $ElementType<State, 'connect'> = api.getState().connect;
|
const prevState: $ElementType<State, 'connect'> = api.getState().connect;
|
||||||
|
@ -15,7 +15,7 @@ import type {
|
|||||||
MiddlewareAPI,
|
MiddlewareAPI,
|
||||||
MiddlewareDispatch,
|
MiddlewareDispatch,
|
||||||
Action,
|
Action,
|
||||||
} from '~/flowtype';
|
} from 'flowtype';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Middleware
|
* Middleware
|
||||||
|
@ -14,7 +14,7 @@ import services from '../services';
|
|||||||
import Raven from 'raven-js';
|
import Raven from 'raven-js';
|
||||||
import RavenMiddleware from 'redux-raven-middleware';
|
import RavenMiddleware from 'redux-raven-middleware';
|
||||||
|
|
||||||
import type { Action, GetState, Store } from '~/flowtype';
|
import type { Action, GetState, Store } from 'flowtype';
|
||||||
|
|
||||||
export const history: History = createHistory({ queryKey: false });
|
export const history: History = createHistory({ queryKey: false });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user