make clear supporting repost
This commit is contained in:
parent
6211c243dd
commit
a8cc17624c
2 changed files with 8 additions and 3 deletions
|
@ -1,11 +1,12 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { makeSelectTagInClaimOrChannelForUri } from 'lbry-redux';
|
||||
import { makeSelectTagInClaimOrChannelForUri, makeSelectClaimForUri } from 'lbry-redux';
|
||||
import ClaimSupportButton from './view';
|
||||
|
||||
const DISABLE_SUPPORT_TAG = 'disable-support';
|
||||
const select = (state, props) => ({
|
||||
disableSupport: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_SUPPORT_TAG)(state),
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
|
|
|
@ -10,10 +10,12 @@ type Props = {
|
|||
doOpenModal: (string, {}) => void,
|
||||
fileAction?: boolean,
|
||||
disableSupport: boolean,
|
||||
claim: GenericClaim,
|
||||
};
|
||||
|
||||
export default function ClaimSupportButton(props: Props) {
|
||||
const { doOpenModal, uri, fileAction, disableSupport } = props;
|
||||
const { doOpenModal, uri, fileAction, disableSupport, claim } = props;
|
||||
const isRepost = claim && claim.repost_url;
|
||||
|
||||
if (disableSupport) {
|
||||
return null;
|
||||
|
@ -25,7 +27,9 @@ export default function ClaimSupportButton(props: Props) {
|
|||
className={classnames({ 'button--file-action': fileAction })}
|
||||
icon={ICONS.LBC}
|
||||
iconSize={fileAction ? 22 : undefined}
|
||||
label={__('Support --[button to support a claim]--')}
|
||||
label={
|
||||
isRepost ? __('Support Repost --[button to support a claim]--') : __('Support --[button to support a claim]--')
|
||||
}
|
||||
requiresAuth={IS_WEB}
|
||||
title={__('Support this claim')}
|
||||
onClick={() => doOpenModal(MODALS.SEND_TIP, { uri, isSupport: true })}
|
||||
|
|
Loading…
Add table
Reference in a new issue