Browse Source

Merge pull request #21 from SuperNETorg/v0.25

V0.25
v0.25
pbca26 7 years ago
committed by GitHub
parent
commit
a675b03abc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. BIN
      react/src/assets/images/cryptologo/grs.png
  2. BIN
      react/src/assets/images/cryptologo/hodlc.png
  3. BIN
      react/src/assets/images/cryptologo/qtum.png
  4. 2
      react/src/components/addcoin/addcoinOptionsAC.js
  5. 20
      react/src/components/addcoin/addcoinOptionsCrypto.js
  6. 57
      react/src/components/dashboard/notaryElectionsModal/notaryElectionsModal.scss
  7. 29
      react/src/components/dashboard/sendCoin/sendCoin.js
  8. 34
      react/src/components/dashboard/tools/tools.js
  9. 10
      react/src/components/dashboard/tools/tools.scss
  10. 78
      react/src/components/dashboard/tools/toolsPubCheck.js
  11. 19
      react/src/components/dex/table/dexSwapsTable.js
  12. 3
      react/src/components/login/login.js
  13. 4
      react/src/components/overrides.scss
  14. 20
      react/src/util/coinHelper.js

BIN
react/src/assets/images/cryptologo/grs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
react/src/assets/images/cryptologo/hodlc.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
react/src/assets/images/cryptologo/qtum.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

2
react/src/components/addcoin/addcoinOptionsAC.js

