Don't apply message bubble visual style to media messages (#7040)
* PSFD-457: Don't apply message bubble visual style to media messages * Match corner rounding for images
This commit is contained in:
parent
5736fea5f3
commit
3f3e4ff674
2 changed files with 53 additions and 9 deletions
|
@ -92,6 +92,10 @@ limitations under the License.
|
||||||
&[data-self=false] {
|
&[data-self=false] {
|
||||||
.mx_EventTile_line {
|
.mx_EventTile_line {
|
||||||
border-bottom-right-radius: var(--cornerRadius);
|
border-bottom-right-radius: var(--cornerRadius);
|
||||||
|
|
||||||
|
.mx_MImageBody .mx_MImageBody_thumbnail {
|
||||||
|
border-bottom-right-radius: var(--cornerRadius);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.mx_EventTile_avatar {
|
.mx_EventTile_avatar {
|
||||||
left: -34px;
|
left: -34px;
|
||||||
|
@ -106,12 +110,16 @@ limitations under the License.
|
||||||
}
|
}
|
||||||
&[data-self=true] {
|
&[data-self=true] {
|
||||||
.mx_EventTile_line {
|
.mx_EventTile_line {
|
||||||
border-bottom-left-radius: var(--cornerRadius);
|
|
||||||
float: right;
|
float: right;
|
||||||
|
border-bottom-left-radius: var(--cornerRadius);
|
||||||
> a {
|
> a {
|
||||||
left: auto;
|
left: auto;
|
||||||
right: -68px;
|
right: -68px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx_MImageBody .mx_MImageBody_thumbnail {
|
||||||
|
border-bottom-left-radius: var(--cornerRadius);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_ThreadInfo {
|
.mx_ThreadInfo {
|
||||||
|
@ -147,33 +155,62 @@ limitations under the License.
|
||||||
|
|
||||||
.mx_EventTile_line {
|
.mx_EventTile_line {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: var(--gutterSize);
|
|
||||||
border-top-left-radius: var(--cornerRadius);
|
|
||||||
border-top-right-radius: var(--cornerRadius);
|
|
||||||
background: var(--backgroundColor);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
margin: 0 -12px 0 -9px;
|
margin: 0 -12px 0 -9px;
|
||||||
|
border-top-left-radius: var(--cornerRadius);
|
||||||
|
border-top-right-radius: var(--cornerRadius);
|
||||||
> a {
|
> a {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: -68px;
|
left: -68px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//noinspection CssReplaceWithShorthandSafely
|
||||||
|
.mx_MImageBody .mx_MImageBody_thumbnail {
|
||||||
|
// Note: This is intentionally not compressed because the browser gets confused
|
||||||
|
// when it is all combined. We're effectively unsetting the border radius then
|
||||||
|
// setting the two corners we care about manually.
|
||||||
|
border-radius: unset;
|
||||||
|
border-top-left-radius: var(--cornerRadius);
|
||||||
|
border-top-right-radius: var(--cornerRadius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mx_EventTile_line:not(.mx_EventTile_mediaLine) {
|
||||||
|
padding: var(--gutterSize);
|
||||||
|
background: var(--backgroundColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.mx_EventTile_continuation[data-self=false] .mx_EventTile_line {
|
&.mx_EventTile_continuation[data-self=false] .mx_EventTile_line {
|
||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
|
|
||||||
|
.mx_MImageBody .mx_MImageBody_thumbnail {
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.mx_EventTile_lastInSection[data-self=false] .mx_EventTile_line {
|
&.mx_EventTile_lastInSection[data-self=false] .mx_EventTile_line {
|
||||||
border-bottom-left-radius: var(--cornerRadius);
|
border-bottom-left-radius: var(--cornerRadius);
|
||||||
|
|
||||||
|
.mx_MImageBody .mx_MImageBody_thumbnail {
|
||||||
|
border-bottom-left-radius: var(--cornerRadius);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.mx_EventTile_continuation[data-self=true] .mx_EventTile_line {
|
&.mx_EventTile_continuation[data-self=true] .mx_EventTile_line {
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
|
|
||||||
|
.mx_MImageBody .mx_MImageBody_thumbnail {
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.mx_EventTile_lastInSection[data-self=true] .mx_EventTile_line {
|
&.mx_EventTile_lastInSection[data-self=true] .mx_EventTile_line {
|
||||||
border-bottom-right-radius: var(--cornerRadius);
|
border-bottom-right-radius: var(--cornerRadius);
|
||||||
|
|
||||||
|
.mx_MImageBody .mx_MImageBody_thumbnail {
|
||||||
|
border-bottom-right-radius: var(--cornerRadius);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_EventTile_avatar {
|
.mx_EventTile_avatar {
|
||||||
|
|
|
@ -63,6 +63,7 @@ import { MessagePreviewStore } from '../../../stores/room-list/MessagePreviewSto
|
||||||
|
|
||||||
import { logger } from "matrix-js-sdk/src/logger";
|
import { logger } from "matrix-js-sdk/src/logger";
|
||||||
import { TimelineRenderingType } from "../../../contexts/RoomContext";
|
import { TimelineRenderingType } from "../../../contexts/RoomContext";
|
||||||
|
import { MediaEventHelper } from "../../../utils/MediaEventHelper";
|
||||||
|
|
||||||
const eventTileTypes = {
|
const eventTileTypes = {
|
||||||
[EventType.RoomMessage]: 'messages.MessageEvent',
|
[EventType.RoomMessage]: 'messages.MessageEvent',
|
||||||
|
@ -994,6 +995,12 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const EventTileType = sdk.getComponent(tileHandler);
|
const EventTileType = sdk.getComponent(tileHandler);
|
||||||
|
const isProbablyMedia = MediaEventHelper.isEligible(this.props.mxEvent);
|
||||||
|
|
||||||
|
const lineClasses = classNames({
|
||||||
|
mx_EventTile_line: true,
|
||||||
|
mx_EventTile_mediaLine: isProbablyMedia,
|
||||||
|
});
|
||||||
|
|
||||||
const isSending = (['sending', 'queued', 'encrypting'].indexOf(this.props.eventSendStatus) !== -1);
|
const isSending = (['sending', 'queued', 'encrypting'].indexOf(this.props.eventSendStatus) !== -1);
|
||||||
const isRedacted = isMessageEvent(this.props.mxEvent) && this.props.isRedacted;
|
const isRedacted = isMessageEvent(this.props.mxEvent) && this.props.isRedacted;
|
||||||
|
@ -1209,7 +1216,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
{ timestamp }
|
{ timestamp }
|
||||||
</a>
|
</a>
|
||||||
</div>,
|
</div>,
|
||||||
<div className="mx_EventTile_line" key="mx_EventTile_line">
|
<div className={lineClasses} key="mx_EventTile_line">
|
||||||
<EventTileType ref={this.tile}
|
<EventTileType ref={this.tile}
|
||||||
mxEvent={this.props.mxEvent}
|
mxEvent={this.props.mxEvent}
|
||||||
highlights={this.props.highlights}
|
highlights={this.props.highlights}
|
||||||
|
@ -1257,7 +1264,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
{ timestamp }
|
{ timestamp }
|
||||||
</a>
|
</a>
|
||||||
</div>,
|
</div>,
|
||||||
<div className="mx_EventTile_line" key="mx_EventTile_line">
|
<div className={lineClasses} key="mx_EventTile_line">
|
||||||
{ replyChain }
|
{ replyChain }
|
||||||
<EventTileType ref={this.tile}
|
<EventTileType ref={this.tile}
|
||||||
mxEvent={this.props.mxEvent}
|
mxEvent={this.props.mxEvent}
|
||||||
|
@ -1281,7 +1288,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
"aria-atomic": true,
|
"aria-atomic": true,
|
||||||
"data-scroll-tokens": scrollToken,
|
"data-scroll-tokens": scrollToken,
|
||||||
}, [
|
}, [
|
||||||
<div className="mx_EventTile_line" key="mx_EventTile_line">
|
<div className={lineClasses} key="mx_EventTile_line">
|
||||||
<EventTileType ref={this.tile}
|
<EventTileType ref={this.tile}
|
||||||
mxEvent={this.props.mxEvent}
|
mxEvent={this.props.mxEvent}
|
||||||
highlights={this.props.highlights}
|
highlights={this.props.highlights}
|
||||||
|
@ -1341,7 +1348,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
{ sender }
|
{ sender }
|
||||||
{ ircPadlock }
|
{ ircPadlock }
|
||||||
{ avatar }
|
{ avatar }
|
||||||
<div className="mx_EventTile_line" key="mx_EventTile_line">
|
<div className={lineClasses} key="mx_EventTile_line">
|
||||||
{ groupTimestamp }
|
{ groupTimestamp }
|
||||||
{ groupPadlock }
|
{ groupPadlock }
|
||||||
{ replyChain }
|
{ replyChain }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue