Merge pull request #6200 from matrix-org/gsouquet/fix-17632

This commit is contained in:
Germain 2021-06-16 10:21:02 +01:00 committed by GitHub
commit 40d384d9f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions

View file

@ -701,6 +701,7 @@ export default class RoomView extends React.Component<IProps, IState> {
room_id: this.state.room.roomId, room_id: this.state.room.roomId,
event_id: this.state.initialEventId, event_id: this.state.initialEventId,
highlighted: false, highlighted: false,
replyingToEvent: this.state.replyToEvent,
}); });
} }
} }

View file

@ -16,20 +16,19 @@ limitations under the License.
*/ */
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import { formatFullDate, formatTime, formatFullTime } from '../../../DateUtils'; import { formatFullDate, formatTime, formatFullTime } from '../../../DateUtils';
import { replaceableComponent } from "../../../utils/replaceableComponent"; import { replaceableComponent } from "../../../utils/replaceableComponent";
@replaceableComponent("views.messages.MessageTimestamp") interface IProps {
export default class MessageTimestamp extends React.Component { ts: number;
static propTypes = { showTwelveHour?: boolean;
ts: PropTypes.number.isRequired, showFullDate?: boolean;
showTwelveHour: PropTypes.bool, showSeconds?: boolean;
showFullDate: PropTypes.bool, }
showSeconds: PropTypes.bool,
};
render() { @replaceableComponent("views.messages.MessageTimestamp")
export default class MessageTimestamp extends React.Component<IProps> {
public render() {
const date = new Date(this.props.ts); const date = new Date(this.props.ts);
let timestamp; let timestamp;
if (this.props.showFullDate) { if (this.props.showFullDate) {
@ -41,7 +40,11 @@ export default class MessageTimestamp extends React.Component {
} }
return ( return (
<span className="mx_MessageTimestamp" title={formatFullDate(date, this.props.showTwelveHour)} aria-hidden={true}> <span
className="mx_MessageTimestamp"
title={formatFullDate(date, this.props.showTwelveHour)}
aria-hidden={true}
>
{timestamp} {timestamp}
</span> </span>
); );