From 277d78868ddb2aa11d7f188f3ca38de9dc5e7d35 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Wed, 25 Aug 2021 13:32:38 +0800 Subject: [PATCH 1/2] Re-arrange prop types to show "element params" first (no functional change) Make it obvious which props are "element params" and which props are from "redux". --- ui/component/commentMenuList/view.jsx | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/ui/component/commentMenuList/view.jsx b/ui/component/commentMenuList/view.jsx index e9f59bf4c..54929d4dc 100644 --- a/ui/component/commentMenuList/view.jsx +++ b/ui/component/commentMenuList/view.jsx @@ -8,28 +8,31 @@ import Icon from 'component/common/icon'; import { parseURI } from 'lbry-redux'; type Props = { - claim: ?Claim, - clearPlayingUri: () => void, authorUri: string, // full LBRY Channel URI: lbry://@channel#123... commentId: string, // sha256 digest identifying the comment - commentIsMine: boolean, // if this comment was signed by an owned channel + isTopLevel: boolean, isPinned: boolean, - pinComment: (string, string, boolean) => Promise, - muteChannel: (string) => void, + commentIsMine: boolean, // if this comment was signed by an owned channel + disableEdit?: boolean, + disableRemove?: boolean, + supportAmount?: any, handleEditComment: () => void, + // --- select --- + claim: ?Claim, + claimIsMine: boolean, contentChannelPermanentUrl: any, activeChannelClaim: ?ChannelClaim, - isTopLevel: boolean, + playingUri: ?PlayingUri, + moderationDelegatorsById: { [string]: { global: boolean, delegators: { name: string, claimId: string } } }, + // --- perform --- + openModal: (id: string, {}) => void, + clearPlayingUri: () => void, + muteChannel: (string) => void, + pinComment: (string, string, boolean) => Promise, commentModBlock: (string) => void, commentModBlockAsAdmin: (string, string) => void, commentModBlockAsModerator: (string, string, string) => void, commentModAddDelegate: (string, string, ChannelClaim) => void, - playingUri: ?PlayingUri, - disableEdit?: boolean, - disableRemove?: boolean, - moderationDelegatorsById: { [string]: { global: boolean, delegators: { name: string, claimId: string } } }, - openModal: (id: string, {}) => void, - supportAmount?: any, }; function CommentMenuList(props: Props) { From 3f765e2d9032c9e3f2c5611d8d65a21605ab2f78 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Wed, 25 Aug 2021 13:39:29 +0800 Subject: [PATCH 2/2] Don't show "Moderator Tools" title if there's nothing underneath --- ui/component/commentMenuList/view.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/component/commentMenuList/view.jsx b/ui/component/commentMenuList/view.jsx index 54929d4dc..82624cfb9 100644 --- a/ui/component/commentMenuList/view.jsx +++ b/ui/component/commentMenuList/view.jsx @@ -189,7 +189,7 @@ function CommentMenuList(props: Props) { )} - {(activeChannelIsAdmin || activeChannelIsModerator) && ( + {!commentIsMine && (activeChannelIsAdmin || activeChannelIsModerator) && (
{__('Moderator tools')}
)}