Newer
Older
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
import React, { Component } from 'react';
import { chainName$, withoutLoading } from '@parity/light.js';
import { inject, observer } from 'mobx-react';
import light from '@parity/light.js-react';
import { withProps } from 'recompose';
Luke Schoen
committed
import RequireHealthOverlay from '../../RequireHealthOverlay';
import check from '../../assets/img/icons/check.svg';
import loading from '../../assets/img/icons/loading.svg';
import withTokens from '../../utils/withTokens';
Luke Schoen
committed
import { SentModal } from './SentModal';
chainName: () => chainName$().pipe(withoutLoading())
@withTokens
@withProps(({ match: { params: { tokenAddress } }, tokens }) => ({
token: tokens[tokenAddress]
}))
@observer
class Sent extends Component {
// If we refresh on this page, return to homepage
if (!this.props.sendStore.txStatus) {
this.handleGoToHomepage();
}
handleGoToHomepage = () => {
const { history, sendStore } = this.props;
sendStore.clear();
history.push('/');
};
Luke Schoen
committed
<RequireHealthOverlay require='connected' fullscreen>
<div className='window_content'>
<SentModal
confirmationsCount={sendStore.confirmations}
chainName={chainName}
check={check}
handleGoToHomepage={this.handleGoToHomepage}
loading={loading}
token={token}
txStatus={sendStore.txStatus}
/>
</div>
</RequireHealthOverlay>
);
}
}
export default Sent;