2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2020-06-15 16:33:03 -04:00
|
|
|
import { doClearEmailEntry, doClearPasswordEntry } from 'redux/actions/user';
|
2019-12-18 00:27:08 -05:00
|
|
|
import { doSignOut, doOpenModal } from 'redux/actions/app';
|
2021-12-20 09:29:51 -03:00
|
|
|
import { selectClientSetting } from 'redux/selectors/settings';
|
|
|
|
import { selectGetSyncErrorMessage } from 'redux/selectors/sync';
|
|
|
|
import { selectHasNavigated } from 'redux/selectors/app';
|
|
|
|
import { selectTotalBalance, selectBalance } from 'redux/selectors/wallet';
|
|
|
|
import { selectUserVerifiedEmail, selectEmailToVerify, selectUser } from 'redux/selectors/user';
|
|
|
|
import * as MODALS from 'constants/modal_types';
|
|
|
|
import * as SETTINGS from 'constants/settings';
|
2019-06-17 16:32:38 -04:00
|
|
|
import Header from './view';
|
2017-04-22 20:17:01 +07:00
|
|
|
|
2021-03-03 13:50:16 -05:00
|
|
|
const select = (state) => ({
|
2020-01-03 14:34:17 -05:00
|
|
|
authenticated: selectUserVerifiedEmail(state),
|
2021-12-20 09:29:51 -03:00
|
|
|
balance: selectBalance(state),
|
2020-04-13 15:16:07 -04:00
|
|
|
emailToVerify: selectEmailToVerify(state),
|
2020-07-10 17:04:36 -04:00
|
|
|
hasNavigated: selectHasNavigated(state),
|
2021-12-20 09:29:51 -03:00
|
|
|
hideBalance: selectClientSetting(state, SETTINGS.HIDE_BALANCE),
|
2021-12-21 10:21:14 -03:00
|
|
|
totalBalance: selectTotalBalance(state),
|
2021-12-20 09:29:51 -03:00
|
|
|
syncError: selectGetSyncErrorMessage(state),
|
2020-09-29 16:15:35 -04:00
|
|
|
user: selectUser(state),
|
2017-06-05 21:21:55 -07:00
|
|
|
});
|
2017-04-22 20:17:01 +07:00
|
|
|
|
2021-03-03 13:50:16 -05:00
|
|
|
const perform = (dispatch) => ({
|
2020-04-13 15:16:07 -04:00
|
|
|
clearEmailEntry: () => dispatch(doClearEmailEntry()),
|
|
|
|
clearPasswordEntry: () => dispatch(doClearPasswordEntry()),
|
2021-12-20 09:29:51 -03:00
|
|
|
signOut: () => dispatch(doSignOut()),
|
|
|
|
openChangelog: (modalProps) => dispatch(doOpenModal(MODALS.CONFIRM, modalProps)),
|
2017-06-05 21:21:55 -07:00
|
|
|
});
|
2017-04-22 20:17:01 +07:00
|
|
|
|
2020-03-13 19:00:22 -04:00
|
|
|
export default connect(select, perform)(Header);
|