* Add new logomarks * Replace KittyCAD and KCMA with Zoo and ZMA anywhere it's safe * fmt * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * Make README logo a PNG instead of an SVG --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
17 lines
499 B
TypeScript
17 lines
499 B
TypeScript
import Loading from './components/Loading'
|
|
import { useGlobalStateContext } from 'hooks/useGlobalStateContext'
|
|
|
|
// Wrapper around protected routes, used in src/Router.tsx
|
|
export const Auth = ({ children }: React.PropsWithChildren) => {
|
|
const { auth } = useGlobalStateContext()
|
|
const isLoggingIn = auth?.state.matches('checkIfLoggedIn')
|
|
|
|
return isLoggingIn ? (
|
|
<Loading>
|
|
<span data-testid="initial-load">Loading Modeling App...</span>
|
|
</Loading>
|
|
) : (
|
|
<>{children}</>
|
|
)
|
|
}
|