Cleanup & eslint error fixes

pull/3/head
Vasek Mlejnsky 6 years ago
parent 65479c8608
commit 87d485cf82

@ -8,35 +8,14 @@ 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 LeftNavigation from './index';
type OwnProps = {
}
type StateProps = {
connect: $ElementType<State, 'connect'>,
accounts: $ElementType<State, 'accounts'>,
router: $ElementType<State, 'router'>,
deviceDropdownOpened: boolean,
fiat: $ElementType<State, 'fiat'>,
localStorage: $ElementType<State, 'localStorage'>,
discovery: $ElementType<State, 'discovery'>,
wallet: $ElementType<State, 'wallet'>,
devices: $ElementType<State, 'devices'>,
pending: $ElementType<State, 'pending'>,
}
type DispatchProps = {
toggleDeviceDropdown: typeof toggleDeviceDropdown,
addAccount: typeof TrezorConnectActions.addAccount,
acquireDevice: typeof TrezorConnectActions.acquire,
forgetDevice: typeof TrezorConnectActions.forget,
duplicateDevice: typeof TrezorConnectActions.duplicateDevice,
gotoDeviceSettings: typeof TrezorConnectActions.gotoDeviceSettings,
onSelectDevice: typeof TrezorConnectActions.onSelectDevice,
}
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: State, own: OwnProps): StateProps => ({
connect: state.connect,
accounts: state.accounts,
@ -63,4 +42,4 @@ const mapDispatchToProps: MapDispatchToProps<Dispatch, OwnProps, DispatchProps>
export default withRouter(
connect(mapStateToProps, mapDispatchToProps)(LeftNavigation),
);
);

@ -2,7 +2,6 @@ import styled, { css } from 'styled-components';
import React from 'react';
import PropTypes from 'prop-types';
import colors from 'config/colors';
import { TRANSITION_TIME } from 'config/variables';
const Wrapper = styled.div`

@ -1,8 +1,28 @@
import PropTypes from 'prop-types';
/* @flow */
import * as TrezorConnectActions from 'actions/TrezorConnectActions';
import { toggleDeviceDropdown } from 'actions/WalletActions';
export const coinProp = {
coin: PropTypes.shape({
img: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
}).isRequired,
};
export type StateProps = {
connect: $ElementType<State, 'connect'>,
accounts: $ElementType<State, 'accounts'>,
router: $ElementType<State, 'router'>,
deviceDropdownOpened: boolean,
fiat: $ElementType<State, 'fiat'>,
localStorage: $ElementType<State, 'localStorage'>,
discovery: $ElementType<State, 'discovery'>,
wallet: $ElementType<State, 'wallet'>,
devices: $ElementType<State, 'devices'>,
pending: $ElementType<State, 'pending'>,
}
export type DispatchProps = {
toggleDeviceDropdown: typeof toggleDeviceDropdown,
addAccount: typeof TrezorConnectActions.addAccount,
acquireDevice: typeof TrezorConnectActions.acquire,
forgetDevice: typeof TrezorConnectActions.forget,
duplicateDevice: typeof TrezorConnectActions.duplicateDevice,
gotoDeviceSettings: typeof TrezorConnectActions.gotoDeviceSettings,
onSelectDevice: typeof TrezorConnectActions.onSelectDevice,
}
export type Props = StateProps & DispatchProps;

@ -1,26 +1,22 @@
/* @flow */
import React, { PureComponent } from 'react';
import { Link, NavLink } from 'react-router-dom';
import BigNumber from 'bignumber.js';
import { findDeviceAccounts } from 'reducers/AccountsReducer';
import * as stateUtils from 'reducers/utils';
import colors from 'config/colors';
import Loader from 'components/common/LoaderCircle';
import PropTypes from 'prop-types';
import React from 'react';
import styled, { css } from 'styled-components';
import * as stateUtils from 'reducers/utils';
import Tooltip from 'rc-tooltip';
import colors from 'config/colors';
import { NavLink } from 'react-router-dom';
import { findDeviceAccounts } from 'reducers/AccountsReducer';
import { FONT_SIZE, BORDER_WIDTH } from 'config/variables';
import styled, { css } from 'styled-components';
import Row from '../Row';
import PropTypes from 'prop-types';
//import AsideRowAccount from './row/account/AsideRowAccount';
import type { TrezorDevice, Accounts } from 'flowtype';
import type { Accounts } from 'flowtype';
import type { Props } from './index';
import Row from '../Row';
const RowAccountWrapper = styled.div`
height: 64px;

@ -1,7 +1,6 @@
/* @flow */
import coins from 'constants/coins';
import colors from 'config/colors';
import { FONT_SIZE } from 'config/variables';
import Icon from 'components/common/Icon';
import ICONS from 'config/icons';
import { NavLink } from 'react-router-dom';
@ -9,15 +8,11 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import styled from 'styled-components';
import { ICON_SIZE } from 'config/variables';
import { coinProp } from '../common';
import { FONT_SIZE, ICON_SIZE } from 'config/variables';
import Divider from '../Divider';
import Row from '../Row';
import type { TrezorDevice } from 'flowtype';
import type { Props } from './index';
const CoinNameWrapper = styled.div`
display: flex;
align-items: center;
@ -43,7 +38,6 @@ const CoinName = ({
<p>{text}</p>
</CoinNameWrapper>
);
CoinName.propTypes = {
coinImg: PropTypes.string.isRequired,
text: PropTypes.string.isRequired,
@ -77,9 +71,11 @@ const RowCoin = ({
</Row>
</RowCoinWrapper>
);
RowCoin.propTypes = {
...coinProp,
coin: PropTypes.shape({
img: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
}).isRequired,
icon: PropTypes.shape({
type: PropTypes.string.isRequired,
color: PropTypes.string.isRequired,

@ -1,14 +1,12 @@
/* @flow */
import React, { Component } from 'react';
import Select from 'react-select';
import TrezorConnect from 'trezor-connect';
import AsideDivider from '../Divider';
import type { TrezorDevice } from 'flowtype';
import type { Props } from './index';
import type { Props } from '../common';
import AsideDivider from '../Divider';
export const DeviceSelect = (props: Props) => {
const { devices } = props;

Loading…
Cancel
Save