Files
ThreadNet-Web/src/components/views/messages/TextualEvent.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
1.0 KiB
TypeScript
Raw Normal View History

/*
2024-09-09 14:57:16 +01:00
Copyright 2024 New Vector Ltd.
Copyright 2015-2021 The Matrix.org Foundation C.I.C.
2024-09-09 14:57:16 +01:00
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
import React from "react";
import { MatrixEvent } from "matrix-js-sdk/src/matrix";
import RoomContext from "../../../contexts/RoomContext";
2019-12-19 18:19:56 -07:00
import * as TextForEvent from "../../../TextForEvent";
import { MatrixClientPeg } from "../../../MatrixClientPeg";
interface IProps {
mxEvent: MatrixEvent;
}
2015-09-16 16:23:35 +01:00
export default class TextualEvent extends React.Component<IProps> {
public static contextType = RoomContext;
2024-08-05 08:59:27 +01:00
public declare context: React.ContextType<typeof RoomContext>;
public render(): React.ReactNode {
const text = TextForEvent.textForEvent(
this.props.mxEvent,
MatrixClientPeg.safeGet(),
true,
this.context?.showHiddenEvents,
);
2021-06-29 22:42:46 -04:00
if (!text) return null;
return <div className="mx_TextualEvent">{text}</div>;
2020-08-29 12:14:16 +01:00
}
}