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 ? (
|
|
|
|
<div className="relative w-screen h-screen flex justify-center items-center">Loading</div>
|
|
|
|
) : (
|
|
|
|
<>{userStore.currentUser ? <UserLoggedIn /> : <SignInView />}</>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
2023-09-04 11:25:43 +00:00
|
|
|
});
|