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