Make better imports

pull/3/head
Vladimir Volek 6 years ago
parent b3bfff997a
commit 52fcaa3d8c

@ -15,9 +15,18 @@
"polyfill": false,
"regenerator": true
}],
["babel-plugin-root-import", {
"rootPathSuffix": "./src",
"rootPathPrefix": "~"
["module-resolver", {
"root": ["."],
"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"
],

@ -25,16 +25,15 @@
"spaced-comment": 0
},
"plugins": [
"react",
"import",
"react",
"jest",
"flowtype"
],
"settings": {
"import/parser": "babel-eslint",
"import/resolver": {
"babel-plugin-root-import": {}
},
"babel-module": {}
},
"import/ignore": [
"\\.(scss|less|css)$"
]

@ -0,0 +1,16 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"*": [
"src/*"
],
"components/*": [
"./js/config/*"
],
"config/*": [
"./js/config/*"
]
}
}
}

@ -70,7 +70,7 @@
"babel-cli": "^6.24.1",
"babel-eslint": "^8.2.6",
"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-transform-class-properties": "^6.24.1",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
@ -81,11 +81,11 @@
"babel-preset-react": "^6.24.1",
"css-loader": "0.28.11",
"duplicate-package-checker-webpack-plugin": "^3.0.0",
"eslint": "^4",
"eslint": "^5.3.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-import": "^2.13.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.18.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.10.0",
@ -94,7 +94,6 @@
"jest": "^23.4.2",
"less": "^3.0.1",
"less-loader": "4.1.0",
"styled-components-stylefmt": "^0.1.5",
"stylelint": "^9.4.0",
"stylelint-config-standard": "^18.2.0",
"stylelint-config-styled-components": "^0.1.1",

