fix key warning

This commit is contained in:
Tom (plebeius.eth)
2025-03-05 18:30:41 +01:00
parent 9013cb02fe
commit 42e21c8ee9
2 changed files with 13 additions and 6 deletions
@@ -75,7 +75,7 @@ const CommentContent = ({ comment: post, replies }: { comment: Comment; replies:
<span className={styles.abbr}> <span className={styles.abbr}>
<br /> <br />
<br /> <br />
<Trans i18nKey={'comment_too_long'} shouldUnescape={true} components={{ 1: <span onClick={() => setShowFullComment(true)} /> }} /> <Trans i18nKey={'comment_too_long'} shouldUnescape={true} components={{ 1: <span key={cid} onClick={() => setShowFullComment(true)} /> }} />
</span> </span>
)} )}
{edit && original?.content !== content && ( {edit && original?.content !== content && (
@@ -87,20 +87,22 @@ const CommentContent = ({ comment: post, replies }: { comment: Comment; replies:
i18nKey={'comment_edited_at_timestamp'} i18nKey={'comment_edited_at_timestamp'}
values={{ timestamp: getFormattedDate(edit?.timestamp) }} values={{ timestamp: getFormattedDate(edit?.timestamp) }}
shouldUnescape={true} shouldUnescape={true}
components={{ 1: <Tooltip content={getFormattedTimeAgo(edit?.timestamp)} children={<Fragment key={edit?.timestamp}></Fragment>} /> }} components={{
1: <Tooltip key={edit?.timestamp} content={getFormattedTimeAgo(edit?.timestamp)} children={<Fragment key={edit?.timestamp}></Fragment>} />,
}}
/>{' '} />{' '}
{reason && <>{t('reason_reason', { reason: reason, interpolation: { escapeValue: false } })} </>} {reason && <>{t('reason_reason', { reason: reason, interpolation: { escapeValue: false } })} </>}
{showOriginal ? ( {showOriginal ? (
<Trans <Trans
i18nKey={'click_here_to_hide_original'} i18nKey={'click_here_to_hide_original'}
shouldUnescape={true} shouldUnescape={true}
components={{ 1: <span className={styles.showOriginal} onClick={() => setShowOriginal(!showOriginal)} /> }} components={{ 1: <span key={cid} className={styles.showOriginal} onClick={() => setShowOriginal(!showOriginal)} /> }}
/> />
) : ( ) : (
<Trans <Trans
i18nKey={'click_here_to_show_original'} i18nKey={'click_here_to_show_original'}
shouldUnescape={true} shouldUnescape={true}
components={{ 1: <span className={styles.showOriginal} onClick={() => setShowOriginal(!showOriginal)} /> }} components={{ 1: <span key={cid} className={styles.showOriginal} onClick={() => setShowOriginal(!showOriginal)} /> }}
/> />
)} )}
</span> </span>
+7 -2
View File
@@ -433,11 +433,16 @@ const PostDesktop = ({ post, roles, showAllReplies, showReplies = true, replies:
<Trans <Trans
i18nKey={'replies_and_links_omitted'} i18nKey={'replies_and_links_omitted'}
shouldUnescape={true} shouldUnescape={true}
components={{ 1: <Link to={`/p/${subplebbitAddress}/c/${cid}`} /> }} components={{ 1: <Link key={cid} to={`/p/${subplebbitAddress}/c/${cid}`} /> }}
values={{ repliesCount, linksCount }} values={{ repliesCount, linksCount }}
/> />
) : ( ) : (
<Trans i18nKey={'replies_omitted'} shouldUnescape={true} components={{ 1: <Link to={`/p/${subplebbitAddress}/c/${cid}`} /> }} values={{ repliesCount }} /> <Trans
i18nKey={'replies_omitted'}
shouldUnescape={true}
components={{ 1: <Link key={cid} to={`/p/${subplebbitAddress}/c/${cid}`} /> }}
values={{ repliesCount }}
/>
)} )}
</span> </span>
)} )}