Improve layout of various message bubbles

This commit is contained in:
Scott Nonnenberg 2022-04-07 09:58:15 -07:00 committed by GitHub
parent 933c07c9ce
commit b50c96c0b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 166 additions and 25 deletions

View file

@ -548,6 +548,7 @@ export class Message extends React.PureComponent<Props, State> {
private getMetadataPlacement(
{
attachments,
deletedForEveryone,
expirationLength,
expirationTimestamp,
shouldHideMetadata,
@ -567,7 +568,7 @@ export class Message extends React.PureComponent<Props, State> {
return MetadataPlacement.NotRendered;
}
if (!text) {
if (!text && !deletedForEveryone) {
return isAudio(attachments)
? MetadataPlacement.RenderedByMessageAudioComponent
: MetadataPlacement.Bottom;
@ -598,7 +599,9 @@ export class Message extends React.PureComponent<Props, State> {
let result = GUESS_METADATA_WIDTH_TIMESTAMP_SIZE;
const hasExpireTimer = Boolean(expirationLength && expirationTimestamp);
const hasExpireTimer = Boolean(
expirationLength && (expirationTimestamp || direction === 'outgoing')
);
if (hasExpireTimer) {
result += GUESS_METADATA_WIDTH_EXPIRE_TIMER_SIZE;
}
@ -1464,6 +1467,9 @@ export class Message extends React.PureComponent<Props, State> {
`module-message__text--${direction}`,
status === 'error' && direction === 'incoming'
? 'module-message__text--error'
: null,
deletedForEveryone
? 'module-message__text--delete-for-everyone'
: null
)}
dir={isRTL ? 'rtl' : undefined}