Browse Source

update

all-modes
pbca26 8 years ago
parent
commit
89ca4a9206
  1. 8
      react/src/components/addcoin/addcoinOptionsCrypto.js
  2. 38
      react/src/components/dashboard/sendCoin.js
  3. 2
      react/src/components/dashboard/walletsData.js
  4. 2
      react/src/components/dashboard/walletsNativeTxHistory.js

8
react/src/components/addcoin/addcoinOptionsCrypto.js

@ -3,11 +3,13 @@ import { translate } from '../../translate/translate';
class AddCoinOptionsCrypto extends React.Component {
render() {
//<option value="ANC|full" data-full-mode="true">AnonCoin (ANC)</option>
//<option value="BTCD|full">BitcoinDark (BTCD)</option>
//<option value="MZC|full">MazaCoin (MZC)</option>
//<option value="SYS|full">SysCoin (SYS)</option>
return (
<optgroup label="Crypto Currencies">
<option value="ANC|full" data-full-mode="true">AnonCoin (ANC)</option>
<option value="BTC|full|basilisk">Bitcoin (BTC)</option>
<option value="BTCD|full">BitcoinDark (BTCD)</option>
<option value="BTM|full">Bitmark (BTM)</option>
<option value="CARB|full">Carboncoin (CARB)</option>
<option value="DGB|full">Digibyte (DGB)</option>
@ -16,8 +18,6 @@ class AddCoinOptionsCrypto extends React.Component {
<option value="GAME|full">Gamecredits (GAME)</option>
<option value="KMD|basilisk|native">Komodo (KMD)</option>
<option value="LTC|full">Litecoin (LTC)</option>
<option value="MZC|full">MazaCoin (MZC)</option>
<option value="SYS|full">SysCoin (SYS)</option>
<option value="UNO|full">Unobtanium (UNO)</option>
<option value="ZEC|full">Zcash (ZEC)</option>
<option value="ZET|full">Zetacoin (ZET)</option>

38
react/src/components/dashboard/sendCoin.js

@ -197,6 +197,7 @@ class SendCoin extends React.Component {
Store.dispatch(sendToAddressStateAlt(json));
}
} else {
Store.dispatch(sendToAddressStateAlt(json));
Store.dispatch(triggerToaster(true, translate('TOASTR.SIGNED_TX_GENERATED_FAIL') + '.', translate('TOASTR.WALLET_NOTIFICATION'), 'error'));
}
console.log(json);
@ -207,14 +208,22 @@ class SendCoin extends React.Component {
}, 1000);*/
}
renderSignedTx(signedtx) {
const substrBlocks = 10;
const substrLength = this.props.ActiveCoin.lastSendToResponse['signedtx'].length / substrBlocks;
renderSignedTx(isRawTx) {
let substrBlocks;
if (this.props.ActiveCoin.mode === 'basilisk') {
substrBlocks = isRawTx ? 3 : 8;
} else {
substrBlocks = 10;
}
const _lastSendToResponse = this.props.ActiveCoin.lastSendToResponse[isRawTx ? 'rawtx' : 'signedtx'];
const substrLength = _lastSendToResponse.length / substrBlocks;
let out = [];
for (let i = 0; i < substrBlocks; i++) {
out.push(
<div key={i}>{this.props.ActiveCoin.lastSendToResponse['signedtx'].substring(i * substrLength, substrLength * i + substrLength)}</div>
<div key={i}>{_lastSendToResponse.substring(i * substrLength, substrLength * i + substrLength)}</div>
);
}
@ -224,20 +233,18 @@ class SendCoin extends React.Component {
renderKey(key) {
if (key === 'signedtx') {
return this.renderSignedTx();
} else if (key === 'complete') {
if (this.props.ActiveCoin.lastSendToResponse[key] === true) {
} else if (key === 'rawtx') {
return this.renderSignedTx(true);
} else if (key === 'complete' || key === 'completed' || key === 'result') {
if (this.props.ActiveCoin.lastSendToResponse[key] === true || this.props.ActiveCoin.lastSendToResponse[key] === 'success') {
return (
<span className="label label-success">true</span>
<span className="label label-success">{this.props.ActiveCoin.lastSendToResponse[key] === true ? 'true' : 'success'}</span>
);
} else {
return (
<span className="label label-danger">false</span>
);
}
} else if (key === 'result') {
return (
<span>{this.props.ActiveCoin.lastSendToResponse[key]}</span>
);
} else if (key === 'error') {
return (
<span className="label label-danger">{this.props.ActiveCoin.lastSendToResponse[key]}</span>
@ -252,11 +259,18 @@ class SendCoin extends React.Component {
<span className="label label-danger">false</span>
);
}
} else if (key === 'txid' || key === 'sent') {
return (
<span>{this.props.ActiveCoin.lastSendToResponse[key]}</span>
);
} else if (key === 'tag') {
return null;
}
}
renderSendCoinResponse() {
if (this.props.ActiveCoin.lastSendToResponse) {
console.log('renderSendCoinResponse', this.props.ActiveCoin.lastSendToResponse);
return Object.keys(this.props.ActiveCoin.lastSendToResponse).map((key, index) =>
<tr key={key}>
<td>{key}</td>
@ -401,7 +415,7 @@ class SendCoin extends React.Component {
</div>
<div className="col-lg-10 margin-top-10">
<div className="pull-left margin-right-10">
<input type="checkbox" id="edexcoin_send_sig" onClick={this.toggleSendSig} data-plugin="switchery" data-size="small" />
<input type="checkbox" id="edexcoin_send_sig" data-plugin="switchery" data-size="small" />
</div>
<label className="padding-top-3" htmlFor="edexcoin_send_sig" onClick={this.toggleSendSig}>{translate('INDEX.DONT_SEND')}</label>
</div>

2
react/src/components/dashboard/walletsData.js

@ -204,7 +204,7 @@ class WalletsData extends React.Component {
renderPaginationItems() {
let items = [];
for (let i=0; i <= Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
for (let i=0; i < Math.ceil(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
items.push(
<li className={this.state.activePage === i + 1 ? 'paginate_button active' : 'paginate_button'}>
<a aria-controls="kmd-tx-history-tbl" data-dt-idx="1" tabIndex="0" key={i + '-pagination'} onClick={this.state.activePage !== (i + 1) ? () => this.updateCurrentPage(i + 1) : null}>{i + 1}</a>

2
react/src/components/dashboard/walletsNativeTxHistory.js

@ -105,7 +105,7 @@ class WalletsNativeTxHistory extends React.Component {
renderPaginationItems() {
let items = [];
for (let i=0; i <= Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
for (let i=0; i < Math.floor(this.props.ActiveCoin.txhistory.length / this.state.itemsPerPage); i++) {
items.push(
<li className={this.state.activePage === i + 1 ? 'paginate_button active' : 'paginate_button'}>
<a aria-controls="kmd-tx-history-tbl" data-dt-idx="1" tabIndex="0" key={i + '-pagination'} onClick={this.state.activePage !== (i + 1) ? () => this.updateCurrentPage(i + 1) : null}>{i + 1}</a>

Loading…
Cancel
Save