Message: Hide all actions on context menu (#6341)
This commit is contained in:
parent
091ea45a1a
commit
b086dbda08
@ -87,10 +87,6 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-action-button & {
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--pattern-color);
|
background-color: var(--pattern-color);
|
||||||
backdrop-filter: brightness(115%);
|
backdrop-filter: brightness(115%);
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
import type { FC } from '../../../lib/teact/teact';
|
|
||||||
import type React from '../../../lib/teact/teact';
|
|
||||||
import {
|
import {
|
||||||
memo,
|
memo,
|
||||||
useCallback,
|
useCallback,
|
||||||
@ -345,7 +343,7 @@ const QUICK_REACTION_SIZE = 1.75 * REM;
|
|||||||
const EXTRA_SPACE_FOR_REACTIONS = 2.25 * REM;
|
const EXTRA_SPACE_FOR_REACTIONS = 2.25 * REM;
|
||||||
const MAX_REASON_LENGTH = 200;
|
const MAX_REASON_LENGTH = 200;
|
||||||
|
|
||||||
const Message: FC<OwnProps & StateProps> = ({
|
const Message = ({
|
||||||
message,
|
message,
|
||||||
observeIntersectionForBottom,
|
observeIntersectionForBottom,
|
||||||
observeIntersectionForLoading,
|
observeIntersectionForLoading,
|
||||||
@ -454,7 +452,7 @@ const Message: FC<OwnProps & StateProps> = ({
|
|||||||
minFutureTime,
|
minFutureTime,
|
||||||
webPage,
|
webPage,
|
||||||
onIntersectPinnedMessage,
|
onIntersectPinnedMessage,
|
||||||
}) => {
|
}: OwnProps & StateProps) => {
|
||||||
const {
|
const {
|
||||||
toggleMessageSelection,
|
toggleMessageSelection,
|
||||||
clickBotInlineButton,
|
clickBotInlineButton,
|
||||||
@ -583,7 +581,6 @@ const Message: FC<OwnProps & StateProps> = ({
|
|||||||
!(isContextMenuShown || isInSelectMode || isForwarding)
|
!(isContextMenuShown || isInSelectMode || isForwarding)
|
||||||
&& !isInDocumentGroupNotLast
|
&& !isInDocumentGroupNotLast
|
||||||
&& !isStoryMention
|
&& !isStoryMention
|
||||||
&& !((sticker || hasAnimatedEmoji) && asForwarded)
|
|
||||||
);
|
);
|
||||||
const canForward = isChannel && !isScheduled && message.isForwardingAllowed
|
const canForward = isChannel && !isScheduled && message.isForwardingAllowed
|
||||||
&& !isChatProtected;
|
&& !isChatProtected;
|
||||||
@ -756,7 +753,6 @@ const Message: FC<OwnProps & StateProps> = ({
|
|||||||
isJustAdded && 'is-just-added',
|
isJustAdded && 'is-just-added',
|
||||||
(hasActiveReactions || shouldPlayEffect) && 'has-active-effect',
|
(hasActiveReactions || shouldPlayEffect) && 'has-active-effect',
|
||||||
isStoryMention && 'is-story-mention',
|
isStoryMention && 'is-story-mention',
|
||||||
!canShowActionButton && 'no-action-button',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const text = textMessage && getMessageContent(textMessage).text;
|
const text = textMessage && getMessageContent(textMessage).text;
|
||||||
@ -816,8 +812,8 @@ const Message: FC<OwnProps & StateProps> = ({
|
|||||||
hasThread: hasThread && !noComments,
|
hasThread: hasThread && !noComments,
|
||||||
forceSenderName,
|
forceSenderName,
|
||||||
hasCommentCounter: hasThread && repliesThreadInfo.messagesCount > 0,
|
hasCommentCounter: hasThread && repliesThreadInfo.messagesCount > 0,
|
||||||
hasCommentButton: withCommentButton,
|
hasBottomCommentButton: withCommentButton && !isCustomShape,
|
||||||
hasActionButton: canForward || canFocus,
|
hasActionButton: canForward || canFocus || (withCommentButton && isCustomShape),
|
||||||
hasReactions,
|
hasReactions,
|
||||||
isGeoLiveActive: location?.mediaType === 'geoLive' && !isGeoLiveExpired(message),
|
isGeoLiveActive: location?.mediaType === 'geoLive' && !isGeoLiveExpired(message),
|
||||||
withVoiceTranscription,
|
withVoiceTranscription,
|
||||||
@ -1763,7 +1759,7 @@ const Message: FC<OwnProps & StateProps> = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{withCommentButton && !(canShowActionButton && isCustomShape) && (
|
{withCommentButton && !isCustomShape && (
|
||||||
<CommentButton
|
<CommentButton
|
||||||
threadInfo={repliesThreadInfo}
|
threadInfo={repliesThreadInfo}
|
||||||
disabled={noComments}
|
disabled={noComments}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export function buildContentClassName(
|
|||||||
hasThread,
|
hasThread,
|
||||||
forceSenderName,
|
forceSenderName,
|
||||||
hasCommentCounter,
|
hasCommentCounter,
|
||||||
hasCommentButton,
|
hasBottomCommentButton,
|
||||||
hasActionButton,
|
hasActionButton,
|
||||||
hasReactions,
|
hasReactions,
|
||||||
isGeoLiveActive,
|
isGeoLiveActive,
|
||||||
@ -35,7 +35,7 @@ export function buildContentClassName(
|
|||||||
hasThread?: boolean;
|
hasThread?: boolean;
|
||||||
forceSenderName?: boolean;
|
forceSenderName?: boolean;
|
||||||
hasCommentCounter?: boolean;
|
hasCommentCounter?: boolean;
|
||||||
hasCommentButton?: boolean;
|
hasBottomCommentButton?: boolean;
|
||||||
hasActionButton?: boolean;
|
hasActionButton?: boolean;
|
||||||
hasReactions?: boolean;
|
hasReactions?: boolean;
|
||||||
isGeoLiveActive?: boolean;
|
isGeoLiveActive?: boolean;
|
||||||
@ -202,7 +202,7 @@ export function buildContentClassName(
|
|||||||
classNames.push('has-fact-check');
|
classNames.push('has-fact-check');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLastInGroup && !hasInlineKeyboard && (photo || !isMediaWithNoText || hasCommentButton)) {
|
if (isLastInGroup && !hasInlineKeyboard && (photo || !isMediaWithNoText || hasBottomCommentButton)) {
|
||||||
classNames.push('has-appendix');
|
classNames.push('has-appendix');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user