Browse Source

Merge pull request #164 from SuperNETorg/feature/prop-refactor

Refactor wallestnav to use connect & mapstatetoprops
all-modes
pbca26 8 years ago
committed by GitHub
parent
commit
3dc514a1f4
  1. 19
      react/src/components/addcoin/addcoin.js
  2. 14
      react/src/components/addcoin/addcoinOptionsCrypto.js
  3. 15
      react/src/components/dashboard/atomic/atomic.js
  4. 20
      react/src/components/dashboard/claimInterestModal/claimInterestModal.js
  5. 23
      react/src/components/dashboard/coinTile/coinTile.js
  6. 23
      react/src/components/dashboard/coinTile/coinTileItem.js
  7. 31
      react/src/components/dashboard/coindDownModal/coindDownModal.js
  8. 3
      react/src/components/dashboard/coindDownModal/coindDownModal.render.js
  9. 16
      react/src/components/dashboard/jumblr/jumblr.js
  10. 2
      react/src/components/dashboard/jumblr/jumblr.render.js
  11. 10
      react/src/components/dashboard/loginSettingsModal/loginSettingsModal.js
  12. 3
      react/src/components/dashboard/loginSettingsModal/loginSettingsModal.render.js
  13. 20
      react/src/components/dashboard/main/dashboard.js
  14. 32
      react/src/components/dashboard/main/dashboard.render.js
  15. 24
      react/src/components/dashboard/navbar/navbar.js
  16. 18
      react/src/components/dashboard/notifications/notifications.js
  17. 22
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  18. 26
      react/src/components/dashboard/sendCoin/sendCoin.js
  19. 23
      react/src/components/dashboard/settings/settings.js
  20. 23
      react/src/components/dashboard/syncOnly/syncOnly.js
  21. 25
      react/src/components/dashboard/walletsBalance/walletsBalance.js
  22. 16
      react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js
  23. 11
      react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js
  24. 20
      react/src/components/dashboard/walletsCacheData/walletsCacheData.js
  25. 33
      react/src/components/dashboard/walletsData/walletsData.js
  26. 8
      react/src/components/dashboard/walletsData/walletsData.render.js
  27. 22
      react/src/components/dashboard/walletsInfo/walletsInfo.js
  28. 2
      react/src/components/dashboard/walletsInfo/walletsInfo.render.js
  29. 17
      react/src/components/dashboard/walletsNative/walletsNative.js
  30. 12
      react/src/components/dashboard/walletsNative/walletsNative.render.js
  31. 16
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js
  32. 28
      react/src/components/dashboard/walletsNav/walletsNav.js
  33. 6
      react/src/components/dashboard/walletsNav/walletsNav.render.js
  34. 17
      react/src/components/dashboard/walletsNotariesList/walletsNotariesList.js
  35. 20
      react/src/components/dashboard/walletsProgress/walletsProgress.js
  36. 21
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js
  37. 20
      react/src/components/login/login.js
  38. 7
      react/src/components/login/login.render.js
  39. 2
      react/src/components/main/main.js
  40. 21
      react/src/components/main/walletMain.js

19
react/src/components/addcoin/addcoin.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import Config from '../../config'; import Config from '../../config';
import { import {
@ -16,8 +17,8 @@ import CoinSelectorsRender from './coin-selectors.render';
import AddCoinRender from './addcoin.render'; import AddCoinRender from './addcoin.render';
class AddCoin extends React.Component { class AddCoin extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
nativeOnly: Config.iguanaLessMode, nativeOnly: Config.iguanaLessMode,
coins: [], coins: [],
@ -355,4 +356,16 @@ class AddCoin extends React.Component {
} }
} }
export default AddCoin;
const mapStateToProps = (state) => {
return {
Main: state.Main,
ActiveCoin: {
coin: state.ActiveCoin.coin,
},
AddCoin: state.AddCoin,
};
};
export default connect(mapStateToProps)(AddCoin);

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

@ -1,10 +1,11 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import Config from '../../config'; import Config from '../../config';
class AddCoinOptionsCrypto extends React.Component { class AddCoinOptionsCrypto extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
nativeOnly: Config.iguanaLessMode, nativeOnly: Config.iguanaLessMode,
} }
@ -60,4 +61,11 @@ class AddCoinOptionsCrypto extends React.Component {
} }
} }
export default AddCoinOptionsCrypto; const mapStateToProps = (state) => {
return {
appSettings: state.appSettings,
};
};
export default connect(mapStateToProps)(AddCoinOptionsCrypto);

15
react/src/components/dashboard/atomic/atomic.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { atomic } from '../../../actions/actionCreators'; import { atomic } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
@ -10,8 +11,8 @@ import AtomicRender from './atomic.render';
2) validation 2) validation
*/ */
class Atomic extends React.Component { class Atomic extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
output: null, output: null,
api: null, api: null,
@ -497,5 +498,13 @@ class Atomic extends React.Component {
return AtomicRender.call(this); return AtomicRender.call(this);
} }
} }
const mapStateToProps = (state) => {
return {
Atomic: {
response: state.Atomic.response,
}
};
};
export default Atomic; export default connect(mapStateToProps)(Atomic);

