mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-26 08:26:51 +00:00
Add skeleton loading indicators
This commit is contained in:
@@ -11,6 +11,7 @@ import { useVersion } from './Version.jsx'
|
||||
interface SpyglassContext {
|
||||
client: SpyglassClient
|
||||
service: SpyglassService | undefined
|
||||
serviceLoading: boolean
|
||||
}
|
||||
|
||||
const SpyglassContext = createContext<SpyglassContext | undefined>(undefined)
|
||||
@@ -59,13 +60,14 @@ export function SpyglassProvider({ children }: { children: ComponentChildren })
|
||||
const { version } = useVersion()
|
||||
const [client] = useState(new SpyglassClient())
|
||||
|
||||
const { value: service } = useAsync(() => {
|
||||
const { value: service, loading: serviceLoading } = useAsync(() => {
|
||||
return client.createService(version)
|
||||
}, [client, version])
|
||||
|
||||
const value: SpyglassContext = {
|
||||
client,
|
||||
service,
|
||||
serviceLoading,
|
||||
}
|
||||
|
||||
return <SpyglassContext.Provider value={value}>
|
||||
|
||||
Reference in New Issue
Block a user