2020-02-12 13:59:48 -05:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
2022-02-01 17:08:27 -03:00
|
|
|
import { makeSelectTagInClaimOrChannelForUri, selectClaimForUri } from 'redux/selectors/claims';
|
2020-11-10 00:21:04 -05:00
|
|
|
import ClaimSupportButton from './view';
|
2020-02-12 13:59:48 -05:00
|
|
|
|
2020-10-27 15:54:36 -04:00
|
|
|
const DISABLE_SUPPORT_TAG = 'disable-support';
|
|
|
|
|
2022-02-01 17:08:27 -03:00
|
|
|
const select = (state, props) => {
|
|
|
|
const { uri } = props;
|
|
|
|
|
|
|
|
const claim = selectClaimForUri(state, uri);
|
|
|
|
const isRepost = claim && claim.repost_url;
|
|
|
|
|
|
|
|
return {
|
|
|
|
disableSupport: makeSelectTagInClaimOrChannelForUri(uri, DISABLE_SUPPORT_TAG)(state),
|
|
|
|
isRepost,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const perform = {
|
2020-10-27 15:54:36 -04:00
|
|
|
doOpenModal,
|
2022-02-01 17:08:27 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(select, perform)(ClaimSupportButton);
|