mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: add loading indicator and improve loading screens
This commit is contained in:
parent
866111aa4c
commit
29219391ea
5 changed files with 32 additions and 5 deletions
|
|
@ -4,6 +4,7 @@ import { swrFetcher } from '@services/utils/ts/requests'
|
|||
import React, { createContext, useContext, useEffect, useReducer } from 'react'
|
||||
import useSWR from 'swr'
|
||||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||
import PageLoading from '@components/Objects/Loaders/PageLoading'
|
||||
|
||||
export const CourseContext = createContext(null)
|
||||
export const CourseDispatchContext = createContext(null)
|
||||
|
|
@ -33,7 +34,7 @@ export function CourseProvider({ children, courseuuid }: any) {
|
|||
}, [courseStructureData]);
|
||||
|
||||
if (error) return <div>Failed to load course structure</div>;
|
||||
if (!courseStructureData) return <div>Loading...</div>;
|
||||
if (!courseStructureData) return <PageLoading/>;
|
||||
|
||||
return (
|
||||
<CourseContext.Provider value={state}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue