import { connect , MapStateToProps , MapDispatchToPropsFunction , } from 'react-redux' ; import Settings from './index' ; import { StateProps , DispatchProps , OwnProps , } from './props' ; import { setUserPreferredLocale , unsetUserPreferredLocale , } from 'actions/preferences' ; import { getUserPreferredLocale , } from 'store/reducers/locale' ; const mapStateToProps = ( state ) => { return { currentUserPreferredLocale : getUserPreferredLocale ( state ) , } ; } ; const mapDispatchToProps = ( dispatch ) => ( { onLocaleChange : ( locale ) => dispatch ( setUserPreferredLocale ( locale ) ) , onLocaleUnset : ( ) => dispatch ( unsetUserPreferredLocale ( void 0 ) ) , } ) ; const connected = connect < StateProps , DispatchProps , OwnProps > ( mapStateToProps , mapDispatchToProps ) ( Settings ) ; export default connected ;