20
react/src/components/dashboard/claimInterestModal/claimInterestModal.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import Store from '../../../store'; import Store from '../../../store';
import { import {
@ -16,8 +17,8 @@ import {
} from './claimInterestModal.render'; } from './claimInterestModal.render';
class ClaimInterestModal extends React.Component { class ClaimInterestModal extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
open: false, open: false,
isLoading: true, isLoading: true,
@ -133,5 +134,18 @@ class ClaimInterestModal extends React.Component {
return ClaimInterestModalRender.call(this); return ClaimInterestModalRender.call(this);
} }
} }
const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
balance: state.ActiveCoin.balance,
activeSection: state.ActiveCoin.activeSection,
},
Dashboard: {
displayClaimInterestModal: state.Dashboard.displayClaimInterestModal
}
};
};
export default ClaimInterestModal; export default connect(mapStateToProps)(ClaimInterestModal);

23
react/src/components/dashboard/coinTile/coinTile.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { import {
getCoinTitle, getCoinTitle,
getModeInfo getModeInfo
@ -8,10 +9,8 @@ import CoinTileItem from './coinTileItem';
import CoinTileRender from './coinTile.render'; import CoinTileRender from './coinTile.render';
class CoinTile extends React.Component { class CoinTile extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = {
};
this.renderTiles = this.renderTiles.bind(this); this.renderTiles = this.renderTiles.bind(this);
} }
@ -21,11 +20,10 @@ class CoinTile extends React.Component {
'basilisk', 'basilisk',
'full' 'full'
]; ];
const allCoins = this.props.Main.coins; const allCoins = this.props.allCoins;
let items = []; let items = [];
if (this.props.Main && if (allCoins) {
allCoins) {
modes.map(function(mode) { modes.map(function(mode) {
allCoins[mode].map(function(coin) { allCoins[mode].map(function(coin) {
const _coinMode = getModeInfo(mode); const _coinMode = getModeInfo(mode);
@ -56,7 +54,7 @@ class CoinTile extends React.Component {
key={ i } key={ i }
i={ i } i={ i }
item={ item } item={ item }
{...this.props} />) />)
); );
} }
@ -64,5 +62,12 @@ class CoinTile extends React.Component {
return CoinTileRender.call(this); return CoinTileRender.call(this);
} }
} }
const mapStateToProps = (state) => {
return {
allCoins: state.Main.coins,
};
};
export default connect(mapStateToProps)(CoinTile);
export default CoinTile;

23
react/src/components/dashboard/coinTile/coinTileItem.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { import {
dashboardChangeActiveCoin, dashboardChangeActiveCoin,
iguanaActiveHandle, iguanaActiveHandle,
@ -30,10 +31,8 @@ const IGUNA_ACTIVE_HANDLE_TIMEOUT_KMD_NATIVE = 15000;
const NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD = 90; const NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD = 90;
class CoinTileItem extends React.Component { class CoinTileItem extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = {
};
} }
// TODO: 1) cache native/full node data to file // TODO: 1) cache native/full node data to file
@ -201,5 +200,19 @@ class CoinTileItem extends React.Component {
return CoinTileItemRender.call(this); return CoinTileItemRender.call(this);
} }
} }
const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
addresses: state.ActiveCoin.addresses,
mainBasiliskAddress: state.ActiveCoin.mainBasiliskAddress
},
Dashboard: state.Dashboard,
Interval: {
interval: state.Interval.interval
}
};
};
export default CoinTileItem; export default connect(mapStateToProps)(CoinTileItem);

31
react/src/components/dashboard/coindDownModal/coindDownModal.js

@ -1,12 +1,13 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { toggleCoindDownModal } from '../../../actions/actionCreators'; import { toggleCoindDownModal } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
import CoindDownModalRender from './coindDownModal.render'; import CoindDownModalRender from './coindDownModal.render';
class CoindDownModal extends React.Component { class CoindDownModal extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
display: false, display: false,
debugLogCrash: null, debugLogCrash: null,
@ -18,20 +19,11 @@ class CoindDownModal extends React.Component {
Store.dispatch(toggleCoindDownModal(false)); Store.dispatch(toggleCoindDownModal(false));
} }
componentWillReceiveProps(props) { componentWillReceiveProps(nextProps) {
const coindDownModalProps = props ? props.Dashboard : null; if (this.props.displayCoindDownModal !== nextProps.displayCoindDownModal) {
if (coindDownModalProps &&
coindDownModalProps.displayCoindDownModal !== this.state.display) {
this.setState(Object.assign({}, this.state, { this.setState(Object.assign({}, this.state, {
display: coindDownModalProps.displayCoindDownModal, display: nextProps.displayCoindDownModal,
})); }));
setTimeout(() => {
this.setState(Object.assign({}, this.state, {
display: coindDownModalProps.displayCoindDownModal,
}));
}, 100);
} }
} }
@ -43,5 +35,12 @@ class CoindDownModal extends React.Component {
return null; return null;
} }
} }
const mapStateToProps = (state) => {
export default CoindDownModal; return {
displayCoindDownModal: state.Dashboard.displayCoindDownModal,
debugLog: state.Settings.debugLog
};
};
export default connect(mapStateToProps)(CoindDownModal);

3
react/src/components/dashboard/coindDownModal/coindDownModal.render.js

