2023-09-04 11:25:43 +00:00
|
|
|
// mobx
|
|
|
|
import { observer } from "mobx-react-lite";
|
|
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
|
|
// components
|
|
|
|
import { SignInView, UserLoggedIn } from "components/accounts";
|
|
|
|
|
2023-09-26 08:16:38 +00:00
|
|
|
export const LoginView = observer(() => {
|
2023-09-04 11:25:43 +00:00
|
|
|
const { user: userStore } = useMobxStore();
|
|
|
|
|
2023-10-04 13:51:04 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{userStore?.loader ? (
|
2023-12-01 07:55:48 +00:00
|
|
|
<div className="relative flex h-screen w-screen items-center justify-center">Loading</div> // TODO: Add spinner instead
|
2023-10-04 13:51:04 +00:00
|
|
|
) : (
|
|
|
|
<>{userStore.currentUser ? <UserLoggedIn /> : <SignInView />}</>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
2023-09-04 11:25:43 +00:00
|
|
|
});
|