Skip to content

Commit

Permalink
Merge pull request #252 from rainbow-me/@jin/send-remove-redux
Browse files Browse the repository at this point in the history
Remove SendComponentWithData and send redux
  • Loading branch information
mikedemarais authored Dec 3, 2019
2 parents c11eda2 + a7700ae commit c7c3403
Show file tree
Hide file tree
Showing 10 changed files with 435 additions and 792 deletions.
297 changes: 0 additions & 297 deletions src/components/SendComponentWithData.js

This file was deleted.

3 changes: 2 additions & 1 deletion src/components/fields/AddressField.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ export default withNavigation(
this.inputRef.focus()
);
}

shouldComponentUpdate(nextProps, nextState) {
const isNewAddress = isNewValueForPath(this.props, this.state, 'address');
const isNewAddress = isNewValueForPath(nextProps, this.state, 'address');
const isNewInputValue = isNewValueForPath(
this.state,
nextState,
Expand Down
7 changes: 6 additions & 1 deletion src/components/send/SendAssetForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const SendAssetForm = ({
buttonRenderer,
onResetAssetSelection,
selected,
sendMaxBalance,
txSpeedRenderer,
...props
}) => {
Expand Down Expand Up @@ -69,7 +70,11 @@ const SendAssetForm = ({
{selected.isNft ? (
<SendAssetFormCollectible {...selected} />
) : (
<SendAssetFormToken {...props} selected={selected} />
<SendAssetFormToken
{...props}
sendMaxBalance={sendMaxBalance}
selected={selected}
/>
)}
<ColumnWithMargins
flex={0}
Expand Down
3 changes: 1 addition & 2 deletions src/hoc/withDataInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default Component =>
},
clearAccountData: ownProps => async () => {
web3ListenerClearState();
gasClearState();
const p0 = ownProps.explorerClearState();
const p1 = ownProps.dataClearState();
const p2 = ownProps.clearIsWalletEmpty();
Expand All @@ -93,7 +94,6 @@ export default Component =>
const p6 = ownProps.nonceClearState();
const p7 = ownProps.requestsClearState();
const p8 = ownProps.uniswapClearState();
const p9 = ownProps.gasClearState();
return promiseUtils.PromiseAllWithFails([
p0,
p1,
Expand All @@ -104,7 +104,6 @@ export default Component =>
p6,
p7,
p8,
p9,
]);
},
initializeAccountData: ownProps => async () => {
Expand Down
4 changes: 1 addition & 3 deletions src/redux/gas.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ const getSelectedGasPrice = (
};
};

export const gasClearState = () => () => {
clearInterval(getGasPricesInterval);
};
export const gasClearState = () => clearInterval(getGasPricesInterval);

// -- Reducer --------------------------------------------------------------- //
const INITIAL_STATE = {
Expand Down
2 changes: 0 additions & 2 deletions src/redux/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import openStateSettings from './openStateSettings';
import requests from './requests';
import selectedInput from './selectedInput';
import selectedWithFab from './selectedWithFab';
import send from './send';
import settings from './settings';
import uniqueTokens from './uniqueTokens';
import uniswap from './uniswap';
Expand All @@ -39,7 +38,6 @@ export default combineReducers({
requests,
selectedInput,
selectedWithFab,
send,
settings,
uniqueTokens,
uniswap,
Expand Down
Loading

0 comments on commit c7c3403

Please sign in to comment.