@ -24,8 +24,9 @@ const CoindDownModalRender = function () {
<strong>Debug.log ({ translate('INDEX.LAST_50_LINES') })</strong> <strong>Debug.log ({ translate('INDEX.LAST_50_LINES') })</strong>
<div className="form-group form-material floating"> <div className="form-group form-material floating">
<textarea <textarea
readOnly
className="form-control" className="form-control"
value={ this.props.Settings.debugLog }></textarea> value={ this.props.debugLog || '' }></textarea>
</div> </div>
<button <button
type="button" type="button"

16
react/src/components/dashboard/jumblr/jumblr.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { import {
dashboardChangeActiveCoin, dashboardChangeActiveCoin,
@ -39,8 +40,8 @@ if (!window.jumblrPasshrase) { // gen jumblr passphrase
} }
class Jumblr extends React.Component { class Jumblr extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
activeTab: 0, activeTab: 0,
randomSeed: window.jumblrPasshrase, randomSeed: window.jumblrPasshrase,
@ -424,4 +425,13 @@ class Jumblr extends React.Component {
} }
} }
export default Jumblr; const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
}
};
};
export default connect(mapStateToProps)(Jumblr);

2
react/src/components/dashboard/jumblr/jumblr.render.js

@ -359,7 +359,6 @@ export const JumblrRender = function() {
<p>{ translate('JUMBLR.DEPOSIT_FORM_P1') }</p> <p>{ translate('JUMBLR.DEPOSIT_FORM_P1') }</p>
<p className="padding-bottom-20">{ translate('JUMBLR.DEPOSIT_FORM_P2') }</p> <p className="padding-bottom-20">{ translate('JUMBLR.DEPOSIT_FORM_P2') }</p>
<WalletsNativeSend <WalletsNativeSend
{...this.props}
renderFormOnly="true" renderFormOnly="true"
activeSection="send" /> activeSection="send" />
</div> </div>
@ -461,7 +460,6 @@ export const JumblrRender = function() {
</div> </div>
<div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }> <div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }>
<ReceiveCoin <ReceiveCoin
{...this.props.ActiveCoin}
activeSection="receive" activeSection="receive"
renderTableOnly="true" /> renderTableOnly="true" />
</div> </div>

10
react/src/components/dashboard/loginSettingsModal/loginSettingsModal.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { getCoinTitle } from '../../../util/coinHelper'; import { getCoinTitle } from '../../../util/coinHelper';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { toggleLoginSettingsModal } from '../../../actions/actionCreators'; import { toggleLoginSettingsModal } from '../../../actions/actionCreators';
@ -29,4 +30,11 @@ class LoginSettingsModal extends React.Component {
} }
} }
export default LoginSettingsModal; const mapStateToProps = (state) => {
return {
Main: state.Main
};
};
export default connect(mapStateToProps)(LoginSettingsModal);

3
react/src/components/dashboard/loginSettingsModal/loginSettingsModal.render.js

