import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import Settings from './Settings' import * as SettingsSelectors from '../../modules/settings/selectors' import * as SettingsActions from '../../modules/settings/actions' import * as UserPropertiesActions from '../../modules/userProperties/actions' import * as GateSelectors from '../../modules/gates/selectors' import * as AuthSelectors from '../../modules/auth/selectors' import * as AuthActions from '../../modules/auth/actions' import { SettingsContainerStateToProps, SettingsContainerDispatchProps, SettingsContainerProps } from './interfaces' const mapStateToProps = (state: any) => ({ bccStatus: SettingsSelectors.bccStatus(state), bccEmailAddress: SettingsSelectors.bccEmailAddress(state), gmailConnected: AuthSelectors.gmailConnected(state), accessToken: AuthSelectors.accessToken(state), hasExportSequenceData: GateSelectors.hasExportSequenceData(state), }) const mapDispatchToProps = (dispatch: any) => ({ actions: bindActionCreators( { logout: AuthActions.logout, updateSetting: SettingsActions.setSettingStatus, fetchUserProperties: UserPropertiesActions.fetchUserProperties, fetchGoogleScopes: AuthActions.fetchGoogleScopes, }, dispatch, ), }) export default connect( mapStateToProps, mapDispatchToProps, )(Settings)