From 3ddf26c93029cc60452d2aa3e13a752e3c4284fc Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Tue, 16 Jul 2024 13:20:24 +0200 Subject: [PATCH] fix(post): permalink (c/) of pending reply shouldn't link to anything --- src/components/post-desktop/post-desktop.tsx | 21 ++++++++++++-------- src/components/post-mobile/post-mobile.tsx | 21 ++++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index e497971b..e10edede 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -128,15 +128,20 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: )} {!(isDescription || isRules) && ( - !cid && e.preventDefault()}> - c/ - - {!cid ? ( - {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} + {cid ? ( + <> + !cid && e.preventDefault()}> + c/ + + openReplyModal && openReplyModal(cid)}> + {shortCid} + + ) : ( - openReplyModal && openReplyModal(cid)}> - {shortCid} - + <> + c/ + {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} + )} )} diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index 71946dd5..3bc81123 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -118,15 +118,20 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P {getFormattedDate(timestamp)}} content={getFormattedTimeAgo(timestamp)} />{' '} {!(isDescription || isRules) && ( - !cid && e.preventDefault()}> - c/ - - {!cid ? ( - {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} + {cid ? ( + <> + !cid && e.preventDefault()}> + c/ + + openReplyModal && openReplyModal(cid)}> + {shortCid} + + ) : ( - openReplyModal && openReplyModal(cid)}> - {shortCid} - + <> + c/ + {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} + )} )}