Skip to content

Commit

Permalink
custom placeholder copy if self
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzius committed Feb 7, 2025
1 parent 402b841 commit 828caca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/screens/Profile/ProfileSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import {useLingui} from '@lingui/react'
import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types'
import {useProfileQuery} from '#/state/queries/profile'
import {useResolveDidQuery} from '#/state/queries/resolve-uri'
import {useSession} from '#/state/session'
import {SearchScreenShell} from '#/view/screens/Search/Search'

type Props = NativeStackScreenProps<CommonNavigatorParams, 'ProfileSearch'>
export const ProfileSearchScreen = ({route}: Props) => {
const {name, q: queryParam = ''} = route.params
const {_} = useLingui()
const {currentAccount} = useSession()

const {data: resolvedDid} = useResolveDidQuery(name)
const {data: profile} = useProfileQuery({did: resolvedDid})
Expand All @@ -26,7 +28,11 @@ export const ProfileSearchScreen = ({route}: Props) => {
<SearchScreenShell
navButton="back"
inputPlaceholder={
profile ? _(msg`Search @${profile.handle}'s posts`) : _(msg`Search...`)
profile
? currentAccount?.did === profile.did
? _(msg`Search my posts`)
: _(msg`Search @${profile.handle}'s posts`)
: _(msg`Search...`)
}
fixedParams={fixedParams}
queryParam={queryParam}
Expand Down

0 comments on commit 828caca

Please sign in to comment.