@ -6,13 +6,12 @@ import Settings from '../settings/settings';
export const LoginSettingsModalRender = function() { export const LoginSettingsModalRender = function() {
return ( return (
<div> <div>
<div className="modal show login-settings-modal"> <div className="modal show login-settings-modal ff">
<div className="modal-dialog modal-center modal-lg"> <div className="modal-dialog modal-center modal-lg">
<div className="modal-content"> <div className="modal-content">
<div className="modal-body modal-body-container"> <div className="modal-body modal-body-container">
{ this.props.section === 'settings' && { this.props.section === 'settings' &&
<Settings <Settings
{...this.props}
disableWalletSpecificUI="true" /> disableWalletSpecificUI="true" />
} }
{ this.props.section === 'about' && { this.props.section === 'about' &&

20
react/src/components/dashboard/main/dashboard.js

@ -1,9 +1,10 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import DashboardRender from './dashboard.render'; import DashboardRender from './dashboard.render';
class Dashboard extends React.Component { class Dashboard extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
}; };
this.renderDashboard = this.renderDashboard.bind(this); this.renderDashboard = this.renderDashboard.bind(this);
@ -38,4 +39,17 @@ class Dashboard extends React.Component {
} }
} }
export default Dashboard; const mapStateToProps = (state) => {
return {
Main: state.Main,
ActiveCoin: {
mode: state.ActiveCoin.mode,
},
Dashboard: {
activeSection: state.Dashboard.activeSection,
}
};
};
export default connect(mapStateToProps)(Dashboard);

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

@ -23,33 +23,33 @@ const DashboardRender = function() {
<div <div
className={ this.isSectionActive('wallets') ? 'page-main' : '' } className={ this.isSectionActive('wallets') ? 'page-main' : '' }
id="section-dashboard"> id="section-dashboard">
<Navbar {...this.props} /> <Navbar />
<CoindDownModal {...this.props} /> <CoindDownModal />
<div className={ this.isSectionActive('wallets') ? 'show' : 'hide' }> <div className={ this.isSectionActive('wallets') ? 'show' : 'hide' }>
<CoinTile {...this.props} /> <CoinTile />
<WalletsNav {...this.props} /> <WalletsNav />
{ !this.isNativeMode() && <WalletsProgress {...this.props} /> } { !this.isNativeMode() && <WalletsProgress /> }
{ !this.isNativeMode() && <WalletsBalance {...this.props} />} { !this.isNativeMode() && <WalletsBalance />}
<SendCoin {...this.props} /> <SendCoin />
{ !this.isNativeMode() && <ReceiveCoin {...this.props.ActiveCoin} /> } { !this.isNativeMode() && <ReceiveCoin /> }
{ !this.isNativeMode() && <WalletsData {...this.props} /> } { !this.isNativeMode() && <WalletsData /> }
<WalletsTxInfo {...this.props} /> <WalletsTxInfo />
<WalletsNative {...this.props} /> <WalletsNative />
</div> </div>
{ this.isSectionActive('edex') && { this.isSectionActive('edex') &&
<EDEX {...this.props} /> <EDEX />
} }
{ this.isSectionActive('atomic') && { this.isSectionActive('atomic') &&
<Atomic {...this.props} /> <Atomic />
} }
{ this.isSectionActive('jumblr') && { this.isSectionActive('jumblr') &&
<Jumblr {...this.props} /> <Jumblr />
} }
{ this.isSectionActive('settings') && { this.isSectionActive('settings') &&
<Settings {...this.props} /> <Settings />
} }
{ this.isSectionActive('about') && { this.isSectionActive('about') &&
<About {...this.props} /> <About />
} }
</div> </div>
</div> </div>

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

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { import {
dashboardChangeSection, dashboardChangeSection,
toggleAddcoinModal, toggleAddcoinModal,
@ -15,8 +16,8 @@ import { checkAC } from '../../addcoin/payload';
import NavbarRender from './navbar.render'; import NavbarRender from './navbar.render';
class Navbar extends React.Component { class Navbar extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
openDropMenu: false, openDropMenu: false,
nativeOnly: Config.iguanaLessMode, nativeOnly: Config.iguanaLessMode,
@ -114,5 +115,22 @@ class Navbar extends React.Component {
return NavbarRender.call(this); return NavbarRender.call(this);
} }
} }
const mapStateToProps = (state) => {
return {
ActiveCoin: {
mode: state.ActiveCoin.mode,
coin: state.ActiveCoin.coin,
},
Dashboard: {
activeSection: state.Dashboard.activeSection,
},
Interval: {
interval: state.Interval.interval,
},
nativeOnly: Config.iguanaLessMode
};
};
export default connect(mapStateToProps)(Navbar);
export default Navbar;

18
react/src/components/dashboard/notifications/notifications.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { sortByDate } from '../../../util/sort'; import { sortByDate } from '../../../util/sort';
import Config from '../../../config'; import Config from '../../../config';
import { import {
@ -8,8 +9,8 @@ import {
} from './notifications.render'; } from './notifications.render';
class Notifications extends React.Component { class Notifications extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
displayModal: false, displayModal: false,
calls: { calls: {
@ -107,4 +108,15 @@ class Notifications extends React.Component {
} }
} }
export default Notifications; const mapStateToProps = (state) => {
return {
Dashboard: {
guiLog: state.Dashboard.guiLog,
activeHandle: state.Dashboard.activeHandle,
}
};
};
export default connect(mapStateToProps)(Notifications);

22
react/src/components/dashboard/receiveCoin/receiveCoin.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { import {
copyCoinAddress, copyCoinAddress,
checkAddressBasilisk, checkAddressBasilisk,
@ -18,8 +19,8 @@ import {
// TODO: fallback to localstorage/stores data in case iguana is taking too long to respond // TODO: fallback to localstorage/stores data in case iguana is taking too long to respond
class ReceiveCoin extends React.Component { class ReceiveCoin extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
openDropMenu: false, openDropMenu: false,
@ -216,5 +217,18 @@ class ReceiveCoin extends React.Component {
return null; return null;
} }
} }
const mapStateToProps = (state) => {
export default ReceiveCoin; return {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
receive: state.ActiveCoin.receive,
balance: state.ActiveCoin.balance,
cache: state.ActiveCoin.cache,
activeSection: state.ActiveCoin.activeSection,
activeAddress: state.ActiveCoin.activeAddress,
addresses: state.ActiveCoin.addresses
};
};
export default connect(mapStateToProps)(ReceiveCoin);

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

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import Config from '../../../config'; import Config from '../../../config';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { checkTimestamp } from '../../../util/time'; import { checkTimestamp } from '../../../util/time';
@ -41,7 +42,7 @@ class SendCoin extends React.Component {
super(props); super(props);
this.state = { this.state = {
currentStep: 0, currentStep: 0,
sendFrom: this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : null, sendFrom: this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : null,
sendFromAmount: 0, sendFromAmount: 0,
sendTo: '', sendTo: '',
sendToOA: null, sendToOA: null,
@ -874,4 +875,25 @@ class SendCoin extends React.Component {
} }
} }
export default SendCoin; const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
send: state.ActiveCoin.send,
receive: state.ActiveCoin.receive,
balance: state.ActiveCoin.balance,
cache: state.ActiveCoin.cache,
activeAddress: state.ActiveCoin.activeAddress,
lastSendToResponse: state.ActiveCoin.lastSendToResponse,
addresses: state.ActiveCoin.addresses,
},
Dashboard: {
activeHandle: state.Dashboard.activeHandle,
}
};
};
export default connect(mapStateToProps)(SendCoin);

23
react/src/components/dashboard/settings/settings.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import Config from '../../../config'; import Config from '../../../config';
import { import {
@ -42,8 +43,8 @@ let updateProgressBar = {
4) batch export/import wallet addresses 4) batch export/import wallet addresses
*/ */
class Settings extends React.Component { class Settings extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
activeTab: 0, activeTab: 0,
debugLinesCount: 10, debugLinesCount: 10,
@ -119,7 +120,7 @@ class Settings extends React.Component {
} }
} }
componentDidMount() { componentDidMount(props) {
if (!this.props.disableWalletSpecificUI) { if (!this.props.disableWalletSpecificUI) {
Store.dispatch(iguanaActiveHandle()); Store.dispatch(iguanaActiveHandle());
} }
@ -846,4 +847,18 @@ class Settings extends React.Component {
} }
} }
export default Settings; const mapStateToProps = (state) => {
return {
Main: {
coins: state.Main.coins,
activeHandle: state.Main.activeHandle,
},
ActiveCoin: {
coin: state.ActiveCoin.coin,
},
Settings: state.Settings,
};
};
export default connect(mapStateToProps)(Settings);

