import React from 'react'; import { connect } from 'react-redux'; import { RouteComponentProps } from 'react-router'; import TabSection from 'containers/TabSection'; import TxHashInput from './components/TxHashInput'; import { TransactionStatus as TransactionStatusComponent } from 'components'; import { NewTabLink } from 'components/ui'; import { getNetworkConfig } from 'selectors/config'; import { getParamFromURL } from 'utils/helpers'; import { AppState } from 'reducers'; import { NetworkConfig } from 'types/network'; import './index.scss'; interface StateProps { network: NetworkConfig; } interface State { hash: string; } type Props = StateProps & RouteComponentProps<{}>; class CheckTransaction extends React.Component { public state: State = { hash: '' }; public componentDidMount() { const hash = getParamFromURL(this.props.location.search, 'txHash'); if (hash) { this.setState({ hash }); } } public render() { const { network } = this.props; const { hash } = this.state; return (

Check Transaction Status

Enter your Transaction Hash to check on its status.{' '} {!network.isCustom && ( If you don’t know your Transaction Hash, you can look it up on the{' '} {network.blockExplorer.name} explorer {' '} by looking up your address. )}

{hash && (
)}
); } private handleHashSubmit = (hash: string) => { // Reset to re-mount the component this.setState({ hash: '' }, () => { this.setState({ hash }); }); }; } export default connect((state: AppState): StateProps => ({ network: getNetworkConfig(state) }))(CheckTransaction);