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

27 lines
1 KiB
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 { DAEMON_SETTINGS } from 'lbry-redux';
import { doSetClientSetting, doSetDaemonSetting } from 'redux/actions/settings';
import { makeSelectClientSetting, selectDaemonSettings } 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),
daemonSettings: selectDaemonSettings(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)),
setShareDiagnosticData: shouldShareData =>
dispatch(doSetDaemonSetting(DAEMON_SETTINGS.SHARE_USAGE_DATA, shouldShareData)),
2017-06-10 19:17:37 +02:00
});
2018-09-24 05:44:42 +02:00
export default connect(
select,
perform
)(UserEmailNew);