23
react/src/components/dashboard/syncOnly/syncOnly.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { getCoinTitle } from '../../../util/coinHelper'; import { getCoinTitle } from '../../../util/coinHelper';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { import {
@ -17,8 +18,8 @@ import {
} from './syncOnly.render'; } from './syncOnly.render';
class SyncOnly extends React.Component { class SyncOnly extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
autoRestartedForks: {}, autoRestartedForks: {},
}; };
@ -157,4 +158,20 @@ class SyncOnly extends React.Component {
} }
} }
export default SyncOnly; const mapStateToProps = (state) => {
return {
SyncOnly: {
display: state.SyncOnly.display,
forks: state.SyncOnly.forks,
send: state.ActiveCoin.send,
receive: state.ActiveCoin.receive,
balance: state.ActiveCoin.balance,
},
Interval: {
interval: state.Interval.interval,
}
};
};
export default connect(mapStateToProps)(SyncOnly);

25
react/src/components/dashboard/walletsBalance/walletsBalance.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { import {
fetchNewCacheData, fetchNewCacheData,
@ -10,8 +11,8 @@ import Store from '../../../store';
import WalletsBalanceRender from './walletsBalance.render'; import WalletsBalanceRender from './walletsBalance.render';
class WalletsBalance extends React.Component { class WalletsBalance extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
currentAddress: null, currentAddress: null,
}; };
@ -187,5 +188,23 @@ class WalletsBalance extends React.Component {
return null; return null;
} }
} }
const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
send: state.ActiveCoin.send,
receive: state.ActiveCoin.receive,
balance: state.ActiveCoin.balance,
cache: state.ActiveCoin.cache,
activeSection: state.ActiveCoin.activeSection,
activeAddress: state.ActiveCoin.activeAddress
},
Dashboard: {
progress: state.Dashboard.progress,
}
};
};
export default WalletsBalance; export default connect(mapStateToProps)(WalletsBalance);

16
react/src/components/dashboard/walletsBasiliskConnection/walletsBasiliskConnection.js

@ -1,11 +1,12 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { basiliskConnection } from '../../../actions/actionCreators'; import { basiliskConnection } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
import WalletsBasiliskConnectionRender from './walletsBasiliskConnection.render'; import WalletsBasiliskConnectionRender from './walletsBasiliskConnection.render';
class WalletsBasiliskConnection extends React.Component { class WalletsBasiliskConnection extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.basiliskConnectionAction = this.basiliskConnectionAction.bind(this); this.basiliskConnectionAction = this.basiliskConnectionAction.bind(this);
} }
@ -33,4 +34,13 @@ class WalletsBasiliskConnection extends React.Component {
} }
} }
export default WalletsBasiliskConnection; const mapStateToProps = (state) => {
return {
Dashboard: {
basiliskConnection: state.Dashboard.basiliskConnection,
connectedNotaries: state.Dashboard.connectedNotaries,
}
};
};
export default connect(mapStateToProps)(WalletsBasiliskConnection);

11
react/src/components/dashboard/walletsBasiliskRefresh/walletsBasiliskRefresh.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import WalletsBasiliskRefreshRender from './walletsBasiliskRefresh.render'; import WalletsBasiliskRefreshRender from './walletsBasiliskRefresh.render';
class WalletsBasiliskRefresh extends React.Component { class WalletsBasiliskRefresh extends React.Component {
@ -15,5 +16,11 @@ class WalletsBasiliskRefresh extends React.Component {
return null; return null;
} }
} }
const mapStateToProps = (state) => {
export default WalletsBasiliskRefresh; return {
Dashboard: {
basiliskRefresh: state.Dashboard.basiliskRefresh,
}
};
};
export default connect(mapStateToProps)(WalletsBasiliskRefresh);

20
react/src/components/dashboard/walletsCacheData/walletsCacheData.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { secondsToString } from '../../../util/time'; import { secondsToString } from '../../../util/time';
import { toggleViewCacheModal } from '../../../actions/actionCreators'; import { toggleViewCacheModal } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
@ -8,8 +9,8 @@ import WalletsCacheDataRender from './walletsCacheData.render';
// TODO: refresh data render // TODO: refresh data render
class WalletsCacheData extends React.Component { class WalletsCacheData extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.closeViewCacheModal = this.closeViewCacheModal.bind(this); this.closeViewCacheModal = this.closeViewCacheModal.bind(this);
} }
@ -183,5 +184,18 @@ class WalletsCacheData extends React.Component {
} }
} }
} }
const mapStateToProps = (state) => {
return {
ActiveCoin: {
mode: state.ActiveCoin.mode,
cache: state.ActiveCoin.cache,
notaries: state.ActiveCoin.notaries,
},
Dashboard: {
displayViewCacheModal: state.Dashboard.displayViewCacheModal,
}
};
};
export default WalletsCacheData; export default connect(mapStateToProps)(WalletsCacheData);

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

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { sortByDate } from '../../../util/sort'; import { sortByDate } from '../../../util/sort';
import { formatValue } from '../../../util/formatValue'; import { formatValue } from '../../../util/formatValue';
@ -671,4 +672,34 @@ class WalletsData extends React.Component {
} }
} }
export default WalletsData; const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
send: state.ActiveCoin.send,
receive: state.ActiveCoin.receive,
balance: state.ActiveCoin.balance,
cache: state.ActiveCoin.cache,
activeSection: state.ActiveCoin.activeSection,
activeAddress: state.ActiveCoin.activeAddress,
lastSendToResponse: state.ActiveCoin.lastSendToResponse,
addresses: state.ActiveCoin.addresses,
txhistory: state.ActiveCoin.txhistory,
showTransactionInfo: state.ActiveCoin.showTransactionInfo,
},
Dashboard: {
activeHandle: state.Dashboard.activeHandle,
displayViewCacheModal: state.Dashboard.displayViewCacheModal,
basiliskConnection: state.Dashboard.basiliskConnection,
progress: state.Dashboard.progress,
},
Main: {
coins: state.Main.coins,
}
};
};
export default connect(mapStateToProps)(WalletsData);

