Add email verification prompts throughout the app (#6174)

This commit is contained in:
Hailey
2024-11-12 11:18:53 -08:00
committed by GitHub
parent dd8d14e133
commit 427f3a8bd7
11 changed files with 265 additions and 46 deletions
@@ -0,0 +1,25 @@
import {useQuery} from '@tanstack/react-query'
interface ServiceConfig {
checkEmailConfirmed: boolean
}
export function useServiceConfigQuery() {
return useQuery({
queryKey: ['service-config'],
queryFn: async () => {
const res = await fetch(
'https://api.bsky.app/xrpc/app.bsky.unspecced.getConfig',
)
if (!res.ok) {
return {
checkEmailConfirmed: false,
}
}
const json = await res.json()
return json as ServiceConfig
},
staleTime: 5 * 60 * 1000,
})
}