Fix imports & flow errors

pull/8/head
Vasek Mlejnsky 6 years ago
parent b029fab397
commit 571522401e

@ -1,6 +1,7 @@
[include] [include]
[ignore] [ignore]
.*/node_modules/fbjs/.*
.*/node_modules/rc-util/.* .*/node_modules/rc-util/.*
.*/node_modules/react-redux/.* .*/node_modules/react-redux/.*
.*/node_modules/redux/.* .*/node_modules/redux/.*
@ -20,8 +21,6 @@
./src/flowtype/npm/web3.js ./src/flowtype/npm/web3.js
./src/flowtype/css.js ./src/flowtype/css.js
[options] [options]
esproposal.class_static_fields=enable esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable esproposal.class_instance_fields=enable
@ -31,4 +30,15 @@ esproposal.decorators=ignore
module.name_mapper='.*\(.less\)' -> 'CSSModule' module.name_mapper='.*\(.less\)' -> 'CSSModule'
module.name_mapper='^\(~/\)' -> '<PROJECT_ROOT>/src/' module.name_mapper='^\(~/\)' -> '<PROJECT_ROOT>/src/'
module.name_mapper='^universal' -> '<PROJECT_ROOT>/src/' module.name_mapper='^universal' -> '<PROJECT_ROOT>/src/'
module.name_mapper='^flowtype' -> '<PROJECT_ROOT>/src/flowtype'
module.name_mapper='^components' -> '<PROJECT_ROOT>/src/components'
module.name_mapper='^config' -> '<PROJECT_ROOT>/src/config'
module.name_mapper='^constants' -> '<PROJECT_ROOT>/src/constants'
module.name_mapper='^utils' -> '<PROJECT_ROOT>/src/utils'
module.name_mapper='^reducers' -> '<PROJECT_ROOT>/src/reducers'
module.name_mapper='^actions' -> '<PROJECT_ROOT>/src/actions'
module.name_mapper='^views' -> '<PROJECT_ROOT>/src/views'
module.name_mapper='^data' -> '<PROJECT_ROOT>/src/data'
module.name_mapper='^services' -> '<PROJECT_ROOT>/src/services'
module.name_mapper='^support' -> '<PROJECT_ROOT>/src/support'
module.system=haste module.system=haste

@ -1,7 +1,7 @@
/* @flow */ /* @flow */
import TrezorConnect, { UI, UI_EVENT } from 'trezor-connect'; import TrezorConnect, { UI, UI_EVENT } from 'trezor-connect';
import type { Device } from 'trezor-connect';
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';

@ -33,7 +33,7 @@ import type { Config, Coin } from 'reducers/LocalStorageReducer';
import type { Token } from 'reducers/TokensReducer'; import type { Token } from 'reducers/TokensReducer';
import type { State, FeeLevel } from 'reducers/SendFormReducer'; import type { State, FeeLevel } from 'reducers/SendFormReducer';
import type { Account } from 'reducers/AccountsReducer'; import type { Account } from 'reducers/AccountsReducer';
import type { Props } from 'components/wallet/account/send'; import type { Props } from 'views/Wallet/views/AccountSend/Container';
import * as SessionStorageActions from './SessionStorageActions'; import * as SessionStorageActions from './SessionStorageActions';
import { estimateGas, getGasPrice, pushTx } from './Web3Actions'; import { estimateGas, getGasPrice, pushTx } from './Web3Actions';

@ -10,7 +10,12 @@ import Paragraph from 'components/Paragraph';
import * as LogActions from 'actions/LogActions'; import * as LogActions from 'actions/LogActions';
import icons from 'config/icons'; import icons from 'config/icons';
import { State, Dispatch } from 'flowtype'; import type { State, Dispatch } from 'flowtype';
type Props = {
log: $ElementType<State, 'log'>,
toggle: typeof LogActions.toggle
}
const Wrapper = styled.div` const Wrapper = styled.div`
position: relative; position: relative;

