2015-06-23 18:41:25 +03:00
|
|
|
/*
|
2016-01-07 07:06:39 +03:00
|
|
|
Copyright 2015, 2016 OpenMarket Ltd
|
2019-12-20 03:45:24 +03:00
|
|
|
Copyright 2019 The Matrix.org Foundation C.I.C.
|
2015-06-23 18:41:25 +03:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2019-09-06 20:37:43 +03:00
|
|
|
import React from 'react';
|
2017-12-26 04:03:18 +03:00
|
|
|
import PropTypes from 'prop-types';
|
2019-12-20 04:19:56 +03:00
|
|
|
import * as TextForEvent from "../../../TextForEvent";
|
2015-11-27 18:02:32 +03:00
|
|
|
|
2020-08-29 14:14:16 +03:00
|
|
|
export default class TextualEvent extends React.Component {
|
|
|
|
static propTypes = {
|
2017-06-01 15:31:24 +03:00
|
|
|
/* the MatrixEvent to show */
|
2017-12-26 04:03:18 +03:00
|
|
|
mxEvent: PropTypes.object.isRequired,
|
2020-08-29 14:14:16 +03:00
|
|
|
};
|
2017-10-11 19:56:17 +03:00
|
|
|
|
2020-08-29 14:14:16 +03:00
|
|
|
render() {
|
2017-10-11 19:56:17 +03:00
|
|
|
const text = TextForEvent.textForEvent(this.props.mxEvent);
|
2016-07-05 07:46:17 +03:00
|
|
|
if (text == null || text.length === 0) return null;
|
2015-11-27 18:02:32 +03:00
|
|
|
return (
|
2019-05-19 17:23:43 +03:00
|
|
|
<div className="mx_TextualEvent">{ text }</div>
|
2015-11-27 18:02:32 +03:00
|
|
|
);
|
2020-08-29 14:14:16 +03:00
|
|
|
}
|
|
|
|
}
|