allow es6 imports from '~/' as ./src

pull/2/merge
Szymon Lesisz 6 years ago
parent 8f5c87a02e
commit 661f9fc39c

@ -5,8 +5,8 @@ import React from 'react';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import * as LogActions from '../../actions/LogActions'; import * as LogActions from '~/js/actions/LogActions';
import type { State, Dispatch } from '../../flowtype'; import type { State, Dispatch } from '~/js/flowtype';
type Props = { type Props = {
toggle: typeof LogActions.toggle toggle: typeof LogActions.toggle

@ -5,8 +5,8 @@ import React from 'react';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import * as LogActions from '../../actions/LogActions'; import * as LogActions from '~/js/actions/LogActions';
import type { State, Dispatch } from '../../flowtype'; import type { State, Dispatch } from '~/js/flowtype';
type Props = { type Props = {
log: $ElementType<State, 'log'>, log: $ElementType<State, 'log'>,

@ -5,9 +5,9 @@ import React from 'react';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import * as NOTIFICATION from '../../actions/constants/notification'; import * as NOTIFICATION from '~/js/actions/constants/notification';
import * as NotificationActions from '../../actions/NotificationActions'; import * as NotificationActions from '~/js/actions/NotificationActions';
import type { Action, State, Dispatch } from '../../flowtype'; import type { Action, State, Dispatch } from '~/js/flowtype';
type Props = { type Props = {
notifications: $ElementType<State, 'notifications'>, notifications: $ElementType<State, 'notifications'>,

@ -4,7 +4,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import TrezorConnect from 'trezor-connect'; import TrezorConnect from 'trezor-connect';
import type { State, TrezorDevice } from '../../flowtype'; import type { State, TrezorDevice } from '~/js/flowtype';
type Props = { type Props = {
transport: $PropertyType<$ElementType<State, 'connect'>, 'transport'>; transport: $PropertyType<$ElementType<State, 'connect'>, 'transport'>;

@ -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 '~/js/flowtype';
export type StateProps = { export type StateProps = {
localStorage: $ElementType<State, 'localStorage'>, localStorage: $ElementType<State, 'localStorage'>,

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

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

@ -3,7 +3,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import raf from 'raf'; import raf from 'raf';
import { findSelectedDevice } from '../../reducers/TrezorConnectReducer'; import { findSelectedDevice } from '~/js/reducers/TrezorConnectReducer';
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 '../../actions/ModalActions'; import { default as ModalActions } from '~/js/actions/ModalActions';
import { default as ReceiveActions } from '../../actions/ReceiveActions'; import { default as ReceiveActions } from '~/js/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 '../../actions/constants/receive'; import * as RECEIVE from '~/js/actions/constants/receive';
import * as MODAL from '../../actions/constants/modal'; import * as MODAL from '~/js/actions/constants/modal';
import * as CONNECT from '../../actions/constants/TrezorConnect'; import * as CONNECT from '~/js/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 '~/js/flowtype';
type OwnProps = { } type OwnProps = { }

@ -2,15 +2,15 @@
'use strict'; 'use strict';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Notification } from '../../common/Notification'; import { Notification } from '~/js/common/Notification';
import { findDevice } from '../../../reducers/TrezorConnectReducer'; import { findDevice } from '~/js/reducers/TrezorConnectReducer';
// import * as AbstractAccountActions from '../../actions/AbstractAccountActions'; // import * as AbstractAccountActions from '~/js/actions/AbstractAccountActions';
import { default as AbstractAccountActions } from '../../../actions/AbstractAccountActions'; import { default as AbstractAccountActions } from '~/js/actions/AbstractAccountActions';
import type { State, TrezorDevice, Action, ThunkAction } from '../../../flowtype'; import type { State, TrezorDevice, Action, ThunkAction } from '~/js/flowtype';
import type { Account } from '../../../reducers/AccountsReducer'; import type { Account } from '~/js/reducers/AccountsReducer';
import type { Discovery } from '../../../reducers/DiscoveryReducer'; import type { Discovery } from '~/js/reducers/DiscoveryReducer';
export type StateProps = { export type StateProps = {
abstractAccount: $ElementType<State, 'abstractAccount'>, abstractAccount: $ElementType<State, 'abstractAccount'>,

@ -7,7 +7,7 @@ import Tooltip from 'rc-tooltip';
import { QRCode } from 'react-qr-svg'; import { QRCode } from 'react-qr-svg';
import AbstractAccount from '../AbstractAccount'; import AbstractAccount from '../AbstractAccount';
import { Notification } from '../../../common/Notification'; import { Notification } from '~/js/common/Notification';
import type { AccountState } from '../AbstractAccount'; import type { AccountState } from '../AbstractAccount';
import type { Props } from './index'; import type { Props } from './index';

@ -5,13 +5,13 @@ 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 '../../../../actions/ReceiveActions'; import { default as ReceiveActions } from '~/js/actions/ReceiveActions';
import { default as AbstractAccountActions } from '../../../../actions/AbstractAccountActions'; import { default as AbstractAccountActions } from '~/js/actions/AbstractAccountActions';
import * as TokenActions from '../../../../actions/TokenActions'; import * as TokenActions from '~/js/actions/TokenActions';
import Receive from './Receive'; import Receive from './Receive';
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 '~/js/flowtype';
import type { import type {
StateProps as BaseStateProps, StateProps as BaseStateProps,
DispatchProps as BaseDispatchProps DispatchProps as BaseDispatchProps

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

@ -6,9 +6,9 @@ import Select from 'react-select';
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 { Notification } from '../../../common/Notification'; import { Notification } from '~/js/common/Notification';
import AbstractAccount from '../AbstractAccount'; import AbstractAccount from '../AbstractAccount';
import { findAccountTokens } from '../../../../reducers/TokensReducer'; import { findAccountTokens } from '~/js/reducers/TokensReducer';
import type { Props } from './index'; import type { Props } from './index';
import type { AccountState } from '../AbstractAccount'; import type { AccountState } from '../AbstractAccount';

@ -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 '../../../../actions/SendFormActions'; import { default as SendFormActions } from '~/js/actions/SendFormActions';
import { default as AbstractAccountActions } from '../../../../actions/AbstractAccountActions'; import { default as AbstractAccountActions } from '~/js/actions/AbstractAccountActions';
import SendForm from './SendForm'; import SendForm from './SendForm';
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 '~/js/flowtype';
import type { StateProps as BaseStateProps, DispatchProps as BaseDispatchProps } from '../AbstractAccount'; import type { StateProps as BaseStateProps, DispatchProps as BaseDispatchProps } from '../AbstractAccount';
type OwnProps = { } type OwnProps = { }

@ -6,20 +6,20 @@ import BigNumber from 'bignumber.js';
import { Async } from 'react-select'; import { Async } from 'react-select';
import Tooltip from 'rc-tooltip'; import Tooltip from 'rc-tooltip';
import { resolveAfter } from '../../../../utils/promiseUtils'; import { resolveAfter } from '~/js/utils/promiseUtils';
import AbstractAccount from '../AbstractAccount'; import AbstractAccount from '../AbstractAccount';
import { Notification } from '../../../common/Notification'; import { Notification } from '~/js/common/Notification';
import SummaryDetails from './SummaryDetails.js'; import SummaryDetails from './SummaryDetails.js';
import SummaryTokens from './SummaryTokens.js'; import SummaryTokens from './SummaryTokens.js';
import type { Props } from './index'; import type { Props } from './index';
import type { AccountState } from '../AbstractAccount'; import type { AccountState } from '../AbstractAccount';
import type { TrezorDevice } from '../../../../flowtype'; import type { TrezorDevice } from '~/js/flowtype';
import type { NetworkToken } from '../../../../reducers/LocalStorageReducer'; import type { NetworkToken } from '~/js/reducers/LocalStorageReducer';
import type { Account } from '../../../../reducers/AccountsReducer'; import type { Account } from '~/js/reducers/AccountsReducer';
import type { Discovery } from '../../../../reducers/DiscoveryReducer'; import type { Discovery } from '~/js/reducers/DiscoveryReducer';
import { findAccountTokens } from '../../../../reducers/TokensReducer'; import { findAccountTokens } from '~/js/reducers/TokensReducer';
export default class Summary extends AbstractAccount<Props> { export default class Summary extends AbstractAccount<Props> {
render() { render() {

@ -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 '../../../../reducers/LocalStorageReducer'; import type { Coin } from '~/js/reducers/LocalStorageReducer';
type Props = { type Props = {
// coin: $PropertyType<$ElementType<BaseProps, 'abstractAccount'>, 'coin'>, // coin: $PropertyType<$ElementType<BaseProps, 'abstractAccount'>, 'coin'>,

@ -6,12 +6,12 @@ import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Summary from './Summary'; import Summary from './Summary';
import { default as AbstractAccountActions } from '../../../../actions/AbstractAccountActions'; import { default as AbstractAccountActions } from '~/js/actions/AbstractAccountActions';
import * as SummaryActions from '../../../../actions/SummaryActions'; import * as SummaryActions from '~/js/actions/SummaryActions';
import * as TokenActions from '../../../../actions/TokenActions'; import * as TokenActions from '~/js/actions/TokenActions';
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 '~/js/flowtype';
import type { StateProps as BaseStateProps, DispatchProps as BaseDispatchProps } from '../AbstractAccount'; import type { StateProps as BaseStateProps, DispatchProps as BaseDispatchProps } from '../AbstractAccount';
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 '../../../reducers/AccountsReducer'; import { findDeviceAccounts } from '~/js/reducers/AccountsReducer';
import { findSelectedDevice } from '../../../reducers/TrezorConnectReducer'; import { findSelectedDevice } from '~/js/reducers/TrezorConnectReducer';
import Loader from '../../common/LoaderCircle'; import Loader from '~/js/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 } from '../../../flowtype'; import type { TrezorDevice } from '~/js/flowtype';
const AccountSelection = (props: Props): ?React$Element<string> => { const AccountSelection = (props: Props): ?React$Element<string> => {

@ -10,10 +10,10 @@ import { DeviceSelect, DeviceDropdown } from './DeviceSelection';
import AccountSelection from './AccountSelection'; import AccountSelection from './AccountSelection';
import CoinSelection from './CoinSelection'; import CoinSelection from './CoinSelection';
import StickyContainer from './StickyContainer'; import StickyContainer from './StickyContainer';
import { findSelectedDevice } from '../../../reducers/TrezorConnectReducer'; import { findSelectedDevice } from '~/js/reducers/TrezorConnectReducer';
import type { Props } from './index'; import type { Props } from './index';
import type { TrezorDevice } from '../../../flowtype'; import type { TrezorDevice } from '~/js/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 '~/js/flowtype';
const CoinSelection = (props: Props): React$Element<string> => { const CoinSelection = (props: Props): React$Element<string> => {
const { location } = props.router; const { location } = props.router;

@ -5,10 +5,10 @@ import React, { Component } from 'react';
import Select from 'react-select'; import Select from 'react-select';
import TrezorConnect from 'trezor-connect'; import TrezorConnect from 'trezor-connect';
import { findSelectedDevice } from '../../../reducers/TrezorConnectReducer'; import { findSelectedDevice } from '~/js/reducers/TrezorConnectReducer';
import type { Props } from './index'; import type { Props } from './index';
import type { TrezorDevice } from '../../../flowtype'; import type { TrezorDevice } from '~/js/flowtype';
export const DeviceSelect = (props: Props) => { export const DeviceSelect = (props: 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 '../../../utils/windowUtils'; import { getViewportHeight, getScrollY } from '~/js/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 '../../../actions/TrezorConnectActions'; import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
import { toggleDeviceDropdown } from '../../../actions/WalletActions'; import { toggleDeviceDropdown } from '~/js/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 '~/js/flowtype';
type OwnProps = { type OwnProps = {

@ -16,7 +16,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 '~/js/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 '../../common/Notification'; import { Notification } from '~/js/common/Notification';
import * as TrezorConnectActions from '../../../actions/TrezorConnectActions'; import * as TrezorConnectActions from '~/js/actions/TrezorConnectActions';
import type { State, Dispatch } from '../../../flowtype'; import type { State, Dispatch } from '~/js/flowtype';
type Props = { type Props = {
connect: $ElementType<State, 'connect'>, connect: $ElementType<State, 'connect'>,
acquireDevice: typeof TrezorConnectActions.acquire acquireDevice: typeof TrezorConnectActions.acquire

Loading…
Cancel
Save