plane/space/app/page.tsx
Prateek Shourya 780caf59a0
[WEB-1404] chore: space app infinite loader and scroll fix. (#4559)
* [WEB-1404] chore: space app infinite loader and scroll fix.

* chore: revert back `isLoading` initail state to `true` in user store.
2024-05-23 14:27:16 +05:30

22 lines
540 B
TypeScript

"use client";
import { observer } from "mobx-react-lite";
// components
import { UserLoggedIn } from "@/components/account";
import { LogoSpinner } from "@/components/common";
import { AuthView } from "@/components/views";
// hooks
import { useUser } from "@/hooks/store";
const HomePage = observer(() => {
const { data: currentUser, isAuthenticated, isLoading } = useUser();
if (isLoading) return <LogoSpinner />;
if (currentUser && isAuthenticated) return <UserLoggedIn />;
return <AuthView />;
});
export default HomePage;