diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-02-14 23:22:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-14 23:22:32 +0000 |
commit | 1e3b7feccfb59c70a97ed51b26bee8c6ea33348f (patch) | |
tree | 7f6c6979317cf3634b734dd06ccf68dfc2ec817f /src/view/com/profile/ProfileMenu.tsx | |
parent | ab4be7a9e144cbb658385976f21394a036043cb8 (diff) | |
download | voidsky-1e3b7feccfb59c70a97ed51b26bee8c6ea33348f.tar.zst |
Screen for searching user's posts (#7622)
* search user's posts screen * custom placeholder copy if self * navigate to /profile/:handle * add name to title * show header on desktop
Diffstat (limited to 'src/view/com/profile/ProfileMenu.tsx')
-rw-r--r-- | src/view/com/profile/ProfileMenu.tsx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/view/com/profile/ProfileMenu.tsx b/src/view/com/profile/ProfileMenu.tsx index 770d17f48..102b34922 100644 --- a/src/view/com/profile/ProfileMenu.tsx +++ b/src/view/com/profile/ProfileMenu.tsx @@ -2,10 +2,12 @@ import React, {memo} from 'react' import {AppBskyActorDefs} from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {useNavigation} from '@react-navigation/native' import {useQueryClient} from '@tanstack/react-query' import {HITSLOP_20} from '#/lib/constants' import {makeProfileLink} from '#/lib/routes/links' +import {NavigationProp} from '#/lib/routes/types' import {shareText, shareUrl} from '#/lib/sharing' import {toShareUrl} from '#/lib/strings/url-helpers' import {logger} from '#/logger' @@ -26,6 +28,7 @@ import {ArrowOutOfBox_Stroke2_Corner0_Rounded as Share} from '#/components/icons import {DotGrid_Stroke2_Corner0_Rounded as Ellipsis} from '#/components/icons/DotGrid' import {Flag_Stroke2_Corner0_Rounded as Flag} from '#/components/icons/Flag' import {ListSparkle_Stroke2_Corner0_Rounded as List} from '#/components/icons/ListSparkle' +import {MagnifyingGlass2_Stroke2_Corner0_Rounded as SearchIcon} from '#/components/icons/MagnifyingGlass2' import {Mute_Stroke2_Corner0_Rounded as Mute} from '#/components/icons/Mute' import {PeopleRemove2_Stroke2_Corner0_Rounded as UserMinus} from '#/components/icons/PeopleRemove2' import { @@ -48,6 +51,7 @@ let ProfileMenu = ({ const {openModal} = useModalControls() const reportDialogControl = useReportDialogControl() const queryClient = useQueryClient() + const navigation = useNavigation<NavigationProp>() const isSelf = currentAccount?.did === profile.did const isFollowing = profile.viewer?.following const isBlocked = profile.viewer?.blocking || profile.viewer?.blockedBy @@ -177,6 +181,10 @@ let ProfileMenu = ({ shareText(profile.did) }, [profile.did]) + const onPressSearch = React.useCallback(() => { + navigation.navigate('ProfileSearch', {name: profile.handle}) + }, [navigation, profile.handle]) + return ( <EventStopper onKeyDown={false}> <Menu.Root> @@ -215,6 +223,15 @@ let ProfileMenu = ({ </Menu.ItemText> <Menu.ItemIcon icon={Share} /> </Menu.Item> + <Menu.Item + testID="profileHeaderDropdownSearchBtn" + label={_(msg`Search Posts`)} + onPress={onPressSearch}> + <Menu.ItemText> + <Trans>Search Posts</Trans> + </Menu.ItemText> + <Menu.ItemIcon icon={SearchIcon} /> + </Menu.Item> </Menu.Group> {hasSession && ( |