diff --git a/src/view/com/util/forms/PostDropdownBtn.tsx b/src/view/com/util/forms/PostDropdownBtn.tsx
index 1cd4841a5e..e71332279c 100644
--- a/src/view/com/util/forms/PostDropdownBtn.tsx
+++ b/src/view/com/util/forms/PostDropdownBtn.tsx
@@ -102,12 +102,77 @@ let PostDropdownBtn = ({
timestamp: string
threadgateRecord?: AppBskyFeedThreadgate.Record
}): React.ReactNode => {
- const {hasSession, currentAccount} = useSession()
const theme = useTheme()
const alf = useAlf()
- const {gtMobile} = useBreakpoints()
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 langPrefs = useLanguagePrefs()
const {mutateAsync: deletePostMutate} = usePostDeleteMutation()
const {mutateAsync: pinPostMutate, isPending: isPinPending} =
@@ -360,308 +425,276 @@ let PostDropdownBtn = ({
}, [isPinned, pinPostMutate, postCid, postUri])
return (
-
-
-
- {({props, state}) => {
- return (
-
-
-
- )
- }}
-
-
-
- {isAuthor && (
- <>
-
-
-
- {isPinned
- ? _(msg`Unpin from profile`)
- : _(msg`Pin to your profile`)}
-
-
-
-
-
- >
- )}
-
+ <>
+ {isAuthor && (
+ <>
- {(!hideInPWI || hasSession) && (
- <>
-
- {_(msg`Translate`)}
-
-
-
-
- {_(msg`Copy post text`)}
-
-
- >
- )}
-
- {hasSession && (
- sendViaChatControl.open()}>
-
- Send via direct message
-
-
-
- )}
-
{
- if (showLoggedOutWarning) {
- loggedOutWarningPromptControl.open()
- } else {
- onSharePost()
- }
- }}>
+ testID="pinPostBtn"
+ label={
+ isPinned
+ ? _(msg`Unpin from profile`)
+ : _(msg`Pin to your profile`)
+ }
+ disabled={isPinPending}
+ onPress={onPressPin}>
- {isWeb ? _(msg`Copy link to post`) : _(msg`Share`)}
+ {isPinned
+ ? _(msg`Unpin from profile`)
+ : _(msg`Pin to your profile`)}
-
+
+
+
+
+ >
+ )}
+
+
+ {(!hideInPWI || hasSession) && (
+ <>
+
+ {_(msg`Translate`)}
+
- {canEmbed && (
- embedPostControl.open()}>
- {_(msg`Embed post`)}
-
-
- )}
+
+ {_(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 && feedFeedback.enabled && (
- <>
-
-
-
- {_(msg`Show more like this`)}
-
-
+ {hasSession && (
+ <>
+
+
+
+
+ {isThreadMuted ? _(msg`Unmute thread`) : _(msg`Mute thread`)}
+
+
+
-
- {_(msg`Show less like this`)}
-
-
-
- >
- )}
+ mutedWordsDialogControl.open()}>
+ {_(msg`Mute words & tags`)}
+
+
+
+ >
+ )}
- {hasSession && (
- <>
-
-
+ {hasSession &&
+ (canHideReplyForEveryone || canDetachQuote || canHidePostForMe) && (
+ <>
+
+
+ {canHidePostForMe && (
+ onPress={() => hidePromptControl.open()}>
- {isThreadMuted
- ? _(msg`Unmute thread`)
- : _(msg`Mute thread`)}
+ {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 && (
mutedWordsDialogControl.open()}>
- {_(msg`Mute words & tags`)}
-
+ disabled={isDetachPending}
+ testID="postDropdownHideBtn"
+ label={
+ quoteEmbed.isDetached
+ ? _(msg`Re-attach quote`)
+ : _(msg`Detach quote`)
+ }
+ onPress={
+ quoteEmbed.isDetached
+ ? onToggleQuotePostAttachment
+ : () => quotePostDetachConfirmControl.open()
+ }>
+
+ {quoteEmbed.isDetached
+ ? _(msg`Re-attach quote`)
+ : _(msg`Detach quote`)}
+
+
-
- >
- )}
+ )}
+
+ >
+ )}
- {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`)}
+
+
)}
- {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`)}
-
-
- >
- )}
-
- >
- )}
-
-
+ {isAuthor && (
+ <>
+ postInteractionSettingsDialogControl.open()}
+ {...(isAuthor
+ ? Platform.select({
+ web: {
+ onHoverIn: prefetchPostInteractionSettings,
+ },
+ native: {
+ onPressIn: prefetchPostInteractionSettings,
+ },
+ })
+ : {})}>
+
+ {_(msg`Edit interaction settings`)}
+
+
+
+ deletePromptControl.open()}>
+ {_(msg`Delete post`)}
+
+
+ >
+ )}
+
+ >
+ )}
-
+ >
)
}
-
-PostDropdownBtn = memo(PostDropdownBtn)
-export {PostDropdownBtn}
+PostDropdownMenuItems = memo(PostDropdownMenuItems)