James Prado 816ce3180f Translation Updates (#1323)
* Update account view routing

* Temporarily add unicode character to translated strings for testing

* Temporarily select add unicode to all untranslated strings

* Format changes

* Add all english translations for /account & /generate

* Add the rest of the english translations

* Add a few more missing translations

* Update en translations

* Get selectedLanguage from localstorage instead of redux sttate

* Update snapshots

* Add missing translation keys & Update translate functs & change variable prefix

* translate all markdown strings & remove old translation strings

* Update snapshot

* Add a few more translation strs

* Move raw strings being translated into json

* All translation keys are now Uppercase

* Fix up the last few translations

* Update snapshot

* Uppercase de translation strings

* Bring back shapeshift logo on swap

* Fix contracts tab translations

* Fix a few more translations

* Fix translations

* remove debugging stuff

* Update snapshots

* Use react.fragment as markdown root renderer

* Seperate markdown translations into their own function

* Clean up translation functions

* Clean up translation functions

* Update snapshot

* Fix some broken translation strings

* Add prettier ignore file
2018-03-21 22:50:25 -05:00

84 lines
2.5 KiB
TypeScript

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 { getNetworkConfig } from 'selectors/config';
import { getParamFromURL } from 'utils/helpers';
import { AppState } from 'reducers';
import { NetworkConfig } from 'types/network';
import './index.scss';
import translate from 'translations';
interface StateProps {
network: NetworkConfig;
}
interface State {
hash: string;
}
type Props = StateProps & RouteComponentProps<{}>;
class CheckTransaction extends React.Component<Props, State> {
public state: State = {
hash: ''
};
public componentDidMount() {
const hash = getParamFromURL(this.props.location.search, 'txHash');
if (hash) {
this.setState({ hash });
}
}
public componentWillReceiveProps(nextProps: Props) {
const { network } = this.props;
if (network.chainId !== nextProps.network.chainId) {
this.setState({ hash: '' });
}
}
public render() {
const { network } = this.props;
const { hash } = this.state;
return (
<TabSection>
<div className="CheckTransaction Tab-content">
<section className="CheckTransaction-form Tab-content-pane">
<h1 className="CheckTransaction-form-title">{translate('CHECK_TX_STATUS_TITLE')}</h1>
<p className="CheckTransaction-form-desc">
{translate('CHECK_TX_STATUS_DESCRIPTION_1')}
{!network.isCustom &&
translate('CHECK_TX_STATUS_DESCRIPTION_2', {
$block_explorer: network.blockExplorer.name,
$block_explorer_link: network.blockExplorer.origin
})}
</p>
<TxHashInput hash={hash} onSubmit={this.handleHashSubmit} />
</section>
{hash && (
<section className="CheckTransaction-tx Tab-content-pane">
<TransactionStatusComponent key={network.chainId} txHash={hash} />
</section>
)}
</div>
</TabSection>
);
}
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);