Files
modeling-app/src/Auth.tsx
Frank Noirot 84380f3da9 Zoo rebrand (#1228)
* 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>
2023-12-18 06:15:26 -05:00

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}</>
)
}