diff --git a/src/view/com/util/forms/PostDropdownBtn.tsx b/src/view/com/util/forms/PostDropdownBtn.tsx
index e71332279c..1cd4841a5e 100644
--- a/src/view/com/util/forms/PostDropdownBtn.tsx
+++ b/src/view/com/util/forms/PostDropdownBtn.tsx
@@ -102,77 +102,12 @@ let PostDropdownBtn = ({
timestamp: string
threadgateRecord?: AppBskyFeedThreadgate.Record
}): React.ReactNode => {
+ const {hasSession, currentAccount} = useSession()
const theme = useTheme()
const alf = useAlf()
- const {_} = useLingui()
- const defaultCtrlColor = theme.palette.default.postCtrl
- return (
-
-
-
- {({props, state}) => {
- return (
-
-
-
- )
- }}
-
-
-
-
-
-
- )
-}
-
-PostDropdownBtn = memo(PostDropdownBtn)
-export {PostDropdownBtn}
-
-let PostDropdownMenuItems = ({
- post,
- postFeedContext,
- record,
- richText,
- timestamp,
- threadgateRecord,
-}: {
- testID: string
- post: Shadow
- postFeedContext: string | undefined
- record: AppBskyFeedPost.Record
- richText: RichTextAPI
- style?: StyleProp
- hitSlop?: PressableProps['hitSlop']
- size?: 'lg' | 'md' | 'sm'
- timestamp: string
- threadgateRecord?: AppBskyFeedThreadgate.Record
-}): React.ReactNode => {
- const {hasSession, currentAccount} = useSession()
const {gtMobile} = useBreakpoints()
const {_} = useLingui()
+ const defaultCtrlColor = theme.palette.default.postCtrl
const langPrefs = useLanguagePrefs()
const {mutateAsync: deletePostMutate} = usePostDeleteMutation()
const {mutateAsync: pinPostMutate, isPending: isPinPending} =
@@ -425,276 +360,308 @@ let PostDropdownMenuItems = ({
}, [isPinned, pinPostMutate, postCid, postUri])
return (
- <>
- {isAuthor && (
- <>
-
-
-
- {isPinned
- ? _(msg`Unpin from profile`)
- : _(msg`Pin to your profile`)}
-
-
-
-
-
- >
- )}
+
+
+
+ {({props, state}) => {
+ return (
+
+
+
+ )
+ }}
+
-
- {(!hideInPWI || hasSession) && (
- <>
-
- {_(msg`Translate`)}
-
-
-
-
- {_(msg`Copy post text`)}
-
-
- >
- )}
-
- {hasSession && (
- sendViaChatControl.open()}>
-
- Send via direct message
-
-
-
- )}
-
- {
- if (showLoggedOutWarning) {
- loggedOutWarningPromptControl.open()
- } else {
- onSharePost()
- }
- }}>
-
- {isWeb ? _(msg`Copy link to post`) : _(msg`Share`)}
-
-
-
-
- {canEmbed && (
- embedPostControl.open()}>
- {_(msg`Embed post`)}
-
-
- )}
-
-
- {hasSession && feedFeedback.enabled && (
- <>
-
-
-
- {_(msg`Show more like this`)}
-
-
-
-
- {_(msg`Show less like this`)}
-
-
-
- >
- )}
-
- {hasSession && (
- <>
-
-
-
-
- {isThreadMuted ? _(msg`Unmute thread`) : _(msg`Mute thread`)}
-
-
-
-
- mutedWordsDialogControl.open()}>
- {_(msg`Mute words & tags`)}
-
-
-
- >
- )}
-
- {hasSession &&
- (canHideReplyForEveryone || canDetachQuote || canHidePostForMe) && (
- <>
-
-
- {canHidePostForMe && (
+
+ {isAuthor && (
+ <>
+
hidePromptControl.open()}>
+ disabled={isPinPending}
+ onPress={onPressPin}>
- {isReply
- ? _(msg`Hide reply for me`)
- : _(msg`Hide post for me`)}
-
-
-
- )}
- {canHideReplyForEveryone && (
- hideReplyConfirmControl.open()
- }>
-
- {isReplyHiddenByThreadgate
- ? _(msg`Show reply for everyone`)
- : _(msg`Hide reply for everyone`)}
+ {isPinned
+ ? _(msg`Unpin from profile`)
+ : _(msg`Pin to your profile`)}
- )}
+
+
+ >
+ )}
- {canDetachQuote && (
- quotePostDetachConfirmControl.open()
- }>
-
- {quoteEmbed.isDetached
- ? _(msg`Re-attach quote`)
- : _(msg`Detach quote`)}
-
-
-
- )}
-
- >
- )}
-
- {hasSession && (
- <>
-
- {!isAuthor && (
- reportDialogControl.open()}>
- {_(msg`Report post`)}
-
-
- )}
-
- {isAuthor && (
+ {(!hideInPWI || hasSession) && (
<>
postInteractionSettingsDialogControl.open()}
- {...(isAuthor
- ? Platform.select({
- web: {
- onHoverIn: prefetchPostInteractionSettings,
- },
- native: {
- onPressIn: prefetchPostInteractionSettings,
- },
- })
- : {})}>
-
- {_(msg`Edit interaction settings`)}
-
-
+ testID="postDropdownTranslateBtn"
+ label={_(msg`Translate`)}
+ onPress={onPressTranslate}>
+ {_(msg`Translate`)}
+
+
deletePromptControl.open()}>
- {_(msg`Delete post`)}
-
+ testID="postDropdownCopyTextBtn"
+ label={_(msg`Copy post text`)}
+ onPress={onCopyPostText}>
+ {_(msg`Copy post text`)}
+
>
)}
+
+ {hasSession && (
+ sendViaChatControl.open()}>
+
+ Send via direct message
+
+
+
+ )}
+
+ {
+ if (showLoggedOutWarning) {
+ loggedOutWarningPromptControl.open()
+ } else {
+ onSharePost()
+ }
+ }}>
+
+ {isWeb ? _(msg`Copy link to post`) : _(msg`Share`)}
+
+
+
+
+ {canEmbed && (
+ embedPostControl.open()}>
+ {_(msg`Embed post`)}
+
+
+ )}
- >
- )}
+
+ {hasSession && feedFeedback.enabled && (
+ <>
+
+
+
+ {_(msg`Show more like this`)}
+
+
+
+
+ {_(msg`Show less like this`)}
+
+
+
+ >
+ )}
+
+ {hasSession && (
+ <>
+
+
+
+
+ {isThreadMuted
+ ? _(msg`Unmute thread`)
+ : _(msg`Mute thread`)}
+
+
+
+
+ mutedWordsDialogControl.open()}>
+ {_(msg`Mute words & tags`)}
+
+
+
+ >
+ )}
+
+ {hasSession &&
+ (canHideReplyForEveryone || canDetachQuote || canHidePostForMe) && (
+ <>
+
+
+ {canHidePostForMe && (
+ hidePromptControl.open()}>
+
+ {isReply
+ ? _(msg`Hide reply for me`)
+ : _(msg`Hide post for me`)}
+
+
+
+ )}
+ {canHideReplyForEveryone && (
+ hideReplyConfirmControl.open()
+ }>
+
+ {isReplyHiddenByThreadgate
+ ? _(msg`Show reply for everyone`)
+ : _(msg`Hide reply for everyone`)}
+
+
+
+ )}
+
+ {canDetachQuote && (
+ quotePostDetachConfirmControl.open()
+ }>
+
+ {quoteEmbed.isDetached
+ ? _(msg`Re-attach quote`)
+ : _(msg`Detach quote`)}
+
+
+
+ )}
+
+ >
+ )}
+
+ {hasSession && (
+ <>
+
+
+ {!isAuthor && (
+ reportDialogControl.open()}>
+ {_(msg`Report post`)}
+
+
+ )}
+
+ {isAuthor && (
+ <>
+
+ postInteractionSettingsDialogControl.open()
+ }
+ {...(isAuthor
+ ? Platform.select({
+ web: {
+ onHoverIn: prefetchPostInteractionSettings,
+ },
+ native: {
+ onPressIn: prefetchPostInteractionSettings,
+ },
+ })
+ : {})}>
+
+ {_(msg`Edit interaction settings`)}
+
+
+
+ deletePromptControl.open()}>
+ {_(msg`Delete post`)}
+
+
+ >
+ )}
+
+ >
+ )}
+
+
- >
+
)
}
-PostDropdownMenuItems = memo(PostDropdownMenuItems)
+
+PostDropdownBtn = memo(PostDropdownBtn)
+export {PostDropdownBtn}