MyCrypto/common/containers/Tabs/ScheduleTransaction/components/SendScheduleTransactionButtonFactory.tsx
2018-04-06 15:55:36 +07:00

30 lines
900 B
TypeScript

import { getWalletType } from 'selectors/wallet';
import { connect } from 'react-redux';
import { AppState } from 'reducers';
import {
getSerializedTransaction,
isNetworkRequestPending,
isValidGasPrice,
isValidGasLimit,
getSignedTx,
getWeb3Tx,
getSchedulingTransaction
} from 'selectors/transaction';
import { SendButtonFactoryClass } from 'components/SendButtonFactory';
const mapStateToProps = (state: AppState) => {
return {
walletType: getWalletType(state),
serializedTransaction: getSerializedTransaction(state),
...getSchedulingTransaction(state),
networkRequestPending: isNetworkRequestPending(state),
validGasPrice: isValidGasPrice(state),
validGasLimit: isValidGasLimit(state),
signedTx: !!getSignedTx(state) || !!getWeb3Tx(state)
};
};
export const SendScheduleTransactionButtonFactory = connect(mapStateToProps)(
SendButtonFactoryClass
);