Browse Source

sync only navbar item

all-modes
pbca26 8 years ago
parent
commit
7416e52cc8
  1. 1
      react/src/actions/actionCreators.js
  2. 4
      react/src/components/addcoin/addcoin.js
  3. 21
      react/src/components/dashboard/navbar.js
  4. 114
      react/src/components/login/login.js

1
react/src/actions/actionCreators.js

@ -2305,7 +2305,6 @@ function initNotaryNodesConSequence(nodes) {
}
function updateNotaryNodeConState(json, totalNodes, currentNodeIndex, currentNodeName) {
console.log(currentNodeName, json);
if (currentNodeIndex === totalNodes - 1) {
return dispatch => {
dispatch(basiliskConnectionState(false));

4
react/src/components/addcoin/addcoin.js

@ -12,8 +12,6 @@ import AddCoinOptionsCrypto from './addcoinOptionsCrypto';
import AddCoinOptionsAC from './addcoinOptionsAC';
import AddCoinOptionsACFiat from './addcoinOptionsACFiat';
// TODO: fix add coin bug
class AddCoin extends React.Component {
constructor(props) {
super(props);
@ -165,8 +163,6 @@ class AddCoin extends React.Component {
this.setState(Object.assign({}, this.state, {
coins: _coins
}));
console.log(_coins[index]);
}
handleKeydown(e) {

21
react/src/components/dashboard/navbar.js

@ -4,7 +4,10 @@ import {
dashboardChangeSection,
toggleAddcoinModal,
logout,
stopInterval
stopInterval,
toggleSyncOnlyModal,
startInterval,
getSyncOnlyForks
} from '../../actions/actionCreators';
import Store from '../../store';
@ -38,6 +41,17 @@ class Navbar extends React.Component {
Store.dispatch(logout());
}
openSyncOnlyModal() {
Store.dispatch(getSyncOnlyForks());
var _iguanaActiveHandle = setInterval(function() {
Store.dispatch(getSyncOnlyForks());
}.bind(this), 3000);
Store.dispatch(startInterval('syncOnly', _iguanaActiveHandle));
Store.dispatch(toggleSyncOnlyModal(true));
}
render() {
return (
<nav className="site-navbar navbar navbar-default navbar-fixed-top navbar-mega" role="navigation">
@ -95,6 +109,11 @@ class Navbar extends React.Component {
<i className="site-menu-icon" aria-hidden="true"></i> Atomic Explorer
</a>
</li>
<li className="nav-top-menu">
<a id="nav-iguana-atomic-explorer" onClick={ () => this.openSyncOnlyModal() }>
<i className="site-menu-icon" aria-hidden="true"></i> { translate('ADD_COIN.SYNC_ONLY') }
</a>
</li>
</ul>
<ul className="nav navbar-toolbar navbar-right navbar-toolbar-right">
<li role="presentation">

114
react/src/components/login/login.js

@ -226,73 +226,125 @@ class Login extends React.Component {
className="form-control"
name="loginPassphrase"
id="password"
onChange={this.updateInput}
onKeyDown={(event) => this.handleKeydown(event)} />
<i className={this.state.seedInputVisibility ? 'seed-toggle fa fa-eye-slash' : 'seed-toggle fa fa-eye'} onClick={this.toggleSeedInputVisibility}></i>
<label className="floating-label" htmlFor="inputPassword">{translate('INDEX.WALLET_SEED')}</label>
onChange={ this.updateInput }
onKeyDown={ (event) => this.handleKeydown(event) } />
<i
className={ this.state.seedInputVisibility ? 'seed-toggle fa fa-eye-slash' : 'seed-toggle fa fa-eye' }
onClick={ this.toggleSeedInputVisibility }></i>
<label className="floating-label" htmlFor="inputPassword">{ translate('INDEX.WALLET_SEED') }</label>
</div>
<button type="button" className="btn btn-primary btn-block" id="loginbtn" onClick={this.loginSeed} disabled={!this.state.loginPassphrase || !this.state.loginPassphrase.length}>{translate('INDEX.SIGN_IN')}</button>
<button
type="button"
className="btn btn-primary btn-block"
id="loginbtn"
onClick={ this.loginSeed }
disabled={ !this.state.loginPassphrase || !this.state.loginPassphrase.length }>{ translate('INDEX.SIGN_IN') }</button>
<div className="form-group form-material floating">
<button className="btn btn-lg btn-flat btn-block waves-effect" id="register-btn" onClick={() => this.updateActiveLoginSection('signup')}>{translate('INDEX.CREATE_WALLET')}</button>
<button className="btn btn-lg btn-flat btn-block waves-effect hide" id="logint-another-wallet">{translate('INDEX.LOGIN_ANOTHER_WALLET')}</button>
<button
className="btn btn-lg btn-flat btn-block waves-effect"
id="register-btn"
onClick={ () => this.updateActiveLoginSection('signup') }>{ translate('INDEX.CREATE_WALLET') }</button>
<button
className="btn btn-lg btn-flat btn-block waves-effect hide"
id="logint-another-wallet">{ translate('INDEX.LOGIN_ANOTHER_WALLET') }</button>
<button
className="btn btn-lg btn-flat btn-block waves-effect"
id="register-btn"
role="menuitem"
onClick={this.toggleActivateCoinForm}
disabled={!this.props.Main}
style={{marginTop: '20px'}}>
<span className="ladda-label">{translate('ADD_COIN.ADD_ANOTHER_COIN')}</span>
onClick={ this.toggleActivateCoinForm }
disabled={ !this.props.Main }
style={{ marginTop: '20px' }}>
<span className="ladda-label">{ translate('ADD_COIN.ADD_ANOTHER_COIN') }</span>
</button>
</div>
</div>
</div>
<div id="section-login-addcoin-btn" className={this.state.activeLoginSection === 'activateCoin' ? 'show' : 'hide'}>
<h4 style={{ color: '#fff' }} id="login-welcome">{translate('INDEX.WELCOME_PLEASE_ADD')}</h4>
<div className="form-group form-material floating" style={{width: '540px', margin: '30px 0'}}>
<div
id="section-login-addcoin-btn"
className={ this.state.activeLoginSection === 'activateCoin' ? 'show' : 'hide' }>
<h4 style={{ color: '#fff' }} id="login-welcome">{ translate('INDEX.WELCOME_PLEASE_ADD') }</h4>
<div
className="form-group form-material floating"
style={{ width: '540px', margin: '30px 0' }}>
<button
className="btn btn-lg btn-primary btn-block ladda-button"
id="start-coin-login"
role="menuitem"
onClick={this.toggleActivateCoinForm}
disabled={!this.props.Main}>
<span className="ladda-label">{translate('INDEX.ACTIVATE_COIN')}</span>
onClick={ this.toggleActivateCoinForm }
disabled={ !this.props.Main }>
<span className="ladda-label">{ translate('INDEX.ACTIVATE_COIN') }</span>
</button>
</div>
</div>
<div id="section-register" className={this.state.activeLoginSection === 'signup' ? 'show' : 'hide'}>
<div
id="section-register"
className={ this.state.activeLoginSection === 'signup' ? 'show' : 'hide' }>
<div className="register-form">
<h4 className="hint" style={{ color: '#fff' }}>
{ translate('INDEX.SELECT_SEED_TYPE') }:
</h4>
<div className="form-group form-material floating">
<div className="radio-custom radio-default radio-inline" onClick={() => this.generateNewSeed(256)}>
<input type="radio" name="PassPhraseOptions" checked={this.state.bitsOption === 256 ? true : false} />
<div
className="radio-custom radio-default radio-inline"
onClick={ () => this.generateNewSeed(256) }>
<input
type="radio"
name="PassPhraseOptions"
checked={ this.state.bitsOption === 256 ? true : false } />
<label htmlFor="PassPhraseOptionsIguana">Iguana (256 bits)</label>
</div>
<div className="radio-custom radio-default radio-inline" onClick={() => this.generateNewSeed(160)}>
<input type="radio" name="PassPhraseOptions" checked={this.state.bitsOption === 160 ? true : false} />
<div
className="radio-custom radio-default radio-inline"
onClick={ () => this.generateNewSeed(160) }>
<input
type="radio"
name="PassPhraseOptions"
checked={ this.state.bitsOption === 160 ? true : false } />
<label htmlFor="PassPhraseOptionsWaves">Waves</label>
</div>
<div className="radio-custom radio-default radio-inline" onClick={() => this.generateNewSeed(128)}>
<input type="radio" name="PassPhraseOptions" checked={this.state.bitsOption === 128 ? true : false} />
<div
className="radio-custom radio-default radio-inline"
onClick={ () => this.generateNewSeed(128) }>
<input
type="radio"
name="PassPhraseOptions"
checked={ this.state.bitsOption === 128 ? true : false } />
<label htmlFor="PassPhraseOptionsNXT">NXT</label>
</div>
</div>
<div className="form-group form-material floating">
<textarea className="form-control placeholder-no-fix" type="text" id="walletseed" style={{ height: '100px' }} value={this.state.randomSeed} readOnly="true"></textarea>
<label className="floating-label" htmlFor="walletseed">{translate('INDEX.WALLET_SEED')}</label>
<textarea
className="form-control placeholder-no-fix"
type="text"
id="walletseed"
style={{ height: '100px' }}
value={ this.state.randomSeed }
readOnly="true"></textarea>
<label className="floating-label" htmlFor="walletseed">{ translate('INDEX.WALLET_SEED') }</label>
</div>
<div className="form-group form-material floating">
<textarea className="form-control placeholder-no-fix" type="text" name="randomSeedConfirm" onChange={this.updateInput} id="rwalletseed" style={{ height: '100px' }}></textarea>
<span className={ this.state.isSeedConfirmError ? 'help-block' : 'hide' }>{translate('LOGIN.ENTER_VALUE_AGAIN')}.</span>
<label className="floating-label" htmlFor="rwalletseed">{translate('INDEX.CONFIRM_SEED')}</label>
<textarea
className="form-control placeholder-no-fix"
type="text"
name="randomSeedConfirm"
onChange={ this.updateInput }
id="rwalletseed"
style={{ height: '100px' }}></textarea>
<span className={ this.state.isSeedConfirmError ? 'help-block' : 'hide' }>{ translate('LOGIN.ENTER_VALUE_AGAIN') }.</span>
<label className="floating-label" htmlFor="rwalletseed">{ translate('INDEX.CONFIRM_SEED') }</label>
</div>
<button type="button" id="register-submit-btn" className="btn btn-primary btn-block" onClick={this.handleRegisterWallet}>{translate('INDEX.REGISTER')}</button>
<button
type="button"
id="register-submit-btn"
className="btn btn-primary btn-block"
onClick={ this.handleRegisterWallet }>{ translate('INDEX.REGISTER') }</button>
<div className="form-group form-material floating">
<button className="btn btn-lg btn-flat btn-block waves-effect" id="register-back-btn" onClick={() => this.updateActiveLoginSection('login')}>{translate('INDEX.BACK_TO_LOGIN')}</button>
<button
className="btn btn-lg btn-flat btn-block waves-effect"
id="register-back-btn"
onClick={ () => this.updateActiveLoginSection('login') }>{ translate('INDEX.BACK_TO_LOGIN') }</button>
</div>
</div>
</div>

Loading…
Cancel
Save