mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-04 20:30:58 +00:00
Cleanup & eslint error fixes
This commit is contained in:
parent
65479c8608
commit
87d485cf82
@ -8,35 +8,14 @@ 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 LeftNavigation from './index';
|
import LeftNavigation from './index';
|
||||||
|
|
||||||
type OwnProps = {
|
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 => ({
|
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: State, own: OwnProps): StateProps => ({
|
||||||
connect: state.connect,
|
connect: state.connect,
|
||||||
accounts: state.accounts,
|
accounts: state.accounts,
|
||||||
|
@ -2,7 +2,6 @@ import styled, { css } from 'styled-components';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import colors from 'config/colors';
|
|
||||||
import { TRANSITION_TIME } from 'config/variables';
|
import { TRANSITION_TIME } from 'config/variables';
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
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 = {
|
export type StateProps = {
|
||||||
coin: PropTypes.shape({
|
connect: $ElementType<State, 'connect'>,
|
||||||
img: PropTypes.string.isRequired,
|
accounts: $ElementType<State, 'accounts'>,
|
||||||
name: PropTypes.string.isRequired,
|
router: $ElementType<State, 'router'>,
|
||||||
}).isRequired,
|
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 */
|
/* @flow */
|
||||||
|
|
||||||
|
|
||||||
import React, { PureComponent } from 'react';
|
|
||||||
import { Link, NavLink } from 'react-router-dom';
|
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
|
import colors from 'config/colors';
|
||||||
import { findDeviceAccounts } from 'reducers/AccountsReducer';
|
|
||||||
import * as stateUtils from 'reducers/utils';
|
|
||||||
import Loader from 'components/common/LoaderCircle';
|
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 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 { 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 { Accounts } from 'flowtype';
|
||||||
|
|
||||||
import type { TrezorDevice, Accounts } from 'flowtype';
|
|
||||||
import type { Props } from './index';
|
import type { Props } from './index';
|
||||||
|
|
||||||
|
import Row from '../Row';
|
||||||
|
|
||||||
const RowAccountWrapper = styled.div`
|
const RowAccountWrapper = styled.div`
|
||||||
height: 64px;
|
height: 64px;
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
import coins from 'constants/coins';
|
import coins from 'constants/coins';
|
||||||
import colors from 'config/colors';
|
import colors from 'config/colors';
|
||||||
import { FONT_SIZE } from 'config/variables';
|
|
||||||
import Icon from 'components/common/Icon';
|
import Icon from 'components/common/Icon';
|
||||||
import ICONS from 'config/icons';
|
import ICONS from 'config/icons';
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
@ -9,15 +8,11 @@ import PropTypes from 'prop-types';
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import { ICON_SIZE } from 'config/variables';
|
import { FONT_SIZE, ICON_SIZE } from 'config/variables';
|
||||||
import { coinProp } from '../common';
|
|
||||||
import Divider from '../Divider';
|
import Divider from '../Divider';
|
||||||
import Row from '../Row';
|
import Row from '../Row';
|
||||||
|
|
||||||
import type { TrezorDevice } from 'flowtype';
|
|
||||||
import type { Props } from './index';
|
|
||||||
|
|
||||||
|
|
||||||
const CoinNameWrapper = styled.div`
|
const CoinNameWrapper = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -43,7 +38,6 @@ const CoinName = ({
|
|||||||
<p>{text}</p>
|
<p>{text}</p>
|
||||||
</CoinNameWrapper>
|
</CoinNameWrapper>
|
||||||
);
|
);
|
||||||
|
|
||||||
CoinName.propTypes = {
|
CoinName.propTypes = {
|
||||||
coinImg: PropTypes.string.isRequired,
|
coinImg: PropTypes.string.isRequired,
|
||||||
text: PropTypes.string.isRequired,
|
text: PropTypes.string.isRequired,
|
||||||
@ -77,9 +71,11 @@ const RowCoin = ({
|
|||||||
</Row>
|
</Row>
|
||||||
</RowCoinWrapper>
|
</RowCoinWrapper>
|
||||||
);
|
);
|
||||||
|
|
||||||
RowCoin.propTypes = {
|
RowCoin.propTypes = {
|
||||||
...coinProp,
|
coin: PropTypes.shape({
|
||||||
|
img: PropTypes.string.isRequired,
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
}).isRequired,
|
||||||
icon: PropTypes.shape({
|
icon: PropTypes.shape({
|
||||||
type: PropTypes.string.isRequired,
|
type: PropTypes.string.isRequired,
|
||||||
color: PropTypes.string.isRequired,
|
color: PropTypes.string.isRequired,
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import Select from 'react-select';
|
|
||||||
import TrezorConnect from 'trezor-connect';
|
import TrezorConnect from 'trezor-connect';
|
||||||
|
|
||||||
import AsideDivider from '../Divider';
|
|
||||||
|
|
||||||
import type { TrezorDevice } from 'flowtype';
|
import type { TrezorDevice } from 'flowtype';
|
||||||
import type { Props } from './index';
|
|
||||||
|
import type { Props } from '../common';
|
||||||
|
|
||||||
|
import AsideDivider from '../Divider';
|
||||||
|
|
||||||
export const DeviceSelect = (props: Props) => {
|
export const DeviceSelect = (props: Props) => {
|
||||||
const { devices } = props;
|
const { devices } = props;
|
||||||
|
Loading…
Reference in New Issue
Block a user