8
react/src/components/dashboard/walletsData/walletsData.render.js

@ -192,10 +192,10 @@ export const WalletsDataRender = function() {
return ( return (
<span> <span>
<WalletsBasiliskRefresh {...this.props} /> <WalletsBasiliskRefresh />
<WalletsBasiliskConnection {...this.props} /> <WalletsBasiliskConnection />
<WalletsNotariesList {...this.props} /> <WalletsNotariesList />
<WalletsCacheData {...this.props} /> <WalletsCacheData />
<div id="edexcoin_dashboardinfo"> <div id="edexcoin_dashboardinfo">
<div className="col-xs-12 margin-top-20 backround-gray"> <div className="col-xs-12 margin-top-20 backround-gray">
<div className="panel nav-tabs-horizontal"> <div className="panel nav-tabs-horizontal">

22
react/src/components/dashboard/walletsInfo/walletsInfo.js

@ -1,11 +1,12 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import WalletsNativeInfoRender from './walletsInfo.render'; import WalletsNativeInfoRender from './walletsInfo.render';
import { toggleClaimInterestModal } from '../../../actions/actionCreators'; import { toggleClaimInterestModal } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
class WalletsNativeInfo extends React.Component { class WalletsInfo extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.openClaimInterestModal = this.openClaimInterestModal.bind(this); this.openClaimInterestModal = this.openClaimInterestModal.bind(this);
} }
@ -25,4 +26,17 @@ class WalletsNativeInfo extends React.Component {
} }
} }
export default WalletsNativeInfo; const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
activeSection: state.ActiveCoin.activeSection,
},
Dashboard: {
progress: state.Dashboard.progress
}
};
};
export default connect(mapStateToProps)(WalletsInfo);

2
react/src/components/dashboard/walletsInfo/walletsInfo.render.js

@ -47,7 +47,7 @@ const WalletsInfoRender = function() {
type="button" type="button"
className="btn btn-success waves-effect waves-light margin-top-20 btn-next" className="btn btn-success waves-effect waves-light margin-top-20 btn-next"
onClick={ () => this.openClaimInterestModal() }>{ translate('CLAIM_INTEREST.CLAIM_INTEREST') }</button> onClick={ () => this.openClaimInterestModal() }>{ translate('CLAIM_INTEREST.CLAIM_INTEREST') }</button>
<ClaimInterestModal {...this.props} /> <ClaimInterestModal />
</div> </div>
} }
</div> </div>

17
react/src/components/dashboard/walletsNative/walletsNative.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import WalletsNativeRender from './walletsNative.render'; import WalletsNativeRender from './walletsNative.render';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { triggerToaster } from '../../../actions/actionCreators'; import { triggerToaster } from '../../../actions/actionCreators';
@ -12,8 +13,8 @@ import io from 'socket.io-client';
const socket = io.connect(`http://127.0.0.1:${Config.agamaPort}`); const socket = io.connect(`http://127.0.0.1:${Config.agamaPort}`);
class WalletsNative extends React.Component { class WalletsNative extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
nativeOnly: Config.iguanaLessMode, nativeOnly: Config.iguanaLessMode,
}; };
@ -73,4 +74,14 @@ class WalletsNative extends React.Component {
} }
} }
export default WalletsNative; const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
}
};
};
export default connect(mapStateToProps)(WalletsNative);

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

@ -28,13 +28,13 @@ const WalletsNativeRender = function() {
</ol> </ol>
</div> </div>
<div className="page-content"> <div className="page-content">
<WalletsProgress {...this.props} /> <WalletsProgress />
<div className="row"> <div className="row">
<WalletsBalance {...this.props} /> <WalletsBalance />
<ReceiveCoin {...this.props.ActiveCoin} /> <ReceiveCoin />
<WalletsData {...this.props} /> <WalletsData />
<WalletsNativeSend {...this.props} /> <WalletsNativeSend />
<WalletsInfo {...this.props} /> <WalletsInfo />
</div> </div>
</div> </div>
</div> </div>

16
react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import Config from '../../../config'; import Config from '../../../config';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { secondsToString } from '../../../util/time'; import { secondsToString } from '../../../util/time';
@ -444,4 +445,17 @@ class WalletsNativeSend extends React.Component {
} }
} }
export default WalletsNativeSend; const mapStateToProps = (state) => {
return {
ActiveCoin: {
addresses: state.ActiveCoin.addresses,
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
opids: state.ActiveCoin.opids,
activeSection: state.ActiveCoin.activeSection,
}
};
};
export default connect(mapStateToProps)(WalletsNativeSend);

