Override audio and video body with file body

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-07-14 10:47:29 +02:00
parent 04db6beb10
commit 782563af53
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
2 changed files with 12 additions and 4 deletions

View File

@ -21,8 +21,14 @@ limitations under the License.
position: relative;
line-height: $font-16px;
.mx_MFileBody_info {
margin: 5px 0;
.mx_MFileBody {
.mx_MFileBody_info {
margin: 5px 0;
}
.mx_MFileBody_download {
display: none;
}
}
}

View File

@ -27,6 +27,7 @@ import * as sdk from '../../../index';
import { EventType, MsgType } from 'matrix-js-sdk/src/@types/event';
import { replaceableComponent } from '../../../utils/replaceableComponent';
import { getEventDisplayInfo } from '../../../utils/EventUtils';
import MFileBody from "../messages/MFileBody";
interface IProps {
mxEvent: MatrixEvent;
@ -115,8 +116,9 @@ export default class ReplyTile extends React.PureComponent<IProps> {
const msgtypeOverrides = {
[MsgType.Image]: MImageReplyBody,
[MsgType.Audio]: TextualBody,
[MsgType.Video]: TextualBody,
// Override audio and video body with file body. We also hide the download/decrypt button using CSS
[MsgType.Audio]: MFileBody,
[MsgType.Video]: MFileBody,
};
const evOverrides = {
[EventType.Sticker]: TextualBody,