From 031b237a2c93578c03b22e504bb0be0b85944b26 Mon Sep 17 00:00:00 2001 From: zxawry Date: Fri, 16 Aug 2019 18:01:01 +0100 Subject: [PATCH] do not show block button on own channels --- src/ui/component/blockButton/index.js | 9 +++++++- src/ui/component/blockButton/view.jsx | 33 +++++++++++++++------------ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/ui/component/blockButton/index.js b/src/ui/component/blockButton/index.js index 430531c48..d690c2534 100644 --- a/src/ui/component/blockButton/index.js +++ b/src/ui/component/blockButton/index.js @@ -1,9 +1,16 @@ import { connect } from 'react-redux'; -import { selectChannelIsBlocked, doToggleBlockChannel, doToast, makeSelectShortUrlForUri } from 'lbry-redux'; +import { + selectChannelIsBlocked, + doToggleBlockChannel, + doToast, + makeSelectClaimIsMine, + makeSelectShortUrlForUri, +} from 'lbry-redux'; import BlockButton from './view'; const select = (state, props) => ({ channelIsBlocked: selectChannelIsBlocked(props.uri)(state), + claimIsMine: makeSelectClaimIsMine(props.uri)(state), shortUrl: makeSelectShortUrlForUri(props.uri)(state), }); diff --git a/src/ui/component/blockButton/view.jsx b/src/ui/component/blockButton/view.jsx index 210a5001c..520c8a035 100644 --- a/src/ui/component/blockButton/view.jsx +++ b/src/ui/component/blockButton/view.jsx @@ -11,11 +11,12 @@ type Props = { isSubscribed: boolean, toggleBlockChannel: (uri: string) => void, channelIsBlocked: boolean, + claimIsMine: boolean, doToast: ({ message: string, linkText: string, linkTarget: string }) => void, }; export default function BlockButton(props: Props) { - const { uri, shortUrl, toggleBlockChannel, channelIsBlocked, doToast } = props; + const { uri, shortUrl, toggleBlockChannel, channelIsBlocked, claimIsMine, doToast } = props; const blockRef = useRef(); const isHovering = useHover(blockRef); @@ -23,19 +24,21 @@ export default function BlockButton(props: Props) { const blockedOverride = channelIsBlocked && isHovering && __('Unblock'); return ( -