28
react/src/components/dashboard/walletsNav/walletsNav.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { import {
copyCoinAddress, copyCoinAddress,
iguanaEdexBalance, iguanaEdexBalance,
@ -15,11 +16,8 @@ import {
} from './walletsNav.render'; } from './walletsNav.render';
class WalletsNav extends React.Component { class WalletsNav extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = {
nativeOnly: Config.iguanaLessMode,
};
this.toggleSendReceiveCoinForms = this.toggleSendReceiveCoinForms.bind(this); this.toggleSendReceiveCoinForms = this.toggleSendReceiveCoinForms.bind(this);
this.toggleNativeWalletInfo = this.toggleNativeWalletInfo.bind(this); this.toggleNativeWalletInfo = this.toggleNativeWalletInfo.bind(this);
this.toggleNativeWalletTransactions = this.toggleNativeWalletTransactions.bind(this); this.toggleNativeWalletTransactions = this.toggleNativeWalletTransactions.bind(this);
@ -124,4 +122,22 @@ class WalletsNav extends React.Component {
} }
} }
export default WalletsNav; const mapStateToProps = (state) => {
return {
ActiveCoin: {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
send: state.ActiveCoin.send,
receive: state.ActiveCoin.receive,
balance: state.ActiveCoin.balance,
cache: state.ActiveCoin.cache,
activeSection: state.ActiveCoin.activeSection,
activeAddress: state.ActiveCoin.activeAddress
},
ActiveHandle: state.Dashboard.activeHandle,
nativeOnly: Config.iguanaLessMode,
};
};
export default connect(mapStateToProps)(WalletsNav);

6
react/src/components/dashboard/walletsNav/walletsNav.render.js

@ -24,10 +24,10 @@ export const WalletsNavWithWalletRender = function() {
return ( return (
<div> <div>
<div <div
className={ 'page-header page-header-bordered header-easydex padding-bottom-' + (this.state.nativeOnly ? '40 page-header--native' : '20') } className={ 'page-header page-header-bordered header-easydex padding-bottom-' + (this.props.nativeOnly ? '40 page-header--native' : '20') }
id="header-dashboard" id="header-dashboard"
style={{ marginBottom: this.props.ActiveCoin.mode === 'basilisk' ? '30px' : (this.state.nativeOnly ? '30px' : '0') }}> style={{ marginBottom: this.props.ActiveCoin.mode === 'basilisk' ? '30px' : (this.props.nativeOnly ? '30px' : '0') }}>
<ol className={ this.state.nativeOnly ? 'hide' : 'breadcrumb' + (this.props.ActiveCoin.mode === 'basilisk' ? ' breadcrumb--basilisk' : ' breadcrumb--native') }> <ol className={ this.props.nativeOnly ? 'hide' : 'breadcrumb' + (this.props.ActiveCoin.mode === 'basilisk' ? ' breadcrumb--basilisk' : ' breadcrumb--native') }>
<strong>{ translate('INDEX.MY') } { this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-' } { translate('INDEX.ADDRESS') }: </strong> <strong>{ translate('INDEX.MY') } { this.props && this.props.ActiveCoin ? this.props.ActiveCoin.coin : '-' } { translate('INDEX.ADDRESS') }: </strong>
{ this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-' } { this.props && this.props.Dashboard && this.props.Dashboard.activeHandle ? this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] : '-' }
<button <button

17
react/src/components/dashboard/walletsNotariesList/walletsNotariesList.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { displayNotariesModal } from '../../../actions/actionCreators'; import { displayNotariesModal } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
@ -9,8 +10,8 @@ import {
} from './walletsNotariesList.render'; } from './walletsNotariesList.render';
class WalletsNotariesList extends React.Component { class WalletsNotariesList extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.closeNotariesModal = this.closeNotariesModal.bind(this); this.closeNotariesModal = this.closeNotariesModal.bind(this);
} }
@ -58,5 +59,15 @@ class WalletsNotariesList extends React.Component {
return null; return null;
} }
} }
const mapStateToProps = (state) => {
return {
ActiveCoin: {
mode: state.ActiveCoin.mode,
displayNotariesModal: state.ActiveCoin.displayNotariesModal,
notaries: state.ActiveCoin.notaries,
}
};
};
export default WalletsNotariesList; export default connect(mapStateToProps)(WalletsNotariesList);

20
react/src/components/dashboard/walletsProgress/walletsProgress.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { import {
SyncErrorLongestChainRender, SyncErrorLongestChainRender,
@ -12,8 +13,8 @@ import {
} from './walletsProgress.render'; } from './walletsProgress.render';
class WalletsProgress extends React.Component { class WalletsProgress extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.isFullySynced = this.isFullySynced.bind(this); this.isFullySynced = this.isFullySynced.bind(this);
} }
@ -229,5 +230,18 @@ class WalletsProgress extends React.Component {
return null; return null;
} }
} }
const mapStateToProps = (state) => {
return {
Dashboard: state.Dashboard,
Settings: {
debugLog: state.Settings.debugLog,
},
ActiveCoin: {
mode: state.ActiveCoin.mode,
coin: state.coin,
}
};
};
export default WalletsProgress; export default connect(mapStateToProps)(WalletsProgress);

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

