lbry-desktop/ui/component/subscribeButton/index.js
zeppi ee9f63a161 integrate all the things
bugfix

wip

flow

fix

cleaning

clean
2021-10-15 23:49:41 -04:00

25 lines
916 B
JavaScript

import { connect } from 'react-redux';
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
import {
makeSelectIsSubscribed,
selectFirstRunCompleted,
makeSelectNotificationsDisabled,
} from 'redux/selectors/subscriptions';
import { makeSelectPermanentUrlForUri } from 'redux/selectors/claims';
import { selectUser } from 'redux/selectors/user';
import { doToast } from 'redux/actions/notifications';
import SubscribeButton from './view';
const select = (state, props) => ({
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
firstRunCompleted: selectFirstRunCompleted(state),
permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state),
notificationsDisabled: makeSelectNotificationsDisabled(props.uri)(state),
user: selectUser(state),
});
export default connect(select, {
doChannelSubscribe,
doChannelUnsubscribe,
doToast,
})(SubscribeButton);