Browse Source

resolved merge conflicts

all-modes
pbca26 7 years ago
parent
commit
e948cc8ec8
  1. 1
      react/change.log
  2. 64
      react/src/components/dashboard/about/about.js
  3. 4
      react/src/components/dashboard/main/dashboard.render.js
  4. 4
      react/src/components/dashboard/walletsNative/walletsNative.render.js
  5. 44
      react/src/components/dashboard/walletsNativeTxInfo/walletsNativeTxInfo.js
  6. 156
      react/src/components/dashboard/walletsNativeTxInfo/walletsNativeTxInfo.render.js
  7. 9
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js
  8. 75
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js
  9. 24
      react/src/components/login/login.js
  10. 3
      react/src/components/login/login.render.js
  11. 12
      react/src/components/login/login.scss
  12. 4
      react/src/translate/en.js

1
react/change.log

@ -18,6 +18,7 @@ front:
- seed type check
- seed extra space(s) check
- custom seed option
- copy seed button
back:
- added cli route

64
react/src/components/dashboard/about/about.js

@ -1,16 +1,72 @@
import React from 'react';
import React from "react";
class About extends React.Component {
render() {
return (
<div className="page margin-left-0">
<div className="page-content">
<h2>About Iguana</h2>
<p>Page content goes here</p>
<h2>About Agama</h2>
<p>Agama Wallet is a desktop app that you can use to manage multiple cryptocurrency wallets. When you set up a
wallet, you can configure it to operate in one of the following modes:
<ul>
<li>
<span className="font-weight-600">Basilisk Mode</span>: Doesn't download the blockchain. Slightly slower
transaction performance.
</li>
<li>
<span className="font-weight-600">Full Mode</span>: Downloads the full blockchain, which can take a
while. Good transaction performance.
</li>
<li>
<span className="font-weight-600">Native Mode</span>: Only available for a few currencies. Like 'Full
Mode' but provides advanced functionality.
</li>
</ul>
Agama includes the following capabilities:
<ul>
<li>
<span className="font-weight-600">InstantDEX</span>: Easily exchange cryptocurrencies via a
shapeshift-like service.
<a href="https://supernet.org/en/technology/whitepapers/easydex-a-practical-native-dex" target="_blank">
(EasyDEX A Practical Native DEX)
</a>
</li>
<li>
<span className="font-weight-600">Atomic Exporer</span>: A universal local explorer ensures you don't
have query information from a centralized
server.
</li>
</ul>
<span className="font-weight-600">
Note: Agama Wallet is still in development. It is safe to use,
but you should make proper backups. We do not recommend using it as the primarily wallet for your cryptocurrencies.
</span>
<br/>
<span className="font-weight-600">Testers</span>:
You can help us test Agama. Just <a target="_blank" href="https://supernet.org/en/products/agama-wallet">download and install the latest release</a>.
Then, report any bugs you encounter to our developers on the #testing-agama Slack channel.
Your help is greatly appreciated!
Agama also supports the following desktop apps:
<ul>
<li>
<span className="font-weight-600">Jumblr</span>: A decentralized Bitcoin blockchain tumbler for privacy
and lower fees.
</li>
<li>
<span className="font-weight-600">NativeDEX</span>
</li>
</ul>
</p>
</div>
</div>
);
}
}
export default About;
export default About;

4
react/src/components/dashboard/main/dashboard.render.js