@ -1,12 +1,13 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { sortByDate } from '../../../util/sort'; import { sortByDate } from '../../../util/sort';
import { toggleDashboardTxInfoModal } from '../../../actions/actionCreators'; import { toggleDashboardTxInfoModal } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
import WalletsTxInfoRender from './walletsTxInfo.render'; import WalletsTxInfoRender from './walletsTxInfo.render';
class WalletsTxInfo extends React.Component { class WalletsTxInfo extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
activeTab: 0, activeTab: 0,
}; };
@ -52,4 +53,18 @@ class WalletsTxInfo extends React.Component {
} }
} }
export default WalletsTxInfo; const mapStateToProps = (state) => {
return {
ActiveCoin: {
mode: state.ActiveCoin.mode,
txhistory: state.ActiveCoin.txhistory,
showTransactionInfo: state.ActiveCoin.showTransactionInfo,
activeSection: state.ActiveCoin.activeSection,
activeAddress: state.ActiveCoin.activeAddress,
showTransactionInfoTxIndex: state.ActiveCoin.showTransactionInfoTxIndex,
}
};
};
export default connect(mapStateToProps)(WalletsTxInfo);

20
react/src/components/login/login.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { import {
toggleAddcoinModal, toggleAddcoinModal,
iguanaWalletPassphrase, iguanaWalletPassphrase,
@ -24,8 +25,8 @@ const IGUNA_ACTIVE_COINS_TIMEOUT = 10000;
// TODO: remove duplicate activehandle and activecoins calls // TODO: remove duplicate activehandle and activecoins calls
class Login extends React.Component { class Login extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.state = { this.state = {
display: false, display: false,
activeLoginSection: 'activateCoin', activeLoginSection: 'activateCoin',
@ -386,4 +387,17 @@ class Login extends React.Component {
} }
} }
export default Login; const mapStateToProps = (state) => {
return {
Main: state.Main,
Dashboard: {
activeHandle: state.Dashboard.activeHandle,
},
Interval: {
interval: state.Interval.interval,
}
};
};
export default connect(mapStateToProps)(Login);

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

@ -6,8 +6,7 @@ const LoginRender = function () {
return ( return (
<div> <div>
<LoginSettingsModal <LoginSettingsModal
{...this.props} section={ this.state.displayLoginSettingsDropdownSection } />
section={ this.state.displayLoginSettingsDropdownSection } />
{ this.renderSwallModal() } { this.renderSwallModal() }
<div className="page animsition vertical-align text-center fade-in"> <div className="page animsition vertical-align text-center fade-in">
<div className="page-content vertical-align-middle col-xs-12 col-sm-6 col-sm-offset-3"> <div className="page-content vertical-align-middle col-xs-12 col-sm-6 col-sm-offset-3">
@ -61,14 +60,14 @@ const LoginRender = function () {
name="loginPassphrase" name="loginPassphrase"
onChange={ this.updateLoginPassPhraseInput } onChange={ this.updateLoginPassPhraseInput }
onKeyDown={ (event) => this.handleKeydown(event) } onKeyDown={ (event) => this.handleKeydown(event) }
value={ this.state.loginPassphrase } /> value={ this.state.loginPassphrase || '' } />
<textarea <textarea
className={ this.state.seedInputVisibility ? 'form-control' : 'hide' } className={ this.state.seedInputVisibility ? 'form-control' : 'hide' }
id="loginPassphrase" id="loginPassphrase"
name="loginPassphrase" name="loginPassphrase"
onChange={ this.updateLoginPassPhraseInput } onChange={ this.updateLoginPassPhraseInput }
onKeyDown={ (event) => this.handleKeydown(event) } onKeyDown={ (event) => this.handleKeydown(event) }
value={ this.state.loginPassphrase }></textarea> value={ this.state.loginPassphrase || '' }></textarea>
<i <i
className={ 'seed-toggle fa fa-eye' + (!this.state.seedInputVisibility ? '-slash' : '') } className={ 'seed-toggle fa fa-eye' + (!this.state.seedInputVisibility ? '-slash' : '') }
onClick={ this.toggleSeedInputVisibility }></i> onClick={ this.toggleSeedInputVisibility }></i>

2
react/src/components/main/main.js

@ -69,7 +69,7 @@ class Main extends React.Component {
isWalletUnlocked() { isWalletUnlocked() {
return ( return (
<WalletMain {...this.props} /> <WalletMain />
); );
} }

21
react/src/components/main/walletMain.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import Toaster from '../toaster/toaster'; import Toaster from '../toaster/toaster';
import AddCoin from '../addcoin/addcoin'; import AddCoin from '../addcoin/addcoin';
import Login from '../login/login'; import Login from '../login/login';
@ -11,15 +12,23 @@ class WalletMain extends React.Component {
return ( return (
<div className="full-height"> <div className="full-height">
<input type="text" id="js-copytextarea" /> <input type="text" id="js-copytextarea" />
<SyncOnly {...this.props} /> <SyncOnly />
<Dashboard {...this.props} /> <Dashboard />
<AddCoin {...this.props} /> <AddCoin />
<Login {...this.props} /> <Login />
<Toaster {...this.props.toaster} /> <Toaster {...this.props.toaster} />
<Notifications {...this.props} /> <Notifications />
</div> </div>
); );
} }
} }
export default WalletMain; const mapStateToProps = (state) => {
return {
toaster: state.toaster
};
};
export default connect(mapStateToProps)(WalletMain);

Loading…
Cancel
Save