From 70032baec238c7d18cb2e64acd7c7911f7efa6a3 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 13 Aug 2024 14:30:46 -0500 Subject: [PATCH] Hide post for me --- src/view/com/util/forms/PostDropdownBtn.tsx | 136 ++++++++++---------- 1 file changed, 69 insertions(+), 67 deletions(-) diff --git a/src/view/com/util/forms/PostDropdownBtn.tsx b/src/view/com/util/forms/PostDropdownBtn.tsx index c684635a6a..7125a64790 100644 --- a/src/view/com/util/forms/PostDropdownBtn.tsx +++ b/src/view/com/util/forms/PostDropdownBtn.tsx @@ -302,13 +302,15 @@ let PostDropdownBtn = ({ } }, [_, quoteEmbed, post, toggleQuoteDetachment]) + const canHidePostForMe = !isAuthor && !isPostHidden const canEmbed = isWeb && gtMobile && !hideInPWI - const canHideReply = !isAuthor && isRootPostAuthor && !isPostHidden && isReply + const canHideReplyForEveryone = + !isAuthor && isRootPostAuthor && !isPostHidden && isReply const canDetachQuote = quoteEmbed && quoteEmbed.isOwnedByViewer const onToggleReplyVisibility = React.useCallback(async () => { // TODO no threadgate? - if (!canHideReply) return + if (!canHideReplyForEveryone) return const action = isReplyHiddenByThreadgate ? 'show' : 'hide' const isHide = action === 'hide' @@ -333,7 +335,7 @@ let PostDropdownBtn = ({ isReplyHiddenByThreadgate, rootUri, postUri, - canHideReply, + canHideReplyForEveryone, toggleReplyVisibility, ]) @@ -476,75 +478,75 @@ let PostDropdownBtn = ({ {_(msg`Mute words & tags`)} - - {!isAuthor && !isPostHidden && ( - - {_(msg`Hide post`)} - - - )} )} - {hasSession && (canHideReply || canDetachQuote) && ( - <> - - - {canHideReply && ( - - - {isReplyHiddenByThreadgate - ? _(msg`Show reply for everyone`) - : _(msg`Hide reply for everyone`)} - - - - )} - - {canDetachQuote && ( - - - {quoteEmbed.isDetached - ? _(msg`Re-attach quote`) - : _(msg`Detach quote`)} - - + + + {canHidePostForMe && ( + + {_(msg`Hide post for me`)} + + + )} + {canHideReplyForEveryone && ( + - - )} - - - )} + onPress={onToggleReplyVisibility}> + + {isReplyHiddenByThreadgate + ? _(msg`Show reply for everyone`) + : _(msg`Hide reply for everyone`)} + + + + )} + + {canDetachQuote && ( + + + {quoteEmbed.isDetached + ? _(msg`Re-attach quote`) + : _(msg`Detach quote`)} + + + + )} + + + )} {hasSession && ( <>