You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.4 KiB
45 lines
1.4 KiB
import Home from './home.component'
|
|
import { compose } from 'recompose'
|
|
import { connect } from 'react-redux'
|
|
import { withRouter } from 'react-router-dom'
|
|
import { unconfirmedTransactionsCountSelector } from '../../selectors/confirm-transaction'
|
|
import { getCurrentEthBalance } from '../../selectors/selectors'
|
|
import {
|
|
unsetMigratedPrivacyMode,
|
|
} from '../../store/actions'
|
|
import { getEnvironmentType } from '../../../../app/scripts/lib/util'
|
|
import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums'
|
|
|
|
const mapStateToProps = state => {
|
|
const { metamask, appState } = state
|
|
const {
|
|
suggestedTokens,
|
|
providerRequests,
|
|
migratedPrivacyMode,
|
|
seedPhraseBackedUp,
|
|
tokens,
|
|
} = metamask
|
|
const accountBalance = getCurrentEthBalance(state)
|
|
const { forgottenPassword } = appState
|
|
|
|
const isPopup = getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP
|
|
|
|
return {
|
|
forgottenPassword,
|
|
suggestedTokens,
|
|
unconfirmedTransactionsCount: unconfirmedTransactionsCountSelector(state),
|
|
providerRequests,
|
|
showPrivacyModeNotification: migratedPrivacyMode,
|
|
shouldShowSeedPhraseReminder: !seedPhraseBackedUp && (parseInt(accountBalance, 16) > 0 || tokens.length > 0),
|
|
isPopup,
|
|
}
|
|
}
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
unsetMigratedPrivacyMode: () => dispatch(unsetMigratedPrivacyMode()),
|
|
})
|
|
|
|
export default compose(
|
|
withRouter,
|
|
connect(mapStateToProps, mapDispatchToProps)
|
|
)(Home)
|
|
|