@ -11,25 +11,25 @@ import type {
PlainDispatch as ReduxPlainDispatch,
} from 'redux';
import type { Reducers, ReducersState } from '~/js/reducers';
import type { Reducers, ReducersState } from 'reducers';
// Actions
import type { SelectedAccountAction } from '~/js/actions/SelectedAccountActions';
import type { AccountAction } from '~/js/actions/AccountsActions';
import type { DiscoveryAction } from '~/js/actions/DiscoveryActions';
import type { StorageAction } from '~/js/actions/LocalStorageActions';
import type { LogAction } from '~/js/actions/LogActions';
import type { ModalAction } from '~/js/actions/ModalActions';
import type { NotificationAction } from '~/js/actions/NotificationActions';
import type { PendingTxAction } from '~/js/actions/PendingTxActions';
import type { ReceiveAction } from '~/js/actions/ReceiveActions';
import type { SendFormAction } from '~/js/actions/SendFormActions';
import type { SummaryAction } from '~/js/actions/SummaryActions';
import type { TokenAction } from '~/js/actions/TokenActions';
import type { TrezorConnectAction } from '~/js/actions/TrezorConnectActions';
import type { WalletAction } from '~/js/actions/WalletActions';
import type { Web3Action } from '~/js/actions/Web3Actions';
import type { FiatRateAction } from '~/js/services/CoinmarketcapService'; // this service has no action file, all is written inside one file
import type { SelectedAccountAction } from 'actions/SelectedAccountActions';
import type { AccountAction } from 'actions/AccountsActions';
import type { DiscoveryAction } from 'actions/DiscoveryActions';
import type { StorageAction } from 'actions/LocalStorageActions';
import type { LogAction } from 'actions/LogActions';
import type { ModalAction } from 'actions/ModalActions';
import type { NotificationAction } from 'actions/NotificationActions';
import type { PendingTxAction } from 'actions/PendingTxActions';
import type { ReceiveAction } from 'actions/ReceiveActions';
import type { SendFormAction } from 'actions/SendFormActions';
import type { SummaryAction } from 'actions/SummaryActions';
import type { TokenAction } from 'actions/TokenActions';
import type { TrezorConnectAction } from 'actions/TrezorConnectActions';
import type { WalletAction } from 'actions/WalletActions';
import type { Web3Action } from 'actions/Web3Actions';
import type { FiatRateAction } from 'services/CoinmarketcapService'; // this service has no action file, all is written inside one file
import type {
Device,
@ -68,7 +68,7 @@ export type UnknownDevice = $Exact<{
+label: string,
+features: null,
state: ?string,
remember: boolean; // device should be remembered
connected: boolean; // device is connected
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;
// reexport reduces types
export type { Coin } from '~/js/reducers/LocalStorageReducer';
export type { Account } from '~/js/reducers/AccountsReducer';
export type { Discovery } from '~/js/reducers/DiscoveryReducer';
export type { Token } from '~/js/reducers/TokensReducer';
export type { Web3Instance } from '~/js/reducers/Web3Reducer';
export type { PendingTx } from '~/js/reducers/PendingTxReducer';
export type { Coin } from 'reducers/LocalStorageReducer';
export type { Account } from 'reducers/AccountsReducer';
export type { Discovery } from 'reducers/DiscoveryReducer';
export type { Token } from 'reducers/TokensReducer';
export type { Web3Instance } from 'reducers/Web3Reducer';
export type { PendingTx } from 'reducers/PendingTxReducer';
export type Accounts = $ElementType<State, 'accounts'>;
export type LocalStorage = $ElementType<State, 'localStorage'>;

@ -1,7 +1,7 @@
/* @flow */
import * as ACCOUNT from './constants/account';
import type { Action, TrezorDevice } from '~/flowtype';
import type { Action, TrezorDevice } from 'flowtype';
import type { State } from '../reducers/AccountsReducer';
export type AccountAction =

@ -14,7 +14,7 @@ import { setBalance as setTokenBalance } from './TokenActions';
import type {
ThunkAction, AsyncAction, Action, GetState, Dispatch, TrezorDevice,
} from '~/flowtype';
} from 'flowtype';
import type { Discovery, State } from '../reducers/DiscoveryReducer';

@ -11,11 +11,11 @@ import { JSONRequest, httpRequest } from '../utils/networkUtils';
import type {
ThunkAction, AsyncAction, GetState, Dispatch, TrezorDevice,
} from '~/flowtype';
} from 'flowtype';
import type { Config, Coin, TokensCollection } from '../reducers/LocalStorageReducer';
import AppConfigJSON from '~/data/appConfig.json';
import Erc20AbiJSON from '~/data/ERC20Abi.json';
import AppConfigJSON from 'data/appConfig.json';
import Erc20AbiJSON from 'data/ERC20Abi.json';
export type StorageAction = {
type: typeof STORAGE.READY,

@ -5,7 +5,7 @@ import * as LOG from './constants/log';
import type {
Action, ThunkAction, GetState, Dispatch,
} from '~/flowtype';
} from 'flowtype';
import type { LogEntry } from '../reducers/LogReducer';
export type LogAction = {

@ -8,7 +8,7 @@ import * as CONNECT from './constants/TrezorConnect';
import type {
ThunkAction, AsyncAction, Action, GetState, Dispatch, TrezorDevice,
} from '~/flowtype';
} from 'flowtype';
import type { State } from '../reducers/ModalReducer';
export type ModalAction = {

@ -5,7 +5,7 @@ import * as NOTIFICATION from './constants/notification';
import type {
Action, AsyncAction, GetState, Dispatch, RouterLocationState,
} from '~/flowtype';
} from 'flowtype';
import type { CallbackAction } from '../reducers/NotificationReducer';
export type NotificationAction = {

@ -10,7 +10,7 @@ import type { State } from '../reducers/ReceiveReducer';
import type {
TrezorDevice, ThunkAction, AsyncAction, Action, GetState, Dispatch,
} from '~/flowtype';
} from 'flowtype';
export type ReceiveAction = {
type: typeof RECEIVE.INIT,

@ -22,7 +22,7 @@ import type {
GetState,
Dispatch,
State,
} from '~/flowtype';
} from 'flowtype';
export type SelectedAccountAction = {

@ -28,7 +28,7 @@ import type {
AsyncAction,
RouterLocationState,
TrezorDevice,
} from '~/flowtype';
} from 'flowtype';
import type { State as AccountState } from '../reducers/SelectedAccountReducer';
import type { Web3Instance } from '../reducers/Web3Reducer';
import type { Config, Coin } from '../reducers/LocalStorageReducer';

