Avatar: Fix channel avatar animation (#6058)
This commit is contained in:
parent
f32d327622
commit
22fc02abbb
@ -218,20 +218,13 @@
|
|||||||
|
|
||||||
transition: transform 0.2s ease, opacity 0.2s ease;
|
transition: transform 0.2s ease, opacity 0.2s ease;
|
||||||
|
|
||||||
&.transition-circle {
|
|
||||||
transition: transform 0.2s ease, opacity 0.2s ease, border-radius 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.rounded-corners {
|
&.rounded-corners {
|
||||||
border-radius: var(--border-radius-messages);
|
border-radius: var(--border-radius-messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.circle {
|
&.circle {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
transition: transform 0.2s ease, opacity 0.2s ease, border-radius 0.2s ease;
|
||||||
|
|
||||||
body.is-ios & {
|
|
||||||
transition: transform 0.2s ease, opacity 0.2s ease, border-radius 0.2s ease !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
img,
|
img,
|
||||||
|
|||||||
@ -172,11 +172,13 @@ const MediaViewerContent = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const textParts = textMessage && (textMessage.content.action?.type === 'suggestProfilePhoto'
|
const textParts = textMessage && (
|
||||||
? lang('Conversation.SuggestedPhotoTitle')
|
textMessage.content.action
|
||||||
: renderMessageText({
|
? (textMessage.content.action.type === 'suggestProfilePhoto'
|
||||||
message: textMessage, maxTimestamp, threadId, forcePlayback: true, isForMediaViewer: true,
|
? lang('Conversation.SuggestedPhotoTitle') : undefined)
|
||||||
}));
|
: renderMessageText({
|
||||||
|
message: textMessage, maxTimestamp, threadId, forcePlayback: true, isForMediaViewer: true,
|
||||||
|
}));
|
||||||
const buttonText = textMessage && 'buttonText' in textMessage ? textMessage.buttonText : undefined;
|
const buttonText = textMessage && 'buttonText' in textMessage ? textMessage.buttonText : undefined;
|
||||||
const hasFooter = Boolean(textParts);
|
const hasFooter = Boolean(textParts);
|
||||||
const posterSize = calculateMediaViewerDimensions(dimensions!, hasFooter, isVideo);
|
const posterSize = calculateMediaViewerDimensions(dimensions!, hasFooter, isVideo);
|
||||||
|
|||||||
@ -371,7 +371,6 @@ function applyShape(ghost: HTMLDivElement, origin: MediaViewerOrigin) {
|
|||||||
case MediaViewerOrigin.ScheduledInline:
|
case MediaViewerOrigin.ScheduledInline:
|
||||||
case MediaViewerOrigin.StarsTransaction:
|
case MediaViewerOrigin.StarsTransaction:
|
||||||
case MediaViewerOrigin.PreviewMedia:
|
case MediaViewerOrigin.PreviewMedia:
|
||||||
case MediaViewerOrigin.ChannelAvatar:
|
|
||||||
ghost.classList.add('rounded-corners');
|
ghost.classList.add('rounded-corners');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -384,10 +383,8 @@ function applyShape(ghost: HTMLDivElement, origin: MediaViewerOrigin) {
|
|||||||
|
|
||||||
case MediaViewerOrigin.MiddleHeaderAvatar:
|
case MediaViewerOrigin.MiddleHeaderAvatar:
|
||||||
case MediaViewerOrigin.SuggestedAvatar:
|
case MediaViewerOrigin.SuggestedAvatar:
|
||||||
|
case MediaViewerOrigin.ChannelAvatar:
|
||||||
ghost.classList.add('circle');
|
ghost.classList.add('circle');
|
||||||
if (origin === MediaViewerOrigin.SuggestedAvatar) {
|
|
||||||
ghost.classList.add('transition-circle');
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -569,7 +569,7 @@ export function selectThreadIdFromMessage<T extends GlobalState>(global: T, mess
|
|||||||
const chat = selectChat(global, message.chatId);
|
const chat = selectChat(global, message.chatId);
|
||||||
const { content } = message;
|
const { content } = message;
|
||||||
const { replyToMsgId, replyToTopId, isForumTopic } = getMessageReplyInfo(message) || {};
|
const { replyToMsgId, replyToTopId, isForumTopic } = getMessageReplyInfo(message) || {};
|
||||||
if ('action' in content && content.action?.type === 'topicCreate') {
|
if (content.action?.type === 'topicCreate') {
|
||||||
return message.id;
|
return message.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user