Cull unused files (#11029)
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
import {type AppBskyFeedGetSuggestedFeeds} from '@atproto/api'
|
||||
import {
|
||||
type InfiniteData,
|
||||
type QueryKey,
|
||||
useInfiniteQuery,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import {STALE} from '#/state/queries'
|
||||
import {useAgent} from '#/state/session'
|
||||
|
||||
const suggestedFeedsQueryKeyRoot = 'suggestedFeeds'
|
||||
export const suggestedFeedsQueryKey = [suggestedFeedsQueryKeyRoot]
|
||||
|
||||
export function useSuggestedFeedsQuery() {
|
||||
const agent = useAgent()
|
||||
return useInfiniteQuery<
|
||||
AppBskyFeedGetSuggestedFeeds.OutputSchema,
|
||||
Error,
|
||||
InfiniteData<AppBskyFeedGetSuggestedFeeds.OutputSchema>,
|
||||
QueryKey,
|
||||
string | undefined
|
||||
>({
|
||||
staleTime: STALE.HOURS.ONE,
|
||||
queryKey: suggestedFeedsQueryKey,
|
||||
queryFn: async ({pageParam}) => {
|
||||
const res = await agent.app.bsky.feed.getSuggestedFeeds({
|
||||
limit: 10,
|
||||
cursor: pageParam,
|
||||
})
|
||||
return res.data
|
||||
},
|
||||
initialPageParam: undefined,
|
||||
getNextPageParam: lastPage => lastPage.cursor,
|
||||
})
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import {createContext, useContext} from 'react'
|
||||
|
||||
interface PostProgressState {
|
||||
progress: number
|
||||
status: 'pending' | 'success' | 'error' | 'idle'
|
||||
error?: string
|
||||
}
|
||||
|
||||
const PostProgressContext = createContext<PostProgressState>({
|
||||
progress: 0,
|
||||
status: 'idle',
|
||||
})
|
||||
PostProgressContext.displayName = 'PostProgressContext'
|
||||
|
||||
export function Provider() {}
|
||||
|
||||
export function usePostProgress() {
|
||||
return useContext(PostProgressContext)
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
import {createContext, useContext, useState} from 'react'
|
||||
|
||||
type StateContext =
|
||||
| {
|
||||
uri: string
|
||||
isClip?: boolean
|
||||
}
|
||||
| undefined
|
||||
type SetContext = (v: StateContext) => void
|
||||
|
||||
const stateContext = createContext<StateContext>(undefined)
|
||||
stateContext.displayName = 'ActiveStarterPackStateContext'
|
||||
const setContext = createContext<SetContext>((_: StateContext) => {})
|
||||
setContext.displayName = 'ActiveStarterPackSetContext'
|
||||
|
||||
export function Provider({children}: {children: React.ReactNode}) {
|
||||
const [state, setState] = useState<StateContext>()
|
||||
|
||||
return (
|
||||
<stateContext.Provider value={state}>
|
||||
<setContext.Provider value={setState}>{children}</setContext.Provider>
|
||||
</stateContext.Provider>
|
||||
)
|
||||
}
|
||||
|
||||
export const useActiveStarterPack = () => useContext(stateContext)
|
||||
export const useSetActiveStarterPack = () => useContext(setContext)
|
||||
Reference in New Issue
Block a user