Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SendComponentWithData and send redux #252

Merged
merged 2 commits into from
Dec 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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