Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to search posts via profile dropdown #4373

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/view/com/profile/ProfileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {useTheme} from '#/alf'
import {ArrowOutOfBox_Stroke2_Corner0_Rounded as Share} from '#/components/icons/ArrowOutOfBox'
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 MagnifyingGlass} 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 {
Expand All @@ -39,6 +40,7 @@ import {SpeakerVolumeFull_Stroke2_Corner0_Rounded as Unmute} from '#/components/
import * as Menu from '#/components/Menu'
import * as Prompt from '#/components/Prompt'
import {ReportDialog, useReportDialogControl} from '#/components/ReportDialog'
import {navigate} from '#/Navigation'

let ProfileMenu = ({
profile,
Expand Down Expand Up @@ -232,6 +234,24 @@ let ProfileMenu = ({
{hasSession && (
<>
<Menu.Divider />

{/* This group is seperated so users can use this button on their own account. */}
<Menu.Group>
<Menu.Item
testID="profileHeaderDropdownSearchPostsBtn"
label={_(msg`Search Posts`)}
onPress={() => {
navigate('Search', {
q: `from:${profile.handle}`,
})
}}>
<Menu.ItemText>
<Trans>Search Posts</Trans>
</Menu.ItemText>
<Menu.ItemIcon icon={MagnifyingGlass} />
</Menu.Item>
</Menu.Group>

<Menu.Group>
{!isSelf && (
<>
Expand Down