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

28 lines
844 B
JavaScript
Raw Normal View History

2020-02-12 19:59:48 +01:00
import { connect } from 'react-redux';
import { doOpenModal } from 'redux/actions/app';
import { makeSelectTagInClaimOrChannelForUri, selectClaimForUri } from 'redux/selectors/claims';
2020-11-10 06:21:04 +01:00
import ClaimSupportButton from './view';
2022-03-28 22:32:01 +02:00
import { selectClientSetting } from 'redux/selectors/settings';
import * as SETTINGS from 'constants/settings';
2020-02-12 19:59:48 +01:00
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,
2022-03-28 22:32:01 +02:00
preferredCurrency: selectClientSetting(state, SETTINGS.PREFERRED_CURRENCY),
};
};
const perform = {
doOpenModal,
};
export default connect(select, perform)(ClaimSupportButton);