Browse Source

receive / send comp own props connect

all-modes
pbca26 8 years ago
parent
commit
2d54f8c351
  1. 3
      react/src/components/dashboard/jumblr/jumblr.scss
  2. 18
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  3. 1
      react/src/components/dashboard/walletsData/walletsData.js
  4. 13
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js

3
react/src/components/dashboard/jumblr/jumblr.scss

@ -1,4 +1,7 @@
.jumblr { .jumblr {
.alert-info {
width: 100%;
}
p { p {
width: calc(100% - 100px); width: calc(100% - 100px);
} }

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

@ -217,7 +217,22 @@ class ReceiveCoin extends React.Component {
return null; return null;
} }
} }
const mapStateToProps = (state) => { const mapStateToProps = (state, props) => {
if (props &&
props.activeSection &&
props.renderTableOnly) {
return {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
receive: state.ActiveCoin.receive,
balance: state.ActiveCoin.balance,
cache: state.ActiveCoin.cache,
activeSection: props.activeSection,
activeAddress: state.ActiveCoin.activeAddress,
addresses: state.ActiveCoin.addresses,
renderTableOnly: props.renderTableOnly,
};
} else {
return { return {
coin: state.ActiveCoin.coin, coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode, mode: state.ActiveCoin.mode,
@ -228,6 +243,7 @@ const mapStateToProps = (state) => {
activeAddress: state.ActiveCoin.activeAddress, activeAddress: state.ActiveCoin.activeAddress,
addresses: state.ActiveCoin.addresses, addresses: state.ActiveCoin.addresses,
}; };
}
}; };
export default connect(mapStateToProps)(ReceiveCoin); export default connect(mapStateToProps)(ReceiveCoin);

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

@ -335,6 +335,7 @@ class WalletsData extends React.Component {
} }
// TODO: clean // TODO: clean
// TODO: figure out why changing ActiveCoin props doesn't trigger comp update
if (this.props.ActiveCoin.txhistory && if (this.props.ActiveCoin.txhistory &&
this.props.ActiveCoin.txhistory !== 'loading' && this.props.ActiveCoin.txhistory !== 'loading' &&
this.props.ActiveCoin.txhistory !== 'no data' && this.props.ActiveCoin.txhistory !== 'no data' &&

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

@ -453,8 +453,8 @@ class WalletsNativeSend extends React.Component {
} }
} }
const mapStateToProps = (state) => { const mapStateToProps = (state, props) => {
return { let _mappedProps = {
ActiveCoin: { ActiveCoin: {
addresses: state.ActiveCoin.addresses, addresses: state.ActiveCoin.addresses,
coin: state.ActiveCoin.coin, coin: state.ActiveCoin.coin,
@ -464,6 +464,15 @@ const mapStateToProps = (state) => {
activeSection: state.ActiveCoin.activeSection, activeSection: state.ActiveCoin.activeSection,
}, },
}; };
if (props &&
props.activeSection &&
props.renderFormOnly) {
_mappedProps.ActiveCoin.activeSection = props.activeSection,
_mappedProps.renderFormOnly = props.renderFormOnly;
}
return _mappedProps;
}; };
export default connect(mapStateToProps)(WalletsNativeSend); export default connect(mapStateToProps)(WalletsNativeSend);

Loading…
Cancel
Save