@ -12,6 +12,7 @@ import colors from 'config/colors';
import P from 'components/Paragraph'; import P from 'components/Paragraph';
import { H2 } from 'components/Heading'; import { H2 } from 'components/Heading';
import { isWebUSB } from 'utils/device'; import { isWebUSB } from 'utils/device';
import { FONT_SIZE } from 'config/variables';
import BrowserNotSupported from './components/BrowserNotSupported'; import BrowserNotSupported from './components/BrowserNotSupported';
import ConnectDevice from './components/ConnectDevice'; import ConnectDevice from './components/ConnectDevice';
@ -64,6 +65,10 @@ const LandingLoader = styled(Loader)`
margin: auto; margin: auto;
`; `;
const StyledLink = styled(Link)`
font-size: ${FONT_SIZE.BASE};
`;
export default (props: Props) => { export default (props: Props) => {
const { devices } = props; const { devices } = props;
const { browserState, transport } = props.connect; const { browserState, transport } = props.connect;
@ -124,24 +129,24 @@ export default (props: Props) => {
<LandingFooterTextWrapper> <LandingFooterTextWrapper>
Device not recognized? Device not recognized?
</LandingFooterTextWrapper> </LandingFooterTextWrapper>
<Link <StyledLink
href="#/bridge" href="#/bridge"
isGreen isGreen
>Try installing the TREZOR Bridge. >Try installing the TREZOR Bridge.
</Link> </StyledLink>
</P> </P>
)} )}
<P> <P>
<LandingFooterTextWrapper> <LandingFooterTextWrapper>
Don't have TREZOR? Don't have TREZOR?
</LandingFooterTextWrapper> </LandingFooterTextWrapper>
<Link <StyledLink
href="https://trezor.io/" href="https://trezor.io/"
target="_blank" target="_blank"
rel="noreferrer noopener" rel="noreferrer noopener"
isGreen isGreen
>Get one >Get one
</Link> </StyledLink>
</P> </P>
</LandingFooterWrapper> </LandingFooterWrapper>
)} )}

@ -8,7 +8,7 @@ import * as TrezorConnectActions from 'actions/TrezorConnectActions';
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';
import type { StateProps, DispatchProps } from './common'; import type { StateProps, DispatchProps } from './components/common';
import LeftNavigation from './index'; import LeftNavigation from './index';

@ -1,6 +1,7 @@
/* @flow */ /* @flow */
import * as TrezorConnectActions from 'actions/TrezorConnectActions'; import * as TrezorConnectActions from 'actions/TrezorConnectActions';
import { toggleDeviceDropdown } from 'actions/WalletActions'; import { toggleDeviceDropdown } from 'actions/WalletActions';
import type { State } from 'flowtype';
export type StateProps = { export type StateProps = {
connect: $ElementType<State, 'connect'>, connect: $ElementType<State, 'connect'>,

@ -1,15 +1,14 @@
/* @flow */ /* @flow */
import React, { Component } from 'react'; import React from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import { H2 } from 'components/Heading'; import { H2 } from 'components/Heading';
import Tooltip from 'components/Tooltip'; import Tooltip from 'components/Tooltip';
import { QRCode } from 'react-qr-svg'; import { QRCode } from 'react-qr-svg';
import { Notification } from 'components/Notification';
import SelectedAccount from 'views/Wallet/components/SelectedAccount'; import SelectedAccount from 'views/Wallet/components/SelectedAccount';
import type { Props } from './index'; import type { Props } from './Container';
const Wrapper = styled.div``; const Wrapper = styled.div``;
const StyledH2 = styled(H2)` const StyledH2 = styled(H2)`

@ -3,7 +3,7 @@
import React from 'react'; import React from 'react';
import Tooltip from 'components/Tooltip'; import Tooltip from 'components/Tooltip';
import type { Props as BaseProps } from './index'; import type { Props as BaseProps } from '../Container';
type Props = { type Props = {
selectedAccount: $ElementType<BaseProps, 'selectedAccount'>, selectedAccount: $ElementType<BaseProps, 'selectedAccount'>,

@ -10,7 +10,7 @@ import { findAccountTokens } from 'reducers/TokensReducer';
import type { Coin } from 'reducers/LocalStorageReducer'; import type { Coin } from 'reducers/LocalStorageReducer';
import type { Token } from 'reducers/TokensReducer'; import type { Token } from 'reducers/TokensReducer';
import type { Props as BaseProps } from './index'; import type { Props as BaseProps } from '../Container';
type Props = { type Props = {
pending: $PropertyType<$ElementType<BaseProps, 'selectedAccount'>, 'pending'>, pending: $PropertyType<$ElementType<BaseProps, 'selectedAccount'>, 'pending'>,

@ -11,7 +11,7 @@ import AdvancedForm from './components/AdvancedForm';
import PendingTransactions from './components/PendingTransactions'; import PendingTransactions from './components/PendingTransactions';
import { FeeSelectValue, FeeSelectOption } from './components/FeeSelect'; import { FeeSelectValue, FeeSelectOption } from './components/FeeSelect';
import type { Props } from './index'; import type { Props } from './Container';
export default class AccountSendContainer extends Component<Props> { export default class AccountSendContainer extends Component<Props> {
componentWillReceiveProps(newProps: Props) { componentWillReceiveProps(newProps: Props) {

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

@ -7,7 +7,7 @@ import ScaleText from 'react-scale-text';
import * as stateUtils from '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 '../../Container';
type Props = { type Props = {
pending: $PropertyType<$ElementType<BaseProps, 'selectedAccount'>, 'pending'>, pending: $PropertyType<$ElementType<BaseProps, 'selectedAccount'>, 'pending'>,
@ -18,7 +18,7 @@ type Props = {
const SummaryTokens = (props: Props) => { const SummaryTokens = (props: Props) => {
if (!props.tokens || props.tokens.length < 1) return null; if (!props.tokens || props.tokens.length < 1) return null;
const bgColor = new ColorHash({ lightness: 0.16 } ); const bgColor = new ColorHash({ lightness: 0.16 });
const textColor = new ColorHash(); const textColor = new ColorHash();
const tokens = props.tokens.map((token, index) => { const tokens = props.tokens.map((token, index) => {

@ -6,8 +6,6 @@ import BigNumber from 'bignumber.js';
import { Async as AsyncSelect } from 'react-select'; import { Async as AsyncSelect } from 'react-select';
import Tooltip from 'components/Tooltip'; import Tooltip from 'components/Tooltip';
import { resolveAfter } from 'utils/promiseUtils';
import { Notification } from 'components/Notification';
import CoinLogo from 'components/CoinLogo'; import CoinLogo from 'components/CoinLogo';
import * as stateUtils from 'reducers/utils'; import * as stateUtils from 'reducers/utils';
import type { NetworkToken } from 'reducers/LocalStorageReducer'; import type { NetworkToken } from 'reducers/LocalStorageReducer';
@ -16,7 +14,7 @@ import Link from 'components/Link';
import SummaryDetails from './components/Details'; import SummaryDetails from './components/Details';
import SummaryTokens from './components/Tokens'; import SummaryTokens from './components/Tokens';
import type { Props } from './index'; import type { Props } from './Container';
const AccountHeading = styled.div` const AccountHeading = styled.div`
padding: 20px 48px 20px 45px; padding: 20px 48px 20px 45px;

Loading…
Cancel
Save