You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
681 B
JavaScript
40 lines
681 B
JavaScript
'use strict';
|
|
const React = require('react');
|
|
const create = require('create-react-class');
|
|
|
|
let Event = create({
|
|
displayName: "m.text",
|
|
|
|
render: function() {
|
|
let event = this.props.event;
|
|
let formattedEvent = this.props.formattedEvent;
|
|
|
|
let eventBody;
|
|
|
|
if (formattedEvent.html) {
|
|
eventBody = <div
|
|
className="body"
|
|
dangerouslySetInnerHTML={{__html: formattedEvent.body}}
|
|
/>;
|
|
} else {
|
|
eventBody =
|
|
<div className="body">
|
|
{formattedEvent.body}
|
|
</div>;
|
|
}
|
|
|
|
|
|
let eventClass = "";
|
|
if (event.local) {
|
|
eventClass += " local";
|
|
}
|
|
|
|
return <div className={eventClass}>
|
|
{eventBody}
|
|
</div>;
|
|
}
|
|
});
|
|
|
|
|
|
module.exports = Event;
|