Add note on comment when edited

This commit is contained in:
Tom Moor
2023-04-13 09:17:26 -04:00
parent 094c4486ce
commit 2d354f95fa
2 changed files with 12 additions and 0 deletions

View File

@@ -89,6 +89,7 @@ function CommentThreadItem({
const [data, setData] = React.useState(toJS(comment.data));
const showAuthor = firstOfAuthor;
const showTime = useShowTime(comment.createdAt, previousCommentCreatedAt);
const showEdited = comment.updatedAt !== comment.createdAt;
const [isEditing, setEditing, setReadOnly] = useBoolean();
const formRef = React.useRef<HTMLFormElement>(null);
@@ -158,6 +159,16 @@ function CommentThreadItem({
shorten
/>
)}
{showEdited && (
<>
{" "}
(
<Time dateTime={comment.updatedAt} tooltipDelay={500}>
{t("edited")}
</Time>
)
</>
)}
</Meta>
)}
<Body ref={formRef} onSubmit={handleSubmit}>