Message: Hide all actions on context menu (#6341)

This commit is contained in:
zubiden 2025-10-08 12:33:51 +02:00 committed by Alexander Zinchuk
parent 091ea45a1a
commit b086dbda08
3 changed files with 8 additions and 16 deletions

View File

@ -87,10 +87,6 @@
text-align: center;
}
.no-action-button & {
bottom: 0;
}
&:hover {
background-color: var(--pattern-color);
backdrop-filter: brightness(115%);

View File

@ -1,5 +1,3 @@
import type { FC } from '../../../lib/teact/teact';
import type React from '../../../lib/teact/teact';
import {
memo,
useCallback,
@ -345,7 +343,7 @@ const QUICK_REACTION_SIZE = 1.75 * REM;
const EXTRA_SPACE_FOR_REACTIONS = 2.25 * REM;
const MAX_REASON_LENGTH = 200;
const Message: FC<OwnProps & StateProps> = ({
const Message = ({
message,
observeIntersectionForBottom,
observeIntersectionForLoading,
@ -454,7 +452,7 @@ const Message: FC<OwnProps & StateProps> = ({
minFutureTime,
webPage,
onIntersectPinnedMessage,
}) => {
}: OwnProps & StateProps) => {
const {
toggleMessageSelection,
clickBotInlineButton,
@ -583,7 +581,6 @@ const Message: FC<OwnProps & StateProps> = ({
!(isContextMenuShown || isInSelectMode || isForwarding)
&& !isInDocumentGroupNotLast
&& !isStoryMention
&& !((sticker || hasAnimatedEmoji) && asForwarded)
);
const canForward = isChannel && !isScheduled && message.isForwardingAllowed
&& !isChatProtected;
@ -756,7 +753,6 @@ const Message: FC<OwnProps & StateProps> = ({
isJustAdded && 'is-just-added',
(hasActiveReactions || shouldPlayEffect) && 'has-active-effect',
isStoryMention && 'is-story-mention',
!canShowActionButton && 'no-action-button',
);
const text = textMessage && getMessageContent(textMessage).text;
@ -816,8 +812,8 @@ const Message: FC<OwnProps & StateProps> = ({
hasThread: hasThread && !noComments,
forceSenderName,
hasCommentCounter: hasThread && repliesThreadInfo.messagesCount > 0,
hasCommentButton: withCommentButton,
hasActionButton: canForward || canFocus,
hasBottomCommentButton: withCommentButton && !isCustomShape,
hasActionButton: canForward || canFocus || (withCommentButton && isCustomShape),
hasReactions,
isGeoLiveActive: location?.mediaType === 'geoLive' && !isGeoLiveExpired(message),
withVoiceTranscription,
@ -1763,7 +1759,7 @@ const Message: FC<OwnProps & StateProps> = ({
)}
</div>
)}
{withCommentButton && !(canShowActionButton && isCustomShape) && (
{withCommentButton && !isCustomShape && (
<CommentButton
threadInfo={repliesThreadInfo}
disabled={noComments}

View File

@ -18,7 +18,7 @@ export function buildContentClassName(
hasThread,
forceSenderName,
hasCommentCounter,
hasCommentButton,
hasBottomCommentButton,
hasActionButton,
hasReactions,
isGeoLiveActive,
@ -35,7 +35,7 @@ export function buildContentClassName(
hasThread?: boolean;
forceSenderName?: boolean;
hasCommentCounter?: boolean;
hasCommentButton?: boolean;
hasBottomCommentButton?: boolean;
hasActionButton?: boolean;
hasReactions?: boolean;
isGeoLiveActive?: boolean;
@ -202,7 +202,7 @@ export function buildContentClassName(
classNames.push('has-fact-check');
}
if (isLastInGroup && !hasInlineKeyboard && (photo || !isMediaWithNoText || hasCommentButton)) {
if (isLastInGroup && !hasInlineKeyboard && (photo || !isMediaWithNoText || hasBottomCommentButton)) {
classNames.push('has-appendix');
}
}