@ -6,7 +6,7 @@ import type {
ThunkAction,
GetState,
Dispatch,
} from '~/flowtype';
} from 'flowtype';
const PREFIX: string = 'trezor:draft-tx:';

@ -9,7 +9,7 @@ import { initialState } from '../reducers/SummaryReducer';
import type {
ThunkAction, AsyncAction, Action, GetState, Dispatch,
} from '~/flowtype';
} from 'flowtype';
import type { State } from '../reducers/SummaryReducer';
import type { Token } from '../reducers/TokensReducer';

@ -6,7 +6,7 @@ import { getTokenInfoAsync, getTokenBalanceAsync } from './Web3Actions';
import type {
GetState, AsyncAction, Action, Dispatch,
} from '~/flowtype';
} from 'flowtype';
import type { State, Token } from '../reducers/TokensReducer';
import type { Account } from '../reducers/AccountsReducer';
import type { NetworkToken } from '../reducers/LocalStorageReducer';

@ -32,7 +32,7 @@ import type {
AsyncAction,
TrezorDevice,
RouterLocationState,
} from '~/flowtype';
} from 'flowtype';
export type TrezorConnectAction = {

@ -22,7 +22,7 @@ import type
Dispatch,
GetState,
State,
} from '~/flowtype';
} from 'flowtype';
export type WalletAction = {
type: typeof WALLET.SET_INITIAL_URL,

@ -21,7 +21,7 @@ import type {
GetState,
Action,
AsyncAction,
} from '~/flowtype';
} from 'flowtype';
import type { Account } from '../reducers/AccountsReducer';
import type { PendingTx } from '../reducers/PendingTxReducer';

@ -2,7 +2,7 @@ import styled, { css } from 'styled-components';
import PropTypes from 'prop-types';
import React from 'react';
import colors from '~/js/config/colors';
import colors from 'config/colors';
const Wrapper = styled.button`
padding: 12px 24px;

@ -5,8 +5,8 @@ import { getYear } from 'date-fns';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import colors from '~/js/config/colors';
import * as LogActions from '~/js/actions/LogActions';
import colors from 'config/colors';
import * as LogActions from 'actions/LogActions';
const Wrapper = styled.div`
width: 100%;

@ -1,7 +1,7 @@
/* @flow */
import React from 'react';
import styled from 'styled-components';
import colors from '~/js/config/colors';
import colors from 'config/colors';
const Wrapper = styled.header`
width: 100%;

@ -1,5 +1,5 @@
import styled, { css } from 'styled-components';
import colors from '~/js/config/colors';
import colors from 'config/colors';
const baseStyles = css`
-webkit-font-smoothing: antialiased;

