Fix various clipping issues with message buttons
This commit is contained in:
parent
19e700aba3
commit
3534408c97
2 changed files with 22 additions and 16 deletions
|
@ -322,6 +322,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
.module-message__container {
|
.module-message__container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -9269,7 +9270,12 @@ button.module-image__border-overlay:focus {
|
||||||
@media (min-width: 835px) and (max-width: 925px) {
|
@media (min-width: 835px) and (max-width: 925px) {
|
||||||
.module-message {
|
.module-message {
|
||||||
// Add 2px for 1px border
|
// Add 2px for 1px border
|
||||||
max-width: 376px;
|
max-width: 360px;
|
||||||
|
|
||||||
|
&--with-avatar {
|
||||||
|
// Remove 36px from avatar
|
||||||
|
max-width: 324px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spec: container < 438px
|
// Spec: container < 438px
|
||||||
|
|
|
@ -1170,21 +1170,20 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public renderAvatar(): JSX.Element | undefined {
|
public hasAvatar(): boolean {
|
||||||
const {
|
const { collapseMetadata, conversationType, direction } = this.props;
|
||||||
author,
|
|
||||||
collapseMetadata,
|
|
||||||
conversationType,
|
|
||||||
direction,
|
|
||||||
i18n,
|
|
||||||
showContactModal,
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
if (
|
return Boolean(
|
||||||
collapseMetadata ||
|
!collapseMetadata &&
|
||||||
conversationType !== 'group' ||
|
conversationType === 'group' &&
|
||||||
direction === 'outgoing'
|
direction !== 'outgoing'
|
||||||
) {
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public renderAvatar(): JSX.Element | undefined {
|
||||||
|
const { author, i18n, showContactModal } = this.props;
|
||||||
|
|
||||||
|
if (!this.hasAvatar()) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2409,7 +2408,8 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
'module-message',
|
'module-message',
|
||||||
`module-message--${direction}`,
|
`module-message--${direction}`,
|
||||||
isSelected ? 'module-message--selected' : null,
|
isSelected ? 'module-message--selected' : null,
|
||||||
expiring ? 'module-message--expired' : null
|
expiring ? 'module-message--expired' : null,
|
||||||
|
this.hasAvatar() ? 'module-message--with-avatar' : null
|
||||||
)}
|
)}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
// We pretend to be a button because we sometimes contain buttons and a button
|
// We pretend to be a button because we sometimes contain buttons and a button
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue