Browse Source

SyncOnly component prop refactor

all-modes
Miika Turunen 8 years ago
parent
commit
526699b4a5
  1. 23
      react/src/components/dashboard/syncOnly/syncOnly.js
  2. 2
      react/src/components/main/walletMain.js

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);

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

@ -11,7 +11,7 @@ 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 {...this.props} />
<AddCoin {...this.props} /> <AddCoin {...this.props} />
<Login {...this.props} /> <Login {...this.props} />

Loading…
Cancel
Save