fix(post): permalink (c/) of pending reply shouldn't link to anything

This commit is contained in:
Tom (plebeius.eth)
2024-07-16 13:20:24 +02:00
parent 01dacc8270
commit 3ddf26c930
2 changed files with 26 additions and 16 deletions
+8 -3
View File
@@ -128,15 +128,20 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }:
)}
{!(isDescription || isRules) && (
<span className={styles.postNumLink}>
{cid ? (
<>
<Link to={`/p/${subplebbitAddress}/c/${cid}`} className={styles.linkToPost} title={t('link_to_post')} onClick={(e) => !cid && e.preventDefault()}>
c/
</Link>
{!cid ? (
<span className={styles.pendingCid}>{state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'}</span>
) : (
<span className={styles.replyToPost} title={t('reply_to_post')} onMouseDown={() => openReplyModal && openReplyModal(cid)}>
{shortCid}
</span>
</>
) : (
<>
<span style={{ cursor: 'pointer' }}>c/</span>
<span className={styles.pendingCid}>{state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'}</span>
</>
)}
</span>
)}
+8 -3
View File
@@ -118,15 +118,20 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P
<Tooltip children={<span>{getFormattedDate(timestamp)}</span>} content={getFormattedTimeAgo(timestamp)} />{' '}
{!(isDescription || isRules) && (
<span className={styles.postNumLink}>
{cid ? (
<>
<Link to={`/p/${subplebbitAddress}/c/${cid}`} className={styles.linkToPost} title={t('link_to_post')} onClick={(e) => !cid && e.preventDefault()}>
c/
</Link>
{!cid ? (
<span className={styles.pendingCid}>{state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'}</span>
) : (
<span className={styles.replyToPost} title={t('reply_to_post')} onMouseDown={() => openReplyModal && openReplyModal(cid)}>
{shortCid}
</span>
</>
) : (
<>
<span style={{ cursor: 'pointer' }}>c/</span>
<span className={styles.pendingCid}>{state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'}</span>
</>
)}
</span>
)}