Fix imports & flow errors

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

@ -1,6 +1,7 @@
[include]
[ignore]
.*/node_modules/fbjs/.*
.*/node_modules/rc-util/.*
.*/node_modules/react-redux/.*
.*/node_modules/redux/.*
@ -20,8 +21,6 @@
./src/flowtype/npm/web3.js
./src/flowtype/css.js
[options]
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
@ -31,4 +30,15 @@ esproposal.decorators=ignore
module.name_mapper='.*\(.less\)' -> 'CSSModule'
module.name_mapper='^\(~/\)' -> '<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

@ -1,7 +1,7 @@
/* @flow */
import TrezorConnect, { UI, UI_EVENT } from 'trezor-connect';
import type { Device } from 'trezor-connect';
import * as MODAL from 'actions/constants/modal';
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 { State, FeeLevel } from 'reducers/SendFormReducer';
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 { estimateGas, getGasPrice, pushTx } from './Web3Actions';

@ -10,7 +10,12 @@ import Paragraph from 'components/Paragraph';
import * as LogActions from 'actions/LogActions';
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`
position: relative;

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

@ -8,7 +8,7 @@ import * as TrezorConnectActions from 'actions/TrezorConnectActions';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import type { State, Dispatch } from 'flowtype';
import type { StateProps, DispatchProps } from './common';
import type { StateProps, DispatchProps } from './components/common';
import LeftNavigation from './index';

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

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

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

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

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

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

@ -7,7 +7,7 @@ import ScaleText from 'react-scale-text';
import * as stateUtils from 'reducers/utils';
import BigNumber from 'bignumber.js';
import type { Props as BaseProps } from './index';
import type { Props as BaseProps } from '../../Container';
type Props = {
pending: $PropertyType<$ElementType<BaseProps, 'selectedAccount'>, 'pending'>,
@ -18,7 +18,7 @@ type Props = {
const SummaryTokens = (props: Props) => {
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 tokens = props.tokens.map((token, index) => {

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

Loading…
Cancel
Save