Skip to content

Commit

Permalink
Use set of selectors for ActivateAccount component (#1966)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinbodnar committed Oct 1, 2021
1 parent c662015 commit e87be8e
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import styled from 'styled-components';

import { Mixpanel } from '../../../mixpanel';
import { redirectTo, clearFundedAccountNeedsDeposit, getBalance, getAccountHelperWalletState } from '../../../redux/actions/account';
import { selectAccountSlice } from '../../../redux/slices/account';
import { selectAccountFundedAccountNeedsDeposit, selectAccountRequiredUnlockBalance, selectAccountSlice } from '../../../redux/slices/account';
import { selectStatusMainLoader } from '../../../redux/slices/status';
import { selectNearTokenFiatValueUSD } from '../../../redux/slices/tokenFiatValues';
import { removeAccountIsInactive } from '../../../utils/localStorage';
import { isMoonpayAvailable, getSignedUrl } from '../../../utils/moonpay';
Expand Down Expand Up @@ -251,15 +252,12 @@ class ActivateAccount extends Component {
}
}

const mapStateToProps = (state) => {
const { account, status } = state;
return {
...selectAccountSlice(state),
mainLoader: status.mainLoader,
minBalanceToUnlock: account.accountHelperWalletState?.requiredUnlockBalance || MIN_BALANCE_FOR_GAS,
needsDeposit: account.accountHelperWalletState?.fundedAccountNeedsDeposit,
nearTokenFiatValueUSD: selectNearTokenFiatValueUSD(state)
};
};
const mapStateToProps = (state) => ({
...selectAccountSlice(state),
mainLoader: selectStatusMainLoader(state),
minBalanceToUnlock: selectAccountRequiredUnlockBalance(state) || MIN_BALANCE_FOR_GAS,
needsDeposit: selectAccountFundedAccountNeedsDeposit(state),
nearTokenFiatValueUSD: selectNearTokenFiatValueUSD(state)
});

export const ActivateAccountWithRouter = connect(mapStateToProps)(withRouter(ActivateAccount));

0 comments on commit e87be8e

Please sign in to comment.