2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
|
2020-08-27 13:56:18 -04:00
|
|
|
import { makeSelectIsSubscribed, selectFirstRunCompleted } from 'redux/selectors/subscriptions';
|
2020-06-12 16:44:25 -04:00
|
|
|
import { makeSelectPermanentUrlForUri } from 'lbry-redux';
|
|
|
|
import { doToast } from 'redux/actions/notifications';
|
2017-12-21 18:08:54 -03:00
|
|
|
import SubscribeButton from './view';
|
2017-12-08 15:38:20 -05:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
2018-10-19 16:38:07 -04:00
|
|
|
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
|
2018-11-21 16:20:55 -05:00
|
|
|
firstRunCompleted: selectFirstRunCompleted(state),
|
2019-09-04 00:22:31 -04:00
|
|
|
permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state),
|
2017-12-08 15:38:20 -05:00
|
|
|
});
|
|
|
|
|
2020-06-12 16:44:25 -04:00
|
|
|
export default connect(select, {
|
|
|
|
doChannelSubscribe,
|
|
|
|
doChannelUnsubscribe,
|
|
|
|
doToast,
|
|
|
|
})(SubscribeButton);
|