Display relative time in thread panel event tile (#7068)

* Null-guard for missing root event in thread panel

* Add formatRelativeTime date utility

* Display relative time format in thread panel event tiles
This commit is contained in:
Germain 2021-11-03 10:16:50 +00:00 committed by GitHub
parent 801eb068d6
commit 2a20d9a7df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 76 additions and 5 deletions

View file

@ -1132,7 +1132,11 @@ export default class EventTile extends React.Component<IProps, IState> {
|| this.state.actionBarFocused);
const timestamp = showTimestamp ?
<MessageTimestamp showTwelveHour={this.props.isTwelveHour} ts={this.props.mxEvent.getTs()} /> : null;
<MessageTimestamp
showRelative={this.props.tileShape === TileShape.ThreadPanel}
showTwelveHour={this.props.isTwelveHour}
ts={this.props.mxEvent.getTs()}
/> : null;
const keyRequestHelpText =
<div className="mx_EventTile_keyRequestInfo_tooltip_contents">