2019-09-26 12:28:08 -04:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2018-09-23 23:44:42 -04:00
|
|
|
import { selectEmailNewIsPending, selectEmailNewErrorMessage, doUserEmailNew } from 'lbryinc';
|
2019-09-26 12:28:08 -04:00
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2019-10-15 00:20:12 -04:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
2017-12-21 18:08:54 -03:00
|
|
|
import UserEmailNew from './view';
|
2017-06-01 20:51:52 -04:00
|
|
|
|
2017-06-11 00:17:37 +07:00
|
|
|
const select = state => ({
|
2017-06-01 20:51:52 -04:00
|
|
|
isPending: selectEmailNewIsPending(state),
|
|
|
|
errorMessage: selectEmailNewErrorMessage(state),
|
2019-09-26 12:28:08 -04:00
|
|
|
syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state),
|
2017-06-11 00:17:37 +07:00
|
|
|
});
|
2017-06-01 20:51:52 -04:00
|
|
|
|
2017-06-11 00:17:37 +07:00
|
|
|
const perform = dispatch => ({
|
|
|
|
addUserEmail: email => dispatch(doUserEmailNew(email)),
|
2019-09-26 12:28:08 -04:00
|
|
|
setSync: value => dispatch(doSetClientSetting(SETTINGS.ENABLE_SYNC, value)),
|
2017-06-11 00:17:37 +07:00
|
|
|
});
|
2017-06-01 20:51:52 -04:00
|
|
|
|
2018-09-23 23:44:42 -04:00
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(UserEmailNew);
|