From 91f748d566709df26880c66c04faafe0a6f0067d Mon Sep 17 00:00:00 2001 From: jessop Date: Tue, 27 Oct 2020 15:54:36 -0400 Subject: [PATCH] enable owners to tag claims and channels disable-support --- package.json | 2 +- ui/component/claimSupportButton/index.js | 15 +++++++++------ ui/component/claimSupportButton/view.jsx | 7 +++++-- yarn.lock | 4 ++-- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 93c1e6c45..dbeed3b91 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "imagesloaded": "^4.1.4", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#3cb3859baf9f179732743bbc5a43e1104094a144", + "lbry-redux": "lbryio/lbry-redux#1fc5afa0c45cfb4126539513088b580db9c4aca1", "lbryinc": "lbryio/lbryinc#517c28a183d6ab69a357227809bc7c3c12d8411e", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/ui/component/claimSupportButton/index.js b/ui/component/claimSupportButton/index.js index 1e3b76ec0..592d0d060 100644 --- a/ui/component/claimSupportButton/index.js +++ b/ui/component/claimSupportButton/index.js @@ -1,10 +1,13 @@ import { connect } from 'react-redux'; import { doOpenModal } from 'redux/actions/app'; import ClaimSupportButton from './view'; +import { makeSelectTagInClaimOrChannelForUri } from 'lbry-redux'; -export default connect( - null, - { - doOpenModal, - } -)(ClaimSupportButton); +const DISABLE_SUPPORT_TAG = 'disable-support'; +const select = (state, props) => ({ + disableSupport: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_SUPPORT_TAG)(state), +}); + +export default connect(select, { + doOpenModal, +})(ClaimSupportButton); diff --git a/ui/component/claimSupportButton/view.jsx b/ui/component/claimSupportButton/view.jsx index edc79f042..bebc3b4af 100644 --- a/ui/component/claimSupportButton/view.jsx +++ b/ui/component/claimSupportButton/view.jsx @@ -9,11 +9,14 @@ type Props = { uri: string, doOpenModal: (string, {}) => void, fileAction?: boolean, + disableSupport: boolean, }; export default function ClaimSupportButton(props: Props) { - const { doOpenModal, uri, fileAction } = props; - + const { doOpenModal, uri, fileAction, disableSupport } = props; + if (disableSupport) { + return null; + } return (