Browse Source

Jumblr prop refactor

all-modes
Miika Turunen 8 years ago
parent
commit
8923219384
  1. 16
      react/src/components/dashboard/jumblr/jumblr.js
  2. 2
      react/src/components/dashboard/jumblr/jumblr.render.js
  3. 4
      react/src/components/dashboard/main/dashboard.render.js
  4. 4
      react/src/components/dashboard/navbar/navbar.js
  5. 7
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js

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

@ -1,4 +1,5 @@
import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../translate/translate';
import {
dashboardChangeActiveCoin,
@ -39,8 +40,8 @@ if (!window.jumblrPasshrase) { // gen jumblr passphrase
}
class Jumblr extends React.Component {
constructor(props) {
super(props);
constructor() {
super();
this.state = {
activeTab: 0,
randomSeed: window.jumblrPasshrase,
@ -418,4 +419,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

@ -369,7 +369,6 @@ export const JumblrRender = function() {
<p>Use the form below to send funds to your jumblr deposit address.</p>
<p className="padding-bottom-20">You can also send funds to deposit address from an external service or another wallet.</p>
<WalletsNativeSend
{...this.props}
renderFormOnly="true"
activeSection="send" />
</div>
@ -475,7 +474,6 @@ export const JumblrRender = function() {
</div>
<div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }>
<ReceiveCoin
{...this.props.ActiveCoin}
activeSection="receive"
renderTableOnly="true" />
</div>

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

@ -40,10 +40,10 @@ const DashboardRender = function() {
<EDEX />
}
{ this.isSectionActive('atomic') &&
<Atomic {...this.props} />
<Atomic />
}
{ this.isSectionActive('jumblr') &&
<Jumblr {...this.props} />
<Jumblr />
}
{ this.isSectionActive('settings') &&
<Settings {...this.props} />

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

@ -117,6 +117,10 @@ class Navbar extends React.Component {
}
const mapStateToProps = (state) => {
return {
ActiveCoin: {
mode: state.ActiveCoin.mode,
coin: state.ActiveCoin.coin,
},
Dashboard: {
activeSection: state.Dashboard.activeSection,
},

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

@ -19,8 +19,8 @@ import {
} from './walletsNativeSend.render';
class WalletsNativeSend extends React.Component {
constructor() {
super();
constructor(props) {
super(props);
this.state = {
addressType: null,
sendFrom: null,
@ -368,8 +368,7 @@ const mapStateToProps = (state) => {
mode: state.ActiveCoin.mode,
opids: state.ActiveCoin.opids,
activeSection: state.ActiveCoin.activeSection,
},
renderFormOnly: state.renderFormOnly
}
};
};

Loading…
Cancel
Save