2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
|
2020-11-02 17:51:08 +01:00
|
|
|
import {
|
|
|
|
makeSelectIsSubscribed,
|
|
|
|
selectFirstRunCompleted,
|
|
|
|
makeSelectNotificationsDisabled,
|
|
|
|
} from 'redux/selectors/subscriptions';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { makeSelectPermanentUrlForUri } from 'redux/selectors/claims';
|
2020-11-02 21:43:52 +01:00
|
|
|
import { selectUser } from 'redux/selectors/user';
|
2021-07-07 20:21:11 +02:00
|
|
|
import { doToast } from 'redux/actions/notifications';
|
2017-12-21 22:08:54 +01:00
|
|
|
import SubscribeButton from './view';
|
2017-12-08 21:38:20 +01:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
2018-10-19 22:38:07 +02:00
|
|
|
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
|
2018-11-21 22:20:55 +01:00
|
|
|
firstRunCompleted: selectFirstRunCompleted(state),
|
2019-09-04 06:22:31 +02:00
|
|
|
permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state),
|
2020-11-02 17:51:08 +01:00
|
|
|
notificationsDisabled: makeSelectNotificationsDisabled(props.uri)(state),
|
2020-11-02 21:43:52 +01:00
|
|
|
user: selectUser(state),
|
2017-12-08 21:38:20 +01:00
|
|
|
});
|
|
|
|
|
2020-06-12 22:44:25 +02:00
|
|
|
export default connect(select, {
|
|
|
|
doChannelSubscribe,
|
|
|
|
doChannelUnsubscribe,
|
|
|
|
doToast,
|
|
|
|
})(SubscribeButton);
|