Browse Source

Merge pull request #159 from SuperNETorg/merge-wallets-native-info

Merge Wallets native info
all-modes
pbca26 8 years ago
committed by GitHub
parent
commit
4894b66526
  1. 4
      react/src/components/dashboard/jumblr/jumblr.render.js
  2. 4
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  3. 2
      react/src/components/dashboard/walletsBalance/walletsBalance.js
  4. 2
      react/src/components/dashboard/walletsData/walletsData.js
  5. 4
      react/src/components/dashboard/walletsInfo/walletsInfo.js
  6. 4
      react/src/components/dashboard/walletsInfo/walletsInfo.render.js
  7. 4
      react/src/components/dashboard/walletsNative/walletsNative.render.js
  8. 2
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js
  9. 6
      react/src/components/dashboard/walletsNav/walletsNav.js
  10. 2
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.js
  11. 14
      react/src/reducers/activeCoin.js

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

@ -371,7 +371,7 @@ export const JumblrRender = function() {
<WalletsNativeSend
{...this.props}
renderFormOnly="true"
nativeActiveSection="send" />
activeSection="send" />
</div>
</div>
</div>
@ -476,7 +476,7 @@ export const JumblrRender = function() {
<div className={ 'tab-pane' + (this.state.activeTab === 1 ? ' active' : '') }>
<ReceiveCoin
{...this.props.ActiveCoin}
nativeActiveSection="receive"
activeSection="receive"
renderTableOnly="true" />
</div>
</div>

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

@ -206,10 +206,10 @@ class ReceiveCoin extends React.Component {
}
render() {
// TODO nativeActiveSection === 'receive' should be removed when native mode is fully merged
// TODO activeSection === 'receive' should be removed when native mode is fully merged
// into the rest of the components
if (this.props &&
(this.props.receive || (this.isNativeMode() && this.props.nativeActiveSection === 'receive'))) {
(this.props.receive || (this.isNativeMode() && this.props.activeSection === 'receive'))) {
return ReceiveCoinRender.call(this);
}

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

@ -167,7 +167,7 @@ class WalletsBalance extends React.Component {
}
isNativeBalanceActive() {
return this.isNativeMode() && this.props.ActiveCoin.nativeActiveSection === 'default';
return this.isNativeMode() && this.props.ActiveCoin.activeSection === 'default';
}
isNonNativeBalanceActive() {

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

@ -638,7 +638,7 @@ class WalletsData extends React.Component {
!this.props.ActiveCoin.receive
) || (
this.props.ActiveCoin.mode === 'native' &&
this.props.ActiveCoin.nativeActiveSection === 'default'
this.props.ActiveCoin.activeSection === 'default'
)) {
return WalletsDataRender.call(this);
} else {

4
react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.js → react/src/components/dashboard/walletsInfo/walletsInfo.js

@ -1,7 +1,7 @@
import React from 'react';
import WalletsNativeInfoRender from './walletsInfo.render';
import { toggleClaimInterestModal } from '../../../actions/actionCreators';
import Store from '../../../store';
import WalletsNativeInfoRender from './walletsNativeInfo.render';
class WalletsNativeInfo extends React.Component {
constructor(props) {
@ -17,7 +17,7 @@ class WalletsNativeInfo extends React.Component {
if (this.props &&
this.props.Dashboard &&
this.props.Dashboard.progress &&
this.props.ActiveCoin.nativeActiveSection === 'settings') {
this.props.ActiveCoin.activeSection === 'settings') {
return WalletsNativeInfoRender.call(this);
}

4
react/src/components/dashboard/walletsNativeInfo/walletsNativeInfo.render.js → react/src/components/dashboard/walletsInfo/walletsInfo.render.js

@ -2,7 +2,7 @@ import React from 'react';
import { translate } from '../../../translate/translate';
import ClaimInterestModal from '../claimInterestModal/claimInterestModal';
const WalletsNativeInfoRender = function() {
const WalletsInfoRender = function() {
return (
<div>
<div className="col-xlg-6 col-md-4">
@ -156,4 +156,4 @@ const WalletsNativeInfoRender = function() {
);
};
export default WalletsNativeInfoRender;
export default WalletsInfoRender;

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

@ -1,6 +1,6 @@
import React from 'react';
import WalletsBalance from '../walletsBalance/walletsBalance';
import WalletsNativeInfo from '../walletsNativeInfo/walletsNativeInfo';
import WalletsInfo from '../walletsInfo/walletsInfo';
import WalletsNativeSend from '../walletsNativeSend/walletsNativeSend';
import WalletsProgress from '../walletsProgress/walletsProgress';
import WalletsData from '../walletsData/walletsData';
@ -34,7 +34,7 @@ const WalletsNativeRender = function() {
<ReceiveCoin {...this.props.ActiveCoin} />
<WalletsData {...this.props} />
<WalletsNativeSend {...this.props} />
<WalletsNativeInfo {...this.props} />
<WalletsInfo {...this.props} />
</div>
</div>
</div>

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

@ -351,7 +351,7 @@ class WalletsNativeSend extends React.Component {
render() {
if (this.props &&
this.props.ActiveCoin &&
(this.props.ActiveCoin.nativeActiveSection === 'send' || this.props.nativeActiveSection === 'send')) {
(this.props.ActiveCoin.activeSection === 'send' || this.props.activeSection === 'send')) {
return WalletsNativeSendRender.call(this);
}

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

@ -73,7 +73,7 @@ class WalletsNav extends React.Component {
if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'settings' ? 'default' : 'settings'
this.props.ActiveCoin.activeSection === 'settings' ? 'default' : 'settings'
)
);
} else {
@ -93,7 +93,7 @@ class WalletsNav extends React.Component {
if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'send' ? 'default' : 'send'
this.props.ActiveCoin.activeSection === 'send' ? 'default' : 'send'
)
);
} else {
@ -105,7 +105,7 @@ class WalletsNav extends React.Component {
if (this.props.ActiveCoin.mode === 'native') {
Store.dispatch(
toggleDashboardActiveSection(
this.props.ActiveCoin.nativeActiveSection === 'receive' ? 'default' : 'receive'
this.props.ActiveCoin.activeSection === 'receive' ? 'default' : 'receive'
)
);
} else {

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

@ -43,7 +43,7 @@ class WalletsTxInfo extends React.Component {
// 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'))) {
(this.isNativeMode() && this.props.ActiveCoin.activeSection === 'default'))) {
const txInfo = sortByDate(this.props.ActiveCoin.txhistory)[this.props.ActiveCoin.showTransactionInfoTxIndex];
return WalletsTxInfoRender.call(this, txInfo);
}

14
react/src/reducers/activeCoin.js

@ -27,7 +27,7 @@ export function ActiveCoin(state = {
send: false,
receive: false,
balance: 0,
nativeActiveSection: 'default',
activeSection: 'default',
showTransactionInfo: false,
showTransactionInfoTxIndex: null,
txhistory: [],
@ -53,7 +53,7 @@ export function ActiveCoin(state = {
receive: state.receive,
showTransactionInfo: state.showTransactionInfo,
showTransactionInfoTxIndex: state.showTransactionInfoTxIndex,
nativeActiveSection: state.nativeActiveSection,
activeSection: state.activeSection,
lastSendToResponse: state.lastSendToResponse,
mainBasiliskAddress: state.mainBasiliskAddress,
opids: state.opids,
@ -73,7 +73,7 @@ export function ActiveCoin(state = {
receive: _coinData.receive,
showTransactionInfo: _coinData.showTransactionInfo,
showTransactionInfoTxIndex: _coinData.showTransactionInfoTxIndex,
nativeActiveSection: _coinData.nativeActiveSection,
activeSection: _coinData.activeSection,
lastSendToResponse: _coinData.lastSendToResponse,
mainBasiliskAddress: _coinData.mainBasiliskAddress,
opids: _coinData.opids,
@ -91,7 +91,7 @@ export function ActiveCoin(state = {
receive: state.receive,
showTransactionInfo: state.showTransactionInfo,
showTransactionInfoTxIndex: state.showTransactionInfoTxIndex,
nativeActiveSection: state.nativeActiveSection,
activeSection: state.activeSection,
lastSendToResponse: state.lastSendToResponse,
mainBasiliskAddress: state.mainBasiliskAddress,
opids: state.opids,
@ -110,7 +110,7 @@ export function ActiveCoin(state = {
receive: false,
showTransactionInfo: false,
showTransactionInfoTxIndex: null,
nativeActiveSection: 'default',
activeSection: 'default',
});
} else {
return Object.assign({}, state, {
@ -122,7 +122,7 @@ export function ActiveCoin(state = {
receive: false,
showTransactionInfo: false,
showTransactionInfoTxIndex: null,
nativeActiveSection: 'default',
activeSection: 'default',
});
}
}
@ -151,7 +151,7 @@ export function ActiveCoin(state = {
});
case DASHBOARD_ACTIVE_SECTION:
return Object.assign({}, state, {
nativeActiveSection: action.section,
activeSection: action.section,
});
case DASHBOARD_ACTIVE_TXINFO_MODAL:
return Object.assign({}, state, {

Loading…
Cancel
Save