import { connect , MapStateToProps , MapDispatchToPropsFunction , } from 'react-redux' ; import noop from 'lodash/noop' ; import CompatibilityChecker from './index' ; import { currentBrowser , getApplicapleBrowsers } from 'utils/browsers' ; import { StateProps , DispatchProps , OwnProps , } from './props' ; import { isCheckingCompatiblity , isBrowserCompatible , getMissingFeaturesForUserAgent , } from 'store/reducers/env/compat' ; const mapStateToProps = ( state , { userAgent } ) => { const isCompatible = isBrowserCompatible ( state ) ( userAgent ) ; const isChecking = isCheckingCompatiblity ( state ) ; return { currentBrowser , isChecking , shouldUpgradeCurrentBrowser : ! isCompatible , missingFeatures : getMissingFeaturesForUserAgent ( state ) ( userAgent ) , open : isChecking || ! isCompatible , isNerdMode : false , recommendedBrowsers : getApplicapleBrowsers ( true ) , } ; } ; const mapDispatchToProps = ( _ ) => ( { onDialogClosed : noop , } ) ; const connected = connect < StateProps , DispatchProps , OwnProps > ( mapStateToProps , mapDispatchToProps ) ( CompatibilityChecker ) ; export default connected ;