@ -29,7 +29,7 @@ const addCoinOptionsAC = () => {
let _items = [];
for (let i = 0; i < _assetChains.length; i++) {
let availableModes = _assetChains[i] !== 'kv' && _assetChains[i] !== 'axo' && _assetChains[i] !== 'etomic' && _assetChains[i] !== 'beer' && _assetChains[i] !== 'pizza' ? 'spv|native' : 'native';
let availableModes = _assetChains[i] !== 'kv' && _assetChains[i] !== 'axo' && _assetChains[i] !== 'etomic' ? 'spv|native' : 'native';
if (mainWindow.arch !== 'x64') {
availableModes = 'spv';

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

@ -96,6 +96,26 @@ const addCoinOptionsCrypto = () => {
label: 'Myriad (XMY)',
icon: 'XMY',
value: `XMY|spv`,
},/* {
label: 'Groestlcoin (GRS)',
icon: 'GRS',
value: `GRS|spv`,
}, */{
label: 'Hodlc (HODLC)',
icon: 'HODLC',
value: `HODLC|spv`,
}, {
label: 'Bitcore (BTX)',
icon: 'BTX',
value: `BTX|spv`,
}, {
label: 'Qtum (QTUM)',
icon: 'QTUM',
value: `QTUM|spv`,
}, {
label: 'BitcoinZ (BTCZ)',
icon: 'BTCZ',
value: `BTCZ|spv`,
});
}

57
react/src/components/dashboard/notaryElectionsModal/notaryElectionsModal.scss

@ -14,6 +14,7 @@
height: inherit;
max-height: 90vh;
overflow-y: auto;
overflow-x: hidden;
}
.elections-title {
@ -59,11 +60,15 @@
}
.elections-map {
position: absolute;
width: 100%;
left: 0;
height: 350px;
text-align: center;
}
.elections-map-node {
position: absolute;
position: relative;
.notary-elections-node-title {
color: #fff !important;
@ -74,6 +79,7 @@
}
img {
position: absolute;
width: 35px;
background: #fff;
border-radius: 50%;
@ -90,34 +96,51 @@
border: solid 5px #fff;
}
}
&:hover {
img {
width: 40px;
}
img:hover {
width: 40px;
}
&.elections-map-node--na {
left: 210px;
top: 258px;
}
&.elections-map-node--sh {
left: 632px;
top: 382px;
left: -234px;
top: -262px;
.notary-elections-node-title {
margin-top: 26px;
margin-left: 34px;
margin-top: -6px;
margin-left: 38px;
}
}
&.elections-map-node--ae {
left: 560px;
top: 284px;
left: 114px;
top: -236px;
.notary-elections-node-title {
margin-top: -6px;
margin-left: 40px;
}
}
&.elections-map-node--sh {
left: 190px;
top: -138px;
.notary-elections-node-title {
margin-left: 32px;
margin-top: 30px;
}
}
&.elections-map-node--eu {
left: 412px;
top: 250px;
left: -28px;
top: -268px;
.notary-elections-node-title {
margin-top: -4px;
margin-left: 40px;
}
}
}
.elections-voter-ui {
height: 350px;
}
.elections-balance,
.elections-history {
font-size: 16px;

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

@ -541,15 +541,26 @@ class SendCoin extends React.Component {
}
if (!this.state.sendTo ||
this.state.sendTo.length < 34) {
Store.dispatch(
triggerToaster(
translate('SEND.SEND_TO_ADDRESS_MIN_LENGTH'),
translate('TOASTR.WALLET_NOTIFICATION'),
'error'
)
);
valid = false;
(this.state.sendTo && this.state.sendTo.substring(0, 2) !== 'zc')) {
const _validateAddress = mainWindow.addressVersionCheck(this.props.ActiveCoin.coin, this.state.sendTo);
let _msg;
if (_validateAddress === 'Invalid pub address') {
_msg = _validateAddress;
} else if (!_validateAddress) {
_msg = `${this.state.sendTo} is not a valid ${this.props.ActiveCoin.coin} pub address`;
}
if (_msg) {
Store.dispatch(
triggerToaster(
_msg,
translate('TOASTR.WALLET_NOTIFICATION'),
'error'
)
);
valid = false;
}
}
if (!isPositiveNumber(this.state.amount)) {

34
react/src/components/dashboard/tools/tools.js

@ -7,6 +7,7 @@ import ToolsOfflineSigCreate from './toolsOfflineSigCreate';
import ToolsOfflineSigScan from './toolsOfflineSigScan';
import ToolsSeedToWif from './toolsSeedToWif';
import ToolsWifToWif from './toolsWifToWif';
import ToolsPubCheck from './toolsPubCheck';
import ToolsStringToQr from './toolsStringToQr';
import ToolsMergeUTXO from './toolsMergeUtxo';
import ToolsSplitUTXO from './toolsSplitUtxo';
@ -25,6 +26,10 @@ class Tools extends React.Component {
});
}
/*renderButtons() {
Offline signing scan
}*/
render() {
return (
<div className="page margin-left-0">
@ -32,7 +37,7 @@ class Tools extends React.Component {
<div className="row">
<div className="col-sm-12 no-padding-left">
<h2>Tools</h2>
<div className="margin-top-20">
<div className="margin-top-20 tools-btn-block">
<button
type="button"
className="btn btn-default"
@ -41,53 +46,59 @@ class Tools extends React.Component {
</button>
<button
type="button"
className="btn btn-default margin-left-20"
className="btn btn-default"
onClick={ () => this.setActiveSection('offlinesig-scan') }>
Offline signing scan
</button>
<button
type="button"
className="btn btn-default margin-left-20"
className="btn btn-default"
onClick={ () => this.setActiveSection('string2qr') }>
String to QR
</button>
<button
type="button"
className="btn btn-default margin-left-20"
className="btn btn-default"
onClick={ () => this.setActiveSection('seed2kp') }>
Seed to key pair
</button>
<button
type="button"
className="btn btn-default margin-left-20"
className="btn btn-default"
onClick={ () => this.setActiveSection('wif2wif') }>
WIF to WIF
</button>
<button
type="button"
className="btn btn-default margin-left-20"
className="btn btn-default"
onClick={ () => this.setActiveSection('pubcheck') }>
Address version check
</button>
<button
type="button"
className="btn btn-default"
onClick={ () => this.setActiveSection('balance') }>
Balance *
</button>
<button
type="button"
className="btn btn-default margin-left-20"
className="btn btn-default"
onClick={ () => this.setActiveSection('utxo') }>
UTXO *
</button>
<button
type="button"
className="btn btn-default margin-left-20"
className="btn btn-default"
onClick={ () => this.setActiveSection('utxo-split') }>
Split UTXO **
</button>
<button
type="button"
className="btn btn-default margin-left-20"
className="btn btn-default"
onClick={ () => this.setActiveSection('utxo-merge') }>
Merge UTXO **
</button>
<div className="margin-top-10">* Electrum, ** Native</div>
<div className="margin-top-10 margin-left-20">* Electrum, ** Native</div>
</div>
<hr />
{ this.state.activeSection === 'offlinesig-create' &&
@ -108,6 +119,9 @@ class Tools extends React.Component {
{ this.state.activeSection === 'wif2wif' &&
<ToolsWifToWif />
}
{ this.state.activeSection === 'pubcheck' &&
<ToolsPubCheck />
}
{ this.state.activeSection === 'seed2kp' &&
<ToolsSeedToWif />
}

10
react/src/components/dashboard/tools/tools.scss

@ -36,4 +36,14 @@
top: -6px;
left: 18px;
}
.tools-btn-block {
position: relative;
left: -20px;
.btn {
margin-bottom: 20px;
margin-left: 20px;
}
}
}

78
react/src/components/dashboard/tools/toolsPubCheck.js

@ -0,0 +1,78 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import mainWindow from '../../../util/mainWindow';
class ToolsPubCheck extends React.Component {
constructor() {
super();
this.state = {
pub: '',
pubResult: null,
};
this.updateInput = this.updateInput.bind(this);
this.pubCheck = this.pubCheck.bind(this);
}
pubCheck() {
this.setState({
pubResult: mainWindow.getCoinByPub(this.state.pub),
});
}
updateInput(e) {
this.setState({
[e.target.name]: e.target.value,
});
}
render() {
return (
<div className="row margin-left-10">
<div className="col-xlg-12 form-group form-material no-padding-left padding-bottom-10">
<h4>Pub address version check</h4>
</div>
<div className="col-sm-12 form-group form-material no-padding-left padding-top-10 padding-bottom-20">
<label
className="control-label col-sm-1 no-padding-left"
htmlFor="kmdWalletSendTo">Pub address</label>
<input
type="text"
className="form-control col-sm-3"
name="pub"
onChange={ this.updateInput }
value={ this.state.pub }
placeholder="Enter a pub address"
autoComplete="off"
required />
</div>
<div className="col-sm-12 form-group form-material no-padding-left margin-top-10 padding-bottom-10">
<button
type="button"
className="btn btn-info col-sm-2"
onClick={ this.pubCheck }>
Check version
</button>
</div>
{ this.state.pubResult &&
<div className="col-sm-12 form-group form-material no-padding-left margin-top-10">
{ this.state.pubResult.coin &&
<div>
<div>Coin(s): {
this.state.pubResult.coin.map((item) => {
return(<div key={ `tools-pub-check-${item}` }>{ item }</div>);
})
}</div>
<div className="margin-top-10">Version: { this.state.pubResult.version }</div>
</div>
}
{ !this.state.pubResult.coin &&
<div>{ this.state.pubResult }</div>
}
</div>
}
</div>
);
}
}
export default ToolsPubCheck;

19
react/src/components/dex/table/dexSwapsTable.js

@ -123,14 +123,17 @@ class DexSwapsTable extends React.Component {
}
componentWillMount() {
const _swaps = this.props.Dex.swaps.swaps.filter(swap => swap.alice && swap.finishtime);
this.setState({
itemsList: _swaps,
filteredItemsList: this.filterData(_swaps, this.state.searchTerm),
showPagination: _swaps && _swaps.length >= this.state.defaultPageSize,
itemsListColumns: this.generateItemsListColumns(_swaps.length),
});
if (this.props.Dex.swaps &&
this.props.Dex.swaps.swaps) {
const _swaps = this.props.Dex.swaps.swaps.filter(swap => swap.alice && swap.finishtime);
this.setState({
itemsList: _swaps,
filteredItemsList: this.filterData(_swaps, this.state.searchTerm),
showPagination: _swaps && _swaps.length >= this.state.defaultPageSize,
itemsListColumns: this.generateItemsListColumns(_swaps.length),
});
}
}
componentWillReceiveProps(props) {

3
react/src/components/login/login.js

@ -65,6 +65,7 @@ class Login extends React.Component {
selectedShortcutNative: '',
selectedShortcutSPV: '',
};
this.defaultState = JSON.parse(JSON.stringify(this.state));
this.toggleActivateCoinForm = this.toggleActivateCoinForm.bind(this);
this.updateRegisterConfirmPassPhraseInput = this.updateRegisterConfirmPassPhraseInput.bind(this);
this.updateLoginPassPhraseInput = this.updateLoginPassPhraseInput.bind(this);
@ -348,6 +349,8 @@ class Login extends React.Component {
Store.dispatch(shepherdElectrumAuth(this.state.loginPassphrase));
Store.dispatch(shepherdElectrumCoins());
}
this.setState(this.defaultState);
}
loadPinList() {

4
react/src/components/overrides.scss

@ -288,6 +288,10 @@ select{
cursor: pointer;
text-align: left;
img {
border-radius: 50%;
}
* { color: #757575 !important; }
.Select-clear {

20
react/src/util/coinHelper.js

@ -6,6 +6,26 @@ export function getCoinTitle(coin) {
let hideTitle = false;
switch (coin) {
case 'GRS':
coinlogo = 'grs';
coinname = 'Groestlcoin';
break;
case 'BTCZ':
coinlogo = 'btcz';
coinname = 'BitcoinZ';
break;
case 'QTUM':
coinlogo = 'qtum';
coinname = 'Qtum';
break;
case 'BTX':
coinlogo = 'btx';
coinname = 'Bitcore';
break;
case 'HODLC':
coinlogo = 'hodlc';
coinname = 'Hodl coin';
break;
case 'BEER':
coinlogo = 'beer';
coinname = 'BEER (Test coin)';

Loading…
Cancel
Save