Give audio and video replies an icon

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-07-15 15:17:41 +02:00
parent 68640a4dbd
commit 88da0f4dcf
No known key found for this signature in database
GPG key ID: 9760693FDD98A790
2 changed files with 12 additions and 2 deletions

View file

@ -21,6 +21,14 @@ limitations under the License.
position: relative; position: relative;
line-height: $font-16px; line-height: $font-16px;
&.mx_ReplyTile_audio .mx_MFileBody_info_icon::before {
mask-image: url("$(res)/img/element-icons/speaker.svg");
}
&.mx_ReplyTile_video .mx_MFileBody_info_icon::before {
mask-image: url("$(res)/img/element-icons/call/video-call.svg");
}
.mx_MFileBody { .mx_MFileBody {
.mx_MFileBody_info { .mx_MFileBody_info {
margin: 5px 0; margin: 5px 0;

View file

@ -80,7 +80,7 @@ export default class ReplyTile extends React.PureComponent<IProps> {
render() { render() {
const mxEvent = this.props.mxEvent; const mxEvent = this.props.mxEvent;
const msgtype = mxEvent.getContent().msgtype; const msgType = mxEvent.getContent().msgtype;
const evType = mxEvent.getType() as EventType; const evType = mxEvent.getType() as EventType;
const { tileHandler, isInfoMessage } = getEventDisplayInfo(this.props.mxEvent); const { tileHandler, isInfoMessage } = getEventDisplayInfo(this.props.mxEvent);
@ -98,6 +98,8 @@ export default class ReplyTile extends React.PureComponent<IProps> {
const classes = classNames("mx_ReplyTile", { const classes = classNames("mx_ReplyTile", {
mx_ReplyTile_info: isInfoMessage && !this.props.mxEvent.isRedacted(), mx_ReplyTile_info: isInfoMessage && !this.props.mxEvent.isRedacted(),
mx_ReplyTile_audio: msgType === MsgType.Audio,
mx_ReplyTile_video: msgType === MsgType.Video,
}); });
let permalink = "#"; let permalink = "#";
@ -108,7 +110,7 @@ export default class ReplyTile extends React.PureComponent<IProps> {
let sender; let sender;
const needsSenderProfile = ( const needsSenderProfile = (
!isInfoMessage && !isInfoMessage &&
msgtype !== MsgType.Image && msgType !== MsgType.Image &&
tileHandler !== EventType.RoomCreate && tileHandler !== EventType.RoomCreate &&
evType !== EventType.Sticker evType !== EventType.Sticker
); );