From 74ddae0ed7a9fc9b1724355d076dbdb13107c861 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Thu, 29 Aug 2024 12:56:09 +0200 Subject: [PATCH] fix(post): "c/" was clickable while post is pending --- src/components/post-desktop/post-desktop.tsx | 35 +++++++++----------- src/components/post-mobile/post-mobile.tsx | 35 +++++++++----------- 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index 633b1902..f35f2fe1 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -153,25 +153,22 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: p/{subplebbitAddress && Plebbit.getShortAddress(subplebbitAddress)}{' '} )} - {!(isDescription || isRules) && ( - - {cid ? ( - <> - !cid && e.preventDefault()}> - c/ - - openReplyModal && openReplyModal(cid, postCid, subplebbitAddress)}> - {shortCid} - - - ) : ( - <> - c/ - {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} - - )} - - )} + {!(isDescription || isRules) && + (cid ? ( + + !cid && e.preventDefault()}> + c/ + + openReplyModal && openReplyModal(cid, postCid, subplebbitAddress)}> + {shortCid} + + + ) : ( + <> + c/ + {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} + + ))} {pinned && ( diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index fa5ff617..3d6bfcf6 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -141,25 +141,22 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P )} {getFormattedDate(timestamp)}} content={getFormattedTimeAgo(timestamp)} />{' '} - {!(isDescription || isRules) && ( - - {cid ? ( - <> - !cid && e.preventDefault()}> - c/ - - openReplyModal && openReplyModal(cid, postCid, subplebbitAddress)}> - {shortCid.slice(0, -4)} - - - ) : ( - <> - c/ - {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} - - )} - - )} + {!(isDescription || isRules) && + (cid ? ( + + !cid && e.preventDefault()}> + c/ + + openReplyModal && openReplyModal(cid, postCid, subplebbitAddress)}> + {shortCid.slice(0, -4)} + + + ) : ( + <> + c/ + {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} + + ))} {(hasThumbnail || link) && !(deleted || removed) && (