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

17 lines
596 B
JavaScript
Raw Normal View History

2018-03-26 23:32:43 +02:00
import Button from './view';
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) => ({
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),
});
const ConnectedButton = connect(mapStateToProps)(Button);
export default forwardRef((props, ref) => <ConnectedButton {...props} myref={ref} />);