Repository navigation
Allow showing loading permission state
Extended the AuthStateAdapter interface by isLoadedandsetIsLoaded` to display loading state.
useProductInstances(): {
instances: readonly ProductInstance[]
setInstances: (_: Array<ProductInstance>) => void
isLoaded: boolean
setIsLoaded: (_: boolean) => void
}Usage example:
import { useAuth } from '@bbrighter/auth-module/auth'
import Backdrop from '@mui/material/Backdrop'
import CircularProgress from '@mui/material/CircularProgress'
export const PermissionLoader = () => {
const { isLoaded, token } = useAuth()
return (
<Backdrop
data-testid="permission-backdrop"
open={!isLoaded && token != ''}
sx={theme => ({ color: '#fff', zIndex: theme.zIndex.drawer + 1 })}
>
<CircularProgress size={75} />
</Backdrop>
)
}