Pinned feeds cards (#4526)
* Add lists support to FeedCard * Add useSavedFeeds query, similar to usePinnedFeedInfos * Integrate into Feeds screen * Fix alignment on mobile * Update usages * Add placeholder loading state * Handle no feeds state * Reuse previous data for placeholder * Staged loading * Improve staged loading * Use setQueryData approach to pre-caching * Add types for a little more safety * Fix precaching --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import {AppBskyActorDefs, AtUri} from '@atproto/api'
|
||||
import {useQuery, useQueryClient, UseQueryResult} from '@tanstack/react-query'
|
||||
import {
|
||||
QueryClient,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
UseQueryResult,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import {STALE} from '#/state/queries'
|
||||
import {useAgent} from '#/state/session'
|
||||
@@ -50,3 +55,11 @@ export function useResolveDidQuery(didOrHandle: string | undefined) {
|
||||
enabled: !!didOrHandle,
|
||||
})
|
||||
}
|
||||
|
||||
export function precacheResolvedUri(
|
||||
queryClient: QueryClient,
|
||||
handle: string,
|
||||
did: string,
|
||||
) {
|
||||
queryClient.setQueryData<string>(RQKEY(handle), did)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user