From 96cdf11567d9c97ab83c5c8ac990614348d9242d Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Tue, 28 Jun 2022 13:14:06 +0800 Subject: [PATCH] Fix naming convention and type correctness - Fixed value props being named like a function/selector. - Fixed flow type for membership (should be `?string`). - It might not matter in the current code, but the whole purpose of type checking to catch usage errors in the future. - `hasXXX` indicates a boolean, so it doesn't make sense to force the client to input a string. --- ui/component/comment/index.js | 2 +- ui/component/comment/view.jsx | 10 +++++----- ui/component/common/markdown-preview.jsx | 2 +- ui/component/livestreamComment/view.jsx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/component/comment/index.js b/ui/component/comment/index.js index 2fe2d724e..8e8c85427 100644 --- a/ui/component/comment/index.js +++ b/ui/component/comment/index.js @@ -42,7 +42,7 @@ const select = (state, props) => { stakedLevel: selectStakedLevelForChannelUri(state, channel_url), linkedCommentAncestors: selectFetchedCommentAncestors(state), totalReplyPages: makeSelectTotalReplyPagesForParentId(comment_id)(state), - selectOdyseeMembershipForUri: channel_url && selectOdyseeMembershipForUri(state, channel_url), + commenterMembership: channel_url && selectOdyseeMembershipForUri(state, channel_url), repliesFetching: selectIsFetchingCommentsForParentId(state, comment_id), fetchedReplies: selectRepliesForParentId(state, comment_id), }; diff --git a/ui/component/comment/view.jsx b/ui/component/comment/view.jsx index ebdcc6a07..b9e04fc0f 100644 --- a/ui/component/comment/view.jsx +++ b/ui/component/comment/view.jsx @@ -81,7 +81,7 @@ type Props = { supportDisabled: boolean, setQuickReply: (any) => void, quickReply: any, - selectOdyseeMembershipForUri: string, + commenterMembership: ?string, fetchedReplies: Array, repliesFetching: boolean, threadLevel?: number, @@ -114,7 +114,7 @@ function CommentView(props: Props) { supportDisabled, setQuickReply, quickReply, - selectOdyseeMembershipForUri, + commenterMembership, fetchedReplies, repliesFetching, threadLevel = 0, @@ -316,7 +316,7 @@ function CommentView(props: Props) { )} {isGlobalMod && } {isModerator && } - +