diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-06-06 18:21:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-06 08:21:23 -0700 |
commit | 487da69a15d3957651c19f4e273501258daefd0a (patch) | |
tree | f829007db7bf6d76ccb0754a36ae3f5043ef4e45 /src/components/PostControls/PostMenu | |
parent | 23a7bc50db1efc7cd219f7e03f7ed12fdaa94266 (diff) | |
download | voidsky-487da69a15d3957651c19f4e273501258daefd0a.tar.zst |
Replace "Note about sharing" prompt with an inline hint (#8452)
* add pwi warning to share menu, remove prompt * add pwi label to web, remove prompt * add an option to the PWI menu * conditionally reorder items on web
Diffstat (limited to 'src/components/PostControls/PostMenu')
-rw-r--r-- | src/components/PostControls/PostMenu/PostMenuItems.tsx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/components/PostControls/PostMenu/PostMenuItems.tsx b/src/components/PostControls/PostMenu/PostMenuItems.tsx index 7f33f3348..01ddd0bcf 100644 --- a/src/components/PostControls/PostMenu/PostMenuItems.tsx +++ b/src/components/PostControls/PostMenu/PostMenuItems.tsx @@ -48,7 +48,7 @@ import { useProfileMuteMutationQueue, } from '#/state/queries/profile' import {useToggleReplyVisibilityMutation} from '#/state/queries/threadgate' -import {useSession} from '#/state/session' +import {useRequireAuth, useSession} from '#/state/session' import {useMergedThreadgateHiddenReplies} from '#/state/threadgate-hidden-replies' import * as Toast from '#/view/com/util/Toast' import {useDialogControl} from '#/components/Dialog' @@ -113,6 +113,7 @@ let PostMenuItems = ({ const {mutateAsync: deletePostMutate} = usePostDeleteMutation() const {mutateAsync: pinPostMutate, isPending: isPinPending} = usePinnedPostMutation() + const requireSignIn = useRequireAuth() const hiddenPosts = useHiddenPosts() const {hidePost} = useHiddenPostsApi() const feedFeedback = useFeedFeedbackContext() @@ -397,6 +398,8 @@ let PostMenuItems = ({ openLink(url) } + const onSignIn = () => requireSignIn(() => {}) + const gate = useGate() const isDiscoverDebugUser = IS_INTERNAL || @@ -434,7 +437,7 @@ let PostMenuItems = ({ )} <Menu.Group> - {(!hideInPWI || hasSession) && ( + {!hideInPWI || hasSession ? ( <> <Menu.Item testID="postDropdownTranslateBtn" @@ -452,6 +455,14 @@ let PostMenuItems = ({ <Menu.ItemIcon icon={ClipboardIcon} position="right" /> </Menu.Item> </> + ) : ( + <Menu.Item + testID="postDropdownSignInBtn" + label={_(msg`Sign in to view post`)} + onPress={onSignIn}> + <Menu.ItemText>{_(msg`Sign in to view post`)}</Menu.ItemText> + <Menu.ItemIcon icon={Eye} position="right" /> + </Menu.Item> )} </Menu.Group> |