Franknoirot/loading states (#246)

* Add Loading state with long load time messaging

* Make /signin page respect user theme
This commit is contained in:
Frank Noirot
2023-08-09 15:41:41 -04:00
committed by GitHub
parent 968a67e654
commit dbb94d7e95
6 changed files with 90 additions and 16 deletions

View File

@ -5,6 +5,7 @@ import { User, useStore } from './useStore'
import { useNavigate } from 'react-router-dom'
import { useEffect } from 'react'
import { isTauri } from './lib/isTauri'
import Loading from './components/Loading'
// Wrapper around protected routes, used in src/Router.tsx
export const Auth = ({ children }: React.PropsWithChildren) => {
@ -30,5 +31,5 @@ export const Auth = ({ children }: React.PropsWithChildren) => {
}
}, [user, token, navigate, isLoading])
return isLoading ? <>Loading...</> : <>{children}</>
return isLoading ? <Loading /> : <>{children}</>
}