-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Desktop web work * Mobile search * Dedupe suggestions * Clean up and reorg * Cleanup * Cleanup * Use Pager * Delete unused code * Fix conflicts * Remove search ui model * Soft reset * Fix scrollable results, remove observer * Use correct ScrollView * Clean up layout --------- Co-authored-by: Paul Frazee <[email protected]>
- Loading branch information
1 parent
d5ea319
commit 22b7642
Showing
14 changed files
with
742 additions
and
991 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {AppBskyFeedSearchPosts} from '@atproto/api' | ||
import {useInfiniteQuery, InfiniteData, QueryKey} from '@tanstack/react-query' | ||
|
||
import {useSession} from '#/state/session' | ||
|
||
const searchPostsQueryKey = ({query}: {query: string}) => [ | ||
'search-posts', | ||
query, | ||
] | ||
|
||
export function useSearchPostsQuery({query}: {query: string}) { | ||
const {agent} = useSession() | ||
|
||
return useInfiniteQuery< | ||
AppBskyFeedSearchPosts.OutputSchema, | ||
Error, | ||
InfiniteData<AppBskyFeedSearchPosts.OutputSchema>, | ||
QueryKey, | ||
string | undefined | ||
>({ | ||
queryKey: searchPostsQueryKey({query}), | ||
queryFn: async () => { | ||
const res = await agent.app.bsky.feed.searchPosts({ | ||
q: query, | ||
limit: 25, | ||
}) | ||
return res.data | ||
}, | ||
initialPageParam: undefined, | ||
getNextPageParam: lastPage => lastPage.cursor, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.