[🐴] New chat dialog refresh (#4071)

* Checkpoint, header styled, empty

* Checkpoint, styles

* Show recent follows in initial state, finesse some styles

* Add skeleton

* Add some limits

* Fix autofocus on web, use bottom sheet input on native

* Ignore type

* Clean up edits

* Format

* Tweak icon placement

* Fix type

* use prop for dismissing keyboard

---------

Co-authored-by: Hailey <me@haileyok.com>
This commit is contained in:
Eric Bailey 2024-05-17 17:03:50 -05:00 committed by GitHub
parent d02e0884c4
commit 1cdcb3e6c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 530 additions and 292 deletions

View file

@ -16,7 +16,16 @@ type RQPageParam = string | undefined
const RQKEY_ROOT = 'profile-follows'
export const RQKEY = (did: string) => [RQKEY_ROOT, did]
export function useProfileFollowsQuery(did: string | undefined) {
export function useProfileFollowsQuery(
did: string | undefined,
{
limit,
}: {
limit?: number
} = {
limit: PAGE_SIZE,
},
) {
const {getAgent} = useAgent()
return useInfiniteQuery<
AppBskyGraphGetFollows.OutputSchema,
@ -30,7 +39,7 @@ export function useProfileFollowsQuery(did: string | undefined) {
async queryFn({pageParam}: {pageParam: RQPageParam}) {
const res = await getAgent().app.bsky.graph.getFollows({
actor: did || '',
limit: PAGE_SIZE,
limit: limit || PAGE_SIZE,
cursor: pageParam,
})
return res.data