@ -14,7 +14,6 @@ import Settings from '../settings/settings';
import ReceiveCoin from '../receiveCoin/receiveCoin';
import About from '../about/about';
import WalletsNative from '../walletsNative/walletsNative';
import WalletsNativeTxInfo from '../walletsNativeTxInfo/walletsNativeTxInfo';
import WalletsTxInfo from '../walletsTxInfo/walletsTxInfo';
const DashboardRender = function() {
@ -30,11 +29,10 @@ const DashboardRender = function() {
{ !this.isNativeMode() && <WalletsProgress {...this.props} /> }
{ !this.isNativeMode() && <WalletsBalance {...this.props} />}
<SendCoin {...this.props} />
<ReceiveCoin {...this.props.ActiveCoin} />
<WalletsData {...this.props} />
<WalletsTxInfo {...this.props} />
<WalletsNative {...this.props} />
<ReceiveCoin {...this.props.ActiveCoin} />
<WalletsNativeTxInfo {...this.props} />
</div>
<div className={ this.isSectionActive('edex') ? 'show' : 'hide' }>
<EDEX {...this.props} />

4
react/src/components/dashboard/walletsNative/walletsNative.render.js

@ -16,7 +16,9 @@ const WalletsNativeRender = function() {
<ol className="breadcrumb">
<li className="header-easydex-section">
<img src={ `assets/images/native/${this.defaultBG()}_header_title_logo.png` } />
<span className={ `easydex-section-image ${(this.props.ActiveCoin.coin === 'KMD' ? 'hide' : '')}` }>
<span
className={ `easydex-section-image ${(this.props.ActiveCoin.coin === 'KMD' ? 'hide' : '')}` }
style={{ marginLeft: '20px' }}>
{ this.props.ActiveCoin.coin }
</span>
</li>

44
react/src/components/dashboard/walletsNativeTxInfo/walletsNativeTxInfo.js

@ -1,44 +0,0 @@
import React from 'react';
import { toggleDashboardTxInfoModal } from '../../../actions/actionCreators';
import Store from '../../../store';
class WalletsNativeTxInfo extends React.Component {
constructor(props) {
super(props);
this.state = {
activeTab: 0,
};
this.toggleTxInfoModal = this.toggleTxInfoModal.bind(this);
}
toggleTxInfoModal() {
Store.dispatch(toggleDashboardTxInfoModal(false));
}
openTab(tab) {
this.setState(Object.assign({}, this.state, {
activeTab: tab,
}));
}
handleKeydown(e) {
if (e.key === 'Escape') {
this.toggleTxInfoModal();
}
}
render() {
if (this.props &&
this.props.ActiveCoin.showTransactionInfo &&
this.props.ActiveCoin.nativeActiveSection === 'default' &&
this.props.ActiveCoin.mode === 'native') {
const txInfo = this.props.ActiveCoin.txhistory[this.props.ActiveCoin.showTransactionInfoTxIndex];
return WalletsNativeTxInfoRender.call(this, txInfo);
} else {
return null;
}
}
}
export default WalletsNativeTxInfo;

156
react/src/components/dashboard/walletsNativeTxInfo/walletsNativeTxInfo.render.js

@ -1,156 +0,0 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import { secondsToString } from '../../../util/time';
const WalletsNativeTxInfoRender = function(txInfo) {
return (
<div onKeyDown={ (event) => this.handleKeydown(event) }>
<div
className="modal show"
id="kmd_txid_info_mdl">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body modal-body-container">
<div className="panel nav-tabs-horizontal">
<ul className="nav nav-tabs nav-tabs-line">
<li className={ this.state.activeTab === 0 ? 'active' : '' }>
<a onClick={ () => this.openTab(0) }>
<i className="icon md-balance-wallet"></i>TxID Info
</a>
</li>
<li className={ this.state.activeTab === 1 ? 'active' : '' }>
<a onClick={ () => this.openTab(1) }>
<i className="icon md-plus-square"></i>Vjointsplits, Details
</a>
</li>
<li className={ this.state.activeTab === 2 ? 'active' : '' }>
<a onClick={ () => this.openTab(2) }>
<i className="icon wb-briefcase"></i>Hex
</a>
</li>
<li className={ this.state.activeTab === 3 ? 'active' : '' }>
<a onClick={ () => this.openTab(3) }>
<i className="icon wb-file"></i>Raw info
</a>
</li>
</ul>
<div className="panel-body">
<div className="tab-content">
<div className={ this.state.activeTab === 0 ? 'tab-pane active' : 'tab-pane' }>
<table className="table table-striped">
<tbody>
<tr>
<td>amount</td>
<td>
{ txInfo.amount }
</td>
</tr>
<tr>
<td>fee</td>
<td>
{ txInfo.fee }
</td>
</tr>
<tr>
<td>confirmations</td>
<td>
{ txInfo.confirmations }
</td>
</tr>
<tr>
<td>blockhash</td>
<td>
{ txInfo.blockhash }
</td>
</tr>
<tr>
<td>blockindex</td>
<td>
{ txInfo.blockindex }
</td>
</tr>
<tr>
<td>blocktime</td>
<td>
{ secondsToString(txInfo.blocktime) }
</td>
</tr>
<tr>
<td>txid</td>
<td>
{ txInfo.txid }
</td>
</tr>
<tr>
<td>walletconflicts</td>
<td>
{ txInfo.walletconflicts.length }
</td>
</tr>
<tr>
<td>time</td>
<td>
{ secondsToString(txInfo.time) }
</td>
</tr>
<tr>
<td>timereceived</td>
<td>
{ secondsToString(txInfo.timereceived) }
</td>
</tr>
</tbody>
</table>
</div>
<div className={ this.state.activeTab === 1 ? 'tab-pane active' : 'tab-pane' }>
<table className="table table-striped">
<tbody>
<tr>
<td>vjoinsplit</td>
<td>
{ txInfo.vjoinsplit }
</td>
</tr>
<tr>
<td>details</td>
<td>
{ txInfo.details }
</td>
</tr>
</tbody>
</table>
</div>
<div className={ this.state.activeTab === 2 ? 'tab-pane active' : 'tab-pane' }>
<textarea
className="full-width height-170"
rows="10"
cols="80"
defaultValue={ txInfo.hex } disabled></textarea>
</div>
<div className={ this.state.activeTab === 3 ? 'tab-pane active' : 'tab-pane' }>
<textarea
className="full-width height-400"
rows="40"
cols="80"
defaultValue={ JSON.stringify(txInfo, null, '\t') }
disabled></textarea>
</div>
</div>
</div>
</div>
</div>
<div className="modal-footer">
<button
type="button"
className="btn btn-default"
onClick={ this.toggleTxInfoModal }>{ translate('INDEX.CLOSE') }</button>
</div>
</div>
</div>
</div>
<div className="modal-backdrop show in"></div>
</div>
);
};
export default WalletsNativeTxInfoRender;

9
react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js

@ -28,10 +28,17 @@ class WalletsTxInfo extends React.Component {
}
}
isNativeMode() {
return this.props.ActiveCoin.mode === 'native';
}
render() {
if (this.props &&
this.props.ActiveCoin.showTransactionInfo &&
this.props.ActiveCoin.mode !== 'native') {
// TODO the conditions below should be merged once the native mode components are fully merged
// into the rest of the components
(!this.isNativeMode() ||
(this.isNativeMode() && this.props.ActiveCoin.nativeActiveSection === 'default'))) {
const txInfo = this.props.ActiveCoin.txhistory[this.props.ActiveCoin.showTransactionInfoTxIndex];
return WalletsTxInfoRender.call(this, txInfo);
}

75
react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js

@ -18,8 +18,25 @@ const WalletsTxInfoRender = function(txInfo) {
<i className="icon md-balance-wallet"></i>TxID Info
</a>
</li>
<li className={ this.state.activeTab === 1 ? 'active' : '' }>
<a onClick={ () => this.openTab(1) }>
{ this.isNativeMode() &&
<li className={ this.state.activeTab === 1 ? 'active' : '' }>
<a onClick={ () => this.openTab(1) }>
<i className="icon md-plus-square"></i>Vjointsplits, Details
</a>
</li>
}
{ this.isNativeMode() &&
<li className={ this.state.activeTab === 2 ? 'active' : '' }>
<a onClick={ () => this.openTab(2) }>
<i className="icon wb-briefcase"></i>Hex
</a>
</li>
}
<li className={ this.state.activeTab === 3 ? 'active' : '' }>
<a onClick={ () => this.openTab(3) }>
<i className="icon wb-file"></i>Raw info
</a>
</li>
@ -71,10 +88,64 @@ const WalletsTxInfoRender = function(txInfo) {
{ txInfo.txid }
</td>
</tr>
{ this.isNativeMode() &&
<tr>
<td>walletconflicts</td>
<td>
{ txInfo.walletconflicts.length }
</td>
</tr>
}
{ this.isNativeMode() &&
<tr>
<td>time</td>
<td>
{ secondsToString(txInfo.time) }
</td>
</tr>
}
{ this.isNativeMode() &&
<tr>
<td>timereceived</td>
<td>
{ secondsToString(txInfo.timereceived) }
</td>
</tr>
}
</tbody>
</table>
</div>
<div className={ this.state.activeTab === 1 ? 'tab-pane active' : 'tab-pane' }>
<table className="table table-striped">
<tbody>
<tr>
<td>vjoinsplit</td>
<td>
{ txInfo.vjoinsplit }
</td>
</tr>
<tr>
<td>details</td>
<td>
{ txInfo.details }
</td>
</tr>
</tbody>
</table>
</div>
<div className={ this.state.activeTab === 2 ? 'tab-pane active' : 'tab-pane' }>
<textarea
className="full-width height-170"
rows="10"
cols="80"
defaultValue={ txInfo.hex } disabled></textarea>
</div>
<div className={ this.state.activeTab === 3 ? 'tab-pane active' : 'tab-pane' }>
<textarea
className="full-width height-400"
rows="40"

24
react/src/components/login/login.js

@ -7,7 +7,8 @@ import {
getDexCoins,
toggleSyncOnlyModal,
getSyncOnlyForks,
createNewWallet
createNewWallet,
triggerToaster
} from '../../actions/actionCreators';
import Store from '../../store';
import {PassPhraseGenerator} from '../../util/crypto/passphrasegenerator';
@ -44,6 +45,7 @@ class Login extends React.Component {
this.handleRegisterWallet = this.handleRegisterWallet.bind(this);
this.openSyncOnlyModal = this.openSyncOnlyModal.bind(this);
this.toggleSeedBackupModal = this.toggleSeedBackupModal.bind(this);
this.copyPassPhraseToClipboard = this.copyPassPhraseToClipboard.bind(this);
this.execWalletCreate = this.execWalletCreate.bind(this);
}
@ -266,7 +268,7 @@ class Login extends React.Component {
isSeedConfirmError: !enteredSeedsMatch ? true : false,
isSeedBlank: isSeedBlank ? true : false,
});
if (enteredSeedsMatch && !isSeedBlank && _customSeed !== null) {
this.toggleSeedBackupModal();
}
@ -288,6 +290,24 @@ class Login extends React.Component {
}));
}
copyPassPhraseToClipboard() {
const passPhrase = this.state.randomSeed;
const textField = document.createElement('textarea');
textField.innerText = passPhrase;
document.body.appendChild(textField);
textField.select();
document.execCommand('copy');
textField.remove();
Store.dispatch(
triggerToaster(
translate('LOGIN.SEED_SUCCESSFULLY_COPIED'),
translate('LOGIN.SEED_COPIED'),
'success'
)
);
}
renderSwallModal() {
if (this.state.displaySeedBackupModal) {
return SwallModalRender.call(this);

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

@ -197,6 +197,9 @@ const LoginRender = function () {
onChange={ (e) => this.updateWalletSeed(e) }
readOnly={ !this.isCustomWalletSeed() }
></textarea>
<button className="copy-floating-label"
htmlFor="walletseed"
onClick={ () => this.copyPassPhraseToClipboard() }>Copy</button>
<span className={ this.state.isCustomSeedWeak ? 'tooltiptext' : 'hide' }>
<strong>Weak seed!</strong><br /><br />
Your seed must contain:<br />

12
react/src/components/login/login.scss

@ -89,4 +89,16 @@ textarea {
.auto-side-margin {
margin-left: auto;
margin-right: auto;
}
button.copy-floating-label {
position: absolute;
font-weight: 500;
font-size: 11.2px;
top: -11px;
right: 0;
background-color: #757575;
border: 0;
cursor: pointer;
z-index: 1000;
}

4
react/src/translate/en.js

@ -408,7 +408,9 @@ export const _lang = {
'SEED_NOT_OF_TYPE': 'The inserted seed is not of type',
'IGUANA_SEED': 'Iguana (256 bits)',
'WAVES_SEED': 'Waves',
'NXT_SEED': 'NXT'
'NXT_SEED': 'NXT',
'SEED_COPIED': 'Seed copied',
'SEED_SUCCESSFULLY_COPIED': 'The seed was successfully copied'
},
'SIDEBAR': {
'EDEX_MOTTO': 'Most Secure, Easy and Native Decentralised Exchange',

Loading…
Cancel
Save