lbry-desktop/ui/component/claimSupportButton/index.js
Rafael c9fbf197f9 Refactor claimSupportButton
- Tooltip
- only interested in repost value from claim
2022-02-08 12:35:40 -05:00

24 lines
652 B
JavaScript

import { connect } from 'react-redux';
import { doOpenModal } from 'redux/actions/app';
import { makeSelectTagInClaimOrChannelForUri, selectClaimForUri } from 'redux/selectors/claims';
import ClaimSupportButton from './view';
const DISABLE_SUPPORT_TAG = 'disable-support';
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 = {
doOpenModal,
};
export default connect(select, perform)(ClaimSupportButton);