feat(post): add tooltip to comment edit timestamp

This commit is contained in:
Tom (plebeius.eth)
2024-07-07 14:49:17 +02:00
parent ff72365151
commit e716a45a31
37 changed files with 42 additions and 37 deletions
@@ -236,7 +236,7 @@ const PostPageStats = () => {
<span>
{(pinned || isInDescriptionView || isInRulesView) && 'Sticky / '}
{(closed || isInDescriptionView || isInRulesView) && 'Closed / '}
<Tooltip children={replyCount.toString()} content='Replies' /> / <Tooltip children={linkCount.toString()} content='Links' />
<Tooltip children={replyCount?.toString()} content='Replies' /> / <Tooltip children={linkCount?.toString()} content='Links' />
</span>
);
};
+6 -1
View File
@@ -257,7 +257,12 @@ const PostMessage = ({ post }: PostProps) => {
<span className={styles.editedInfo}>
{showOriginal && <Markdown content={original?.content} />}
<br />
{t('comment_edited_at_timestamp', { timestamp: getFormattedDate(edit?.timestamp), interpolation: { escapeValue: false } })}{' '}
<Trans
i18nKey={'comment_edited_at_timestamp'}
values={{ timestamp: getFormattedDate(edit?.timestamp) }}
shouldUnescape={true}
components={{ 1: <Tooltip content={getFormattedTimeAgo(edit?.timestamp)} children={<></>} /> }}
/>{' '}
{reason && <>{t('reason_reason', { reason: reason, interpolation: { escapeValue: false } })} </>}
{showOriginal ? (
<Trans