lbry-desktop/ui/component/userEmailNew/index.js

23 lines
778 B
JavaScript
Raw Normal View History

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