2022-07-12 21:49:11 +00:00
|
|
|
import React from "react";
|
2022-01-06 01:26:15 +00:00
|
|
|
|
2022-07-12 21:49:11 +00:00
|
|
|
import Loading from "../components/LoadingScreen/Loading";
|
|
|
|
import MainContainer from "../components/Base/MainContainer";
|
2022-01-06 01:26:15 +00:00
|
|
|
import { AuthContext } from "../context/Auth/AuthContext";
|
|
|
|
import { i18n } from "../translate/i18n";
|
2022-07-12 21:49:11 +00:00
|
|
|
import MenuComponent from "../components/Menu/MenuComponent";
|
2022-01-06 01:26:15 +00:00
|
|
|
|
|
|
|
const LoggedInLayout = ({ children }) => {
|
2022-07-12 21:49:11 +00:00
|
|
|
const { handleLogout, loading, isAuth } = React.useContext(AuthContext);
|
|
|
|
const { user } = React.useContext(AuthContext);
|
2022-01-06 01:26:15 +00:00
|
|
|
|
2022-07-12 21:49:11 +00:00
|
|
|
const logout = (e) => {
|
2022-01-06 01:26:15 +00:00
|
|
|
handleLogout();
|
|
|
|
};
|
|
|
|
|
|
|
|
if (loading) {
|
2022-07-12 21:49:11 +00:00
|
|
|
return <Loading />;
|
2022-01-06 01:26:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2022-07-12 21:49:11 +00:00
|
|
|
<>
|
2022-07-18 16:30:48 +00:00
|
|
|
<MenuComponent />
|
|
|
|
<MainContainer>{children ? children : null}</MainContainer>
|
2022-07-12 21:49:11 +00:00
|
|
|
</>
|
2022-01-06 01:26:15 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default LoggedInLayout;
|