2018-03-26 23:32:43 +02:00
|
|
|
import Button from './view';
|
2019-10-15 20:53:55 +02:00
|
|
|
import React, { forwardRef } from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
2021-06-18 00:52:21 +02:00
|
|
|
import { selectUser, selectUserVerifiedEmail } from 'redux/selectors/user';
|
2021-07-01 21:40:13 +02:00
|
|
|
import { selectSyncFatalError } from 'redux/selectors/sync';
|
2017-04-07 07:15:22 +02:00
|
|
|
|
2021-06-18 00:52:21 +02:00
|
|
|
const mapStateToProps = (state) => ({
|
2019-10-15 20:53:55 +02:00
|
|
|
pathname: state.router.location.pathname,
|
|
|
|
emailVerified: selectUserVerifiedEmail(state),
|
2021-06-18 00:52:21 +02:00
|
|
|
user: selectUser(state),
|
2021-07-01 21:40:13 +02:00
|
|
|
fatal: selectSyncFatalError(state),
|
2019-10-15 20:53:55 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const ConnectedButton = connect(mapStateToProps)(Button);
|
|
|
|
|
|
|
|
export default forwardRef((props, ref) => <ConnectedButton {...props} myref={ref} />);
|