Comment: add hideContextMenu + hide reply button too when hideActions is set

This commit is contained in:
infinite-persistence 2022-07-12 14:02:27 +08:00 committed by infinite-persistence
parent 8aa6a60acf
commit ed0fb59983

View file

@ -70,6 +70,7 @@ type Props = {
doToast: ({ message: string }) => void, doToast: ({ message: string }) => void,
isTopLevel?: boolean, isTopLevel?: boolean,
hideActions?: boolean, hideActions?: boolean,
hideContextMenu?: boolean,
othersReacts: ?{ othersReacts: ?{
like: number, like: number,
dislike: number, dislike: number,
@ -106,6 +107,7 @@ function CommentView(props: Props) {
doToast, doToast,
isTopLevel, isTopLevel,
hideActions, hideActions,
hideContextMenu,
othersReacts, othersReacts,
playingUri, playingUri,
stakedLevel, stakedLevel,
@ -331,24 +333,26 @@ function CommentView(props: Props) {
</span> </span>
)} )}
</div> </div>
<div className="comment__menu"> {!hideContextMenu && (
<Menu> <div className="comment__menu">
<MenuButton className="menu__button"> <Menu>
<Icon size={18} icon={ICONS.MORE_VERTICAL} /> <MenuButton className="menu__button">
</MenuButton> <Icon size={18} icon={ICONS.MORE_VERTICAL} />
<CommentMenuList </MenuButton>
uri={uri} <CommentMenuList
isTopLevel={isTopLevel} uri={uri}
isPinned={isPinned} isTopLevel={isTopLevel}
commentId={commentId} isPinned={isPinned}
authorUri={authorUri} commentId={commentId}
commentIsMine={commentIsMine} authorUri={authorUri}
handleEditComment={handleEditComment} commentIsMine={commentIsMine}
supportAmount={supportAmount} handleEditComment={handleEditComment}
setQuickReply={setQuickReply} supportAmount={supportAmount}
/> setQuickReply={setQuickReply}
</Menu> />
</div> </Menu>
</div>
)}
</div> </div>
<div> <div>
{isEditing ? ( {isEditing ? (
@ -417,7 +421,8 @@ function CommentView(props: Props) {
<Spinner text={numDirectReplies > 1 ? __('Loading Replies') : __('Loading Reply')} type="small" /> <Spinner text={numDirectReplies > 1 ? __('Loading Replies') : __('Loading Reply')} type="small" />
</span> </span>
) : ( ) : (
numDirectReplies > 0 && ( numDirectReplies > 0 &&
!hideActions && (
<div className="comment__actions"> <div className="comment__actions">
{!showReplies ? ( {!showReplies ? (
openNewThread ? ( openNewThread ? (