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

100 lines
3.3 KiB
TypeScript

import translate from 'translations';
import classnames from 'classnames';
import { DataFieldFactory } from 'components/DataFieldFactory';
import { SendButtonFactory } from 'components/SendButtonFactory';
import { SigningStatus } from 'components/SigningStatus';
import WalletDecrypt, { DISABLE_WALLETS } from 'components/WalletDecrypt';
import { GenerateTransaction } from 'components/GenerateTransaction';
import React, { Component } from 'react';
import { setToField, TSetToField } from 'actions/transaction';
import { resetWallet, TResetWallet } from 'actions/wallet';
import { connect } from 'react-redux';
import { FullWalletOnly } from 'components/renderCbs';
import { NonceField, TXMetaDataPanel } from 'components';
import './Deploy.scss';
import { ConfirmationModal } from 'components/ConfirmationModal';
import { TextArea } from 'components/ui';
interface DispatchProps {
setToField: TSetToField;
resetWallet: TResetWallet;
}
class DeployClass extends Component<DispatchProps> {
public render() {
const makeContent = () => (
<main className="Deploy Tab-content-pane" role="main">
<button className="Deploy-field-reset btn btn-default btn-sm" onClick={this.changeWallet}>
<i className="fa fa-refresh" />
{translate('CHANGE_WALLET')}
</button>
<div className="input-group-wrapper Deploy-field">
<label className="input-group">
<div className="input-group-header">{translate('CONTRACT_BYTECODE')}</div>
<DataFieldFactory
withProps={({ data: { raw, value }, onChange, readOnly }) => (
<TextArea
name="byteCode"
placeholder="0x8f87a973e..."
rows={6}
onChange={onChange}
disabled={readOnly}
className={classnames('Deploy-field-input', 'form-control', {
'is-valid': value && value.length > 0
})}
value={raw}
/>
)}
/>
</label>
</div>
<div className="row form-group">
<div className="col-xs-12 clearfix">
<NonceField alwaysDisplay={false} />
</div>
</div>
<div className="row form-group">
<div className="col-xs-12 clearfix">
<TXMetaDataPanel
initialState="advanced"
disableToggle={true}
advancedGasOptions={{ dataField: false }}
/>
</div>
</div>
<div className="row form-group">
<div className="col-xs-12 clearfix">
<GenerateTransaction />
</div>
</div>
<SigningStatus />
<SendButtonFactory
Modal={ConfirmationModal}
withProps={({ onClick }) => (
<button className="Deploy-submit btn btn-primary" onClick={onClick}>
{translate('NAV_DEPLOYCONTRACT')}
</button>
)}
/>
</main>
);
const makeDecrypt = () => <WalletDecrypt disabledWallets={DISABLE_WALLETS.READ_ONLY} />;
return <FullWalletOnly withFullWallet={makeContent} withoutFullWallet={makeDecrypt} />;
}
private changeWallet = () => {
this.props.resetWallet();
};
}
export const Deploy = connect(null, {
setToField,
resetWallet
})(DeployClass);