@ -4,10 +4,10 @@
import React from 'react';
import { bindActionCreators } from '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 type { State, Dispatch } from '~/flowtype';
import * as LogActions from 'actions/LogActions';
import type { State, Dispatch } from 'flowtype';
const Log = (props: Props): ?React$Element<string> => {
if (!props.log.opened) return null;

@ -2,13 +2,13 @@
import React from 'react';
import { H2 } from '~/js/components/common/Heading';
import { H2 } from 'components/common/Heading';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import * as NOTIFICATION from '~/js/actions/constants/notification';
import * as NotificationActions from '~/js/actions/NotificationActions';
import type { Action, State, Dispatch } from '~/flowtype';
import * as NOTIFICATION from 'actions/constants/notification';
import * as NotificationActions from 'actions/NotificationActions';
import type { Action, State, Dispatch } from 'flowtype';
import Loader from './LoaderCircle';
type Props = {

@ -2,9 +2,9 @@
import React, { Component } from 'react';
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 = {
transport: $PropertyType<$ElementType<State, 'connect'>, 'transport'>;

@ -1,6 +1,6 @@
/* @flow */
import installers from '~/js/constants/bridge';
import installers from 'constants/bridge';
import React, { Component } from 'react';
import Select from 'react-select';
import Preloader from './Preloader';

@ -3,7 +3,7 @@
import React from 'react';
import Preloader from './Preloader';
import { H2 } from '~/js/components/common/Heading';
import { H2 } from 'components/common/Heading';
import ConnectDevice from './ConnectDevice';
import InstallBridge from './InstallBridge';
import LocalStorageError from './LocalStorageError';

@ -8,7 +8,7 @@ import { connect } from 'react-redux';
import LandingPage from './LandingPage';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import type { State, Dispatch } from '~/flowtype';
import type { State, Dispatch } from 'flowtype';
export type StateProps = {
localStorage: $ElementType<State, 'localStorage'>,

@ -2,7 +2,7 @@
import React, { Component } from 'react';
import { findAccount } from '~/js/reducers/AccountsReducer';
import { findAccount } from 'reducers/AccountsReducer';
import type { Props } from './index';

@ -2,7 +2,7 @@
import React, { Component } from 'react';
import { getNewInstance } from '~/js/reducers/DevicesReducer';
import { getNewInstance } from 'reducers/DevicesReducer';
import type { Props } from './index';
type State = {

@ -10,8 +10,8 @@ import { CSSTransition, Transition } from 'react-transition-group';
import { UI } from 'trezor-connect';
import { default as ModalActions } from '~/js/actions/ModalActions';
import { default as ReceiveActions } from '~/js/actions/ReceiveActions';
import { default as ModalActions } from 'actions/ModalActions';
import { default as ReceiveActions } from 'actions/ReceiveActions';
import Pin from './Pin';
import InvalidPin from './InvalidPin';
@ -22,12 +22,12 @@ import ConfirmAddress, { ConfirmUnverifiedAddress } from './ConfirmAddress';
import RememberDevice, { ForgetDevice } from './RememberDevice';
import DuplicateDevice from './DuplicateDevice';
import * as RECEIVE from '~/js/actions/constants/receive';
import * as MODAL from '~/js/actions/constants/modal';
import * as CONNECT from '~/js/actions/constants/TrezorConnect';
import * as RECEIVE from 'actions/constants/receive';
import * as MODAL from 'actions/constants/modal';
import * as CONNECT from 'actions/constants/TrezorConnect';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import type { State, Dispatch } from '~/flowtype';
import type { State, Dispatch } from 'flowtype';
type OwnProps = { }

@ -2,13 +2,13 @@
import * as React from 'react';
import { Notification } from '~/js/components/common/Notification';
import { Notification } from 'components/common/Notification';
import type {
State, TrezorDevice, Action, ThunkAction,
} from '~/flowtype';
import type { Account } from '~/js/reducers/AccountsReducer';
import type { Discovery } from '~/js/reducers/DiscoveryReducer';
} from 'flowtype';
import type { Account } from 'reducers/AccountsReducer';
import type { Discovery } from 'reducers/DiscoveryReducer';
export type StateProps = {
className: string;

@ -1,13 +1,13 @@
/* @flow */
import React, { Component } from 'react';
import styled from 'styled-components';
import { H2 } from '~/js/components/common/Heading';
import { H2 } from 'components/common/Heading';
import Tooltip from 'rc-tooltip';
import { QRCode } from 'react-qr-svg';
import SelectedAccount from '../SelectedAccount';
import { Notification } from '~/js/components/common/Notification';
import { Notification } from 'components/common/Notification';
import type { Props } from './index';

@ -5,12 +5,12 @@ import React, { Component, PropTypes } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { default as ReceiveActions } from '~/js/actions/ReceiveActions';
import * as TokenActions from '~/js/actions/TokenActions';
import { default as ReceiveActions } from 'actions/ReceiveActions';
import * as TokenActions from 'actions/TokenActions';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import Receive from './Receive';
import type { State, Dispatch } from '~/flowtype';
import type { State, Dispatch } from 'flowtype';
import type {
StateProps as BaseStateProps,
DispatchProps as BaseDispatchProps,

@ -3,13 +3,13 @@
import React from 'react';
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 { findAccountTokens } from '~/js/reducers/TokensReducer';
import { findAccountTokens } from 'reducers/TokensReducer';
import type { Coin } from '~/js/reducers/LocalStorageReducer';
import type { Token } from '~/js/reducers/TokensReducer';
import type { Coin } from 'reducers/LocalStorageReducer';
import type { Token } from 'reducers/TokensReducer';
import type { Props as BaseProps } from './index';
type Props = {

@ -3,18 +3,18 @@
import React, { Component } from 'react';
import styled from 'styled-components';
import Select from 'react-select';
import { H2 } from '~/js/components/common/Heading';
import { H2 } from 'components/common/Heading';
import AdvancedForm from './AdvancedForm';
import PendingTransactions from './PendingTransactions';
import { FeeSelectValue, FeeSelectOption } from './FeeSelect';
import SelectedAccount from '../SelectedAccount';
import { findAccountTokens } from '~/js/reducers/TokensReducer';
import { calculate, validation } from '~/js/actions/SendFormActions';
import { findAccountTokens } from 'reducers/TokensReducer';
import { calculate, validation } from 'actions/SendFormActions';
import { findToken } from '~/js/reducers/TokensReducer';
import { findToken } from 'reducers/TokensReducer';
import type { Props } from './index';
import type { Token } from '~/flowtype';
import type { Token } from 'flowtype';
export default class SendContainer extends Component<Props> {
componentWillReceiveProps(newProps: Props) {

@ -5,12 +5,12 @@ import * as React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { default as SendFormActions } from '~/js/actions/SendFormActions';
import * as SessionStorageActions from '~/js/actions/SessionStorageActions';
import { default as SendFormActions } from 'actions/SendFormActions';
import * as SessionStorageActions from 'actions/SessionStorageActions';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
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';
type OwnProps = { }

@ -1,8 +1,8 @@
import React from 'react';
import styled from 'styled-components';
import { H2 } from '~/js/components/common/Heading';
import colors from '~/js/config/colors';
import { H2 } from 'components/common/Heading';
import colors from 'config/colors';
const Wrapper = styled.div`
display: flex;

@ -1,20 +1,20 @@
/* @flow */
import styled from 'styled-components';
import React, { Component } from 'react';
import { H2 } from '~/js/components/common/Heading';
import { H2 } from 'components/common/Heading';
import BigNumber from 'bignumber.js';
import { Async as AsyncSelect } from 'react-select';
import Tooltip from 'rc-tooltip';
import { resolveAfter } from '~/js/utils/promiseUtils';
import { resolveAfter } from 'utils/promiseUtils';
import SelectedAccount from '../SelectedAccount';
import { Notification } from '~/js/components/common/Notification';
import { Notification } from 'components/common/Notification';
import SummaryDetails from './SummaryDetails.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 { NetworkToken } from '~/js/reducers/LocalStorageReducer';
import type { NetworkToken } from 'reducers/LocalStorageReducer';
const StyledH2 = styled(H2)`
padding: 20px 48px;

@ -5,7 +5,7 @@ import React from 'react';
import BigNumber from 'bignumber.js';
import type { Props as BaseProps } from './index';
import type { Coin } from '~/js/reducers/LocalStorageReducer';
import type { Coin } from 'reducers/LocalStorageReducer';
type Props = {
// coin: $PropertyType<$ElementType<BaseProps, 'selectedAccount'>, 'coin'>,

@ -4,7 +4,7 @@
import React from 'react';
import ColorHash from 'color-hash';
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 type { Props as BaseProps } from './index';

@ -7,10 +7,10 @@ import { connect } from 'react-redux';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import Summary from './Summary';
import * as SummaryActions from '~/js/actions/SummaryActions';
import * as TokenActions from '~/js/actions/TokenActions';
import * as SummaryActions from 'actions/SummaryActions';
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';
type OwnProps = { }

@ -5,13 +5,13 @@ import React, { PureComponent } from 'react';
import { Link, NavLink } from 'react-router-dom';
import BigNumber from 'bignumber.js';
import { findDeviceAccounts } from '~/js/reducers/AccountsReducer';
import * as stateUtils from '~/js/reducers/utils';
import Loader from '~/js/components/common/LoaderCircle';
import { findDeviceAccounts } from 'reducers/AccountsReducer';
import * as stateUtils from 'reducers/utils';
import Loader from 'components/common/LoaderCircle';
import Tooltip from 'rc-tooltip';
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 selected = props.wallet.selectedDevice;

@ -12,7 +12,7 @@ import CoinSelection from './CoinSelection';
import StickyContainer from './StickyContainer';
import type { Props } from './index';
import type { TrezorDevice } from '~/flowtype';
import type { TrezorDevice } from 'flowtype';
type TransitionMenuProps = {

@ -5,7 +5,7 @@ import React from 'react';
import { Link, NavLink } from 'react-router-dom';
import type { Props } from './index';
import type { TrezorDevice } from '~/flowtype';
import type { TrezorDevice } from 'flowtype';
const CoinSelection = (props: Props): React$Element<string> => {
const { location } = props.router;

@ -6,7 +6,7 @@ import Select from 'react-select';
import TrezorConnect from 'trezor-connect';
import type { Props } from './index';
import type { TrezorDevice } from '~/flowtype';
import type { TrezorDevice } from 'flowtype';
export const DeviceSelect = (props: Props) => {
const { devices } = props;

@ -5,7 +5,7 @@
import * as React from 'react';
import raf from 'raf';
import { getViewportHeight, getScrollY } from '~/js/utils/windowUtils';
import { getViewportHeight, getScrollY } from 'utils/windowUtils';
type Props = {
location: string,

@ -6,13 +6,13 @@ import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
import { toggleDeviceDropdown } from '~/js/actions/WalletActions';
import * as TrezorConnectActions from 'actions/TrezorConnectActions';
import { toggleDeviceDropdown } from 'actions/WalletActions';
import Aside from './Aside';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import type { State, Dispatch } from '~/flowtype';
import type { State, Dispatch } from 'flowtype';
type OwnProps = {

@ -15,7 +15,7 @@ import Notifications from '../common/Notification';
import Log from '../common/Log';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import type { State, Dispatch } from '~/flowtype';
import type { State, Dispatch } from 'flowtype';
type WalletContainerProps = {
wallet: $ElementType<State, 'wallet'>,

@ -4,10 +4,10 @@
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Notification } from '~/js/components/common/Notification';
import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
import { Notification } from 'components/common/Notification';
import * as TrezorConnectActions from 'actions/TrezorConnectActions';
import type { State, Dispatch } from '~/flowtype';
import type { State, Dispatch } from 'flowtype';
type Props = {
acquiring: boolean;

@ -1,7 +1,7 @@
/* @flow */
import React from 'react';
import { H2 } from '~/js/components/common/Heading';
import { H2 } from 'components/common/Heading';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';

@ -2,8 +2,8 @@ import React from 'react';
import styled from 'styled-components';
import { connect } from 'react-redux';
import { H2 } from '~/js/components/common/Heading';
import DashboardImg from '~/images/dashboard.png';
import { H2 } from 'components/common/Heading';
import DashboardImg from 'images/dashboard.png';
const Wrapper = styled.div`
display: flex;

@ -1,10 +1,10 @@
import React from 'react';
import styled from 'styled-components';
import { H2 } from '~/js/components/common/Heading';
import Icon from '~/js/components/common/Icon';
import colors from '~/js/config/colors';
import Button from '~/js/components/common/Button';
import ICONS from '~/js/constants/icons';
import { H2 } from 'components/common/Heading';
import Icon from 'components/common/Icon';
import colors from 'config/colors';
import Button from 'components/common/Button';
import ICONS from 'constants/icons';
import { connect } from 'react-redux';
const Section = styled.section`

@ -1,5 +1,5 @@
/* @flow */
import { H2 } from '~/js/components/common/Heading';
import { H2 } from 'components/common/Heading';
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';

@ -4,10 +4,10 @@
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Notification } from '~/js/components/common/Notification';
import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
import { Notification } from 'components/common/Notification';
import * as TrezorConnectActions from 'actions/TrezorConnectActions';
import type { State, Dispatch } from '~/flowtype';
import type { State, Dispatch } from 'flowtype';
type Props = {
acquiring: boolean;

@ -1,11 +1,11 @@
/* @flow */
import React from 'react';
import { render } from 'react-dom';
import baseStyles from '~/js/support/BaseStyles';
import baseStyles from 'support/BaseStyles';
import store from './store';
import App from './router';
import { onBeforeUnload } from './actions/WalletActions';
import styles from '~/styles/index.less';
import styles from 'styles/index.less';
const root: ?HTMLElement = document.getElementById('root');
if (root) {

@ -5,7 +5,7 @@ import * as CONNECT from '../actions/constants/TrezorConnect';
import * as WALLET from '../actions/constants/wallet';
import * as ACCOUNT from '../actions/constants/account';
import type { Action, TrezorDevice } from '~/flowtype';
import type { Action, TrezorDevice } from 'flowtype';
import type {
AccountCreateAction,
AccountSetBalanceAction,

@ -6,7 +6,7 @@ import type { Device } from 'trezor-connect';
import * as CONNECT from '../actions/constants/TrezorConnect';
import * as WALLET from '../actions/constants/wallet';
import type { Action, TrezorDevice } from '~/flowtype';
import type { Action, TrezorDevice } from 'flowtype';
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 WALLET from '../actions/constants/wallet';
import type { Action, TrezorDevice } from '~/flowtype';
import type { Action, TrezorDevice } from 'flowtype';
import type {
DiscoveryStartAction,
DiscoveryWaitingAction,

@ -3,7 +3,7 @@
import { RATE_UPDATE } from '../services/CoinmarketcapService';
import type { Action } from '~/flowtype';
import type { Action } from 'flowtype';
import type { FiatRateAction } from '../services/CoinmarketcapService';
export type Fiat = {

@ -3,7 +3,7 @@
import * as STORAGE from '../actions/constants/localStorage';
import type { Action } from '~/flowtype';
import type { Action } from 'flowtype';
export type Coin = {
name: string;

@ -2,7 +2,7 @@
import * as LOG from '../actions/constants/log';
import type { Action } from '~/flowtype';
import type { Action } from 'flowtype';
export type LogEntry = {
time: number;

@ -6,7 +6,7 @@ import * as RECEIVE from '../actions/constants/receive';
import * as MODAL from '../actions/constants/modal';
import * as CONNECT from '../actions/constants/TrezorConnect';
import type { Action, TrezorDevice } from '~/flowtype';
import type { Action, TrezorDevice } from 'flowtype';
export type State = {
opened: false;

@ -5,7 +5,7 @@ import { LOCATION_CHANGE } from 'react-router-redux';
import * as NOTIFICATION from '../actions/constants/notification';
import { DEVICE } from 'trezor-connect';
import type { Action } from '~/flowtype';
import type { Action } from 'flowtype';
export type CallbackAction = {
label: string;

@ -5,7 +5,7 @@ import * as PENDING from '../actions/constants/pendingTx';
import * as SEND from '../actions/constants/send';
import * as WEB3 from '../actions/constants/web3';
import type { Action } from '~/flowtype';
import type { Action } from 'flowtype';
import type { SendTxAction } from '../actions/SendFormActions';
export type PendingTx = {

@ -4,7 +4,7 @@
import { UI } from 'trezor-connect';
import * as RECEIVE from '../actions/constants/receive';
import * as ACCOUNT from '../actions/constants/account';
import type { Action } from '~/flowtype';
import type { Action } from 'flowtype';
export type State = {

@ -11,7 +11,7 @@ import type {
PendingTx,
Discovery,
Web3Instance,
} from '~/flowtype';
} from 'flowtype';
export type State = {
location?: string;

@ -10,7 +10,7 @@ import * as WALLET from '../actions/constants/wallet';
import { getFeeLevels } from '../actions/SendFormActions';
import type { Action } from '~/flowtype';
import type { Action } from 'flowtype';
import type {
Web3UpdateGasPriceAction,
} from '../actions/Web3Actions';

@ -3,7 +3,7 @@
import * as ACCOUNT from '../actions/constants/account';
import * as SUMMARY from '../actions/constants/summary';
import type { Action } from '~/flowtype';
import type { Action } from 'flowtype';
import type { NetworkToken } from './LocalStorageReducer';
export type State = {

@ -5,7 +5,7 @@ import * as CONNECT from '../actions/constants/TrezorConnect';
import * as WALLET from '../actions/constants/wallet';
import * as TOKEN from '../actions/constants/token';
import type { Action, TrezorDevice } from '~/flowtype';
import type { Action, TrezorDevice } from 'flowtype';
import type { Account } from './AccountsReducer';
export type Token = {

@ -6,7 +6,7 @@ import type { Device } from 'trezor-connect';
import * as CONNECT from '../actions/constants/TrezorConnect';
import * as WALLET from '../actions/constants/wallet';
import type { Action, TrezorDevice } from '~/flowtype';
import type { Action, TrezorDevice } from 'flowtype';
export type SelectedDevice = {
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 type { Action, RouterLocationState, TrezorDevice } from '~/flowtype';
import type { Action, RouterLocationState, TrezorDevice } from 'flowtype';
type State = {
ready: boolean;

@ -7,7 +7,7 @@ import type { ContractFactory } from 'web3';
import * as STORAGE from '../actions/constants/localStorage';
import * as WEB3 from '../actions/constants/web3';
import type { Action } from '~/flowtype';
import type { Action } from 'flowtype';
import type {
Web3UpdateBlockAction,
Web3UpdateGasPriceAction,

@ -1,9 +1,9 @@
/* @flow */
import * as LogActions from '~/js/actions/LogActions';
import * as STORAGE from '~/js/actions/constants/localStorage';
import * as WALLET from '~/js/actions/constants/wallet';
import * as LogActions from 'actions/LogActions';
import * as STORAGE from 'actions/constants/localStorage';
import * as WALLET from 'actions/constants/wallet';
import BigNumber from 'bignumber.js';
import type {
@ -22,7 +22,7 @@ import type {
Token,
PendingTx,
Web3Instance,
} from '~/flowtype';
} from 'flowtype';
export const getSelectedDevice = (state: State): ?TrezorDevice => {
const locationState = state.router.location.state;

@ -5,7 +5,7 @@ import { Provider } from 'react-redux';
import { ConnectedRouter } from 'react-router-redux';
import store, { history } from '../store';
import ErrorBoundary from '~/js/support/ErrorBoundary';
import ErrorBoundary from 'support/ErrorBoundary';
import LandingPageContainer from '../components/landing';
import WalletContainer from '../components/wallet';

@ -14,7 +14,7 @@ import type {
Action,
AsyncAction,
GetState,
} from '~/flowtype';
} from 'flowtype';
import type { Config, FiatValueTicker } from '../reducers/LocalStorageReducer';
export const RATE_UPDATE: 'rate__update' = 'rate__update';

@ -25,9 +25,9 @@ import type {
Action,
AsyncAction,
GetState,
} from '~/flowtype';
} from 'flowtype';
import type { TrezorDevice } from '~/flowtype';
import type { TrezorDevice } from 'flowtype';
import type { Account } from '../reducers/AccountsReducer';
import type { Token } from '../reducers/TokensReducer';
import type { PendingTx } from '../reducers/PendingTxReducer';

@ -16,7 +16,7 @@ import type {
Action,
AsyncAction,
GetState,
} from '~/flowtype';
} from 'flowtype';
const exclude: Array<string> = [
ADD, OPEN, CLOSE,

@ -19,7 +19,7 @@ import type {
GetState,
RouterLocationState,
TrezorDevice,
} from '~/flowtype';
} from 'flowtype';
/**
* Middleware used for init application and managing router path.

@ -26,7 +26,7 @@ import type {
AsyncAction,
GetState,
RouterLocationState,
} from '~/flowtype';
} from 'flowtype';
const TrezorConnectService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispatch) => (action: Action): Action => {
const prevState: $ElementType<State, 'connect'> = api.getState().connect;

@ -15,7 +15,7 @@ import type {
MiddlewareAPI,
MiddlewareDispatch,
Action,
} from '~/flowtype';
} from 'flowtype';
/**
* Middleware

@ -14,7 +14,7 @@ import services from '../services';
import Raven from 'raven-js';
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 });

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save