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

19 lines
710 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
import { makeSelectIsSubscribed, selectFirstRunCompleted } from 'redux/selectors/subscriptions';
import { makeSelectPermanentUrlForUri } from 'lbry-redux';
import { doToast } from 'redux/actions/notifications';
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
});
export default connect(select, {
doChannelSubscribe,
doChannelUnsubscribe,
doToast,
})(SubscribeButton);