mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-15 10:11:38 +03:00
Show timestamp of redaction on hover
Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
parent
7ff850deea
commit
b0be99a8f0
2 changed files with 8 additions and 1 deletions
|
@ -19,6 +19,8 @@ import {MatrixClient} from "matrix-js-sdk/src/client";
|
||||||
import {MatrixEvent} from "matrix-js-sdk/src/models/event";
|
import {MatrixEvent} from "matrix-js-sdk/src/models/event";
|
||||||
import { _t } from "../../../languageHandler";
|
import { _t } from "../../../languageHandler";
|
||||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||||
|
import {formatFullDate} from "../../../DateUtils";
|
||||||
|
import SettingsStore from "../../../settings/SettingsStore";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
mxEvent: MatrixEvent;
|
mxEvent: MatrixEvent;
|
||||||
|
@ -36,8 +38,12 @@ const RedactedBody = React.forwardRef<any, IProps>(({mxEvent}, ref) => {
|
||||||
text = _t("Message deleted by %(name)s", { name: sender ? sender.name : redactedBecauseUserId });
|
text = _t("Message deleted by %(name)s", { name: sender ? sender.name : redactedBecauseUserId });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const showTwelveHour = SettingsStore.getValue("showTwelveHourTimestamps");
|
||||||
|
const fullDate = formatFullDate(new Date(unsigned.redacted_because.origin_server_ts), showTwelveHour);
|
||||||
|
const titleText = _t("Message deleted on %(date)s", { date: fullDate });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span className="mx_RedactedBody" ref={ref}>
|
<span className="mx_RedactedBody" ref={ref} title={titleText}>
|
||||||
{ text }
|
{ text }
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1352,6 +1352,7 @@
|
||||||
"<reactors/><reactedWith>reacted with %(shortName)s</reactedWith>": "<reactors/><reactedWith>reacted with %(shortName)s</reactedWith>",
|
"<reactors/><reactedWith>reacted with %(shortName)s</reactedWith>": "<reactors/><reactedWith>reacted with %(shortName)s</reactedWith>",
|
||||||
"Message deleted": "Message deleted",
|
"Message deleted": "Message deleted",
|
||||||
"Message deleted by %(name)s": "Message deleted by %(name)s",
|
"Message deleted by %(name)s": "Message deleted by %(name)s",
|
||||||
|
"Message deleted on %(date)s": "Message deleted on %(date)s",
|
||||||
"%(senderDisplayName)s changed the avatar for %(roomName)s": "%(senderDisplayName)s changed the avatar for %(roomName)s",
|
"%(senderDisplayName)s changed the avatar for %(roomName)s": "%(senderDisplayName)s changed the avatar for %(roomName)s",
|
||||||
"%(senderDisplayName)s removed the room avatar.": "%(senderDisplayName)s removed the room avatar.",
|
"%(senderDisplayName)s removed the room avatar.": "%(senderDisplayName)s removed the room avatar.",
|
||||||
"%(senderDisplayName)s changed the room avatar to <img/>": "%(senderDisplayName)s changed the room avatar to <img/>",
|
"%(senderDisplayName)s changed the room avatar to <img/>": "%(senderDisplayName)s changed the room avatar to <img/>",
|
||||||
|
|
Loading…
Reference in a new issue