40 lines
1.5 KiB
JavaScript
40 lines
1.5 KiB
JavaScript
import React from "react";
|
|
import "antd/dist/reset.css";
|
|
import "./App.css";
|
|
import PageContent from "./Components/PageContent";
|
|
import SideMenu from "./Components/SideMenu";
|
|
import Login from "./Pages/Login";
|
|
import { Layout, notification } from "antd";
|
|
import { UseUserSession, WebSocketProvider } from "./utils";
|
|
|
|
export default function App() {
|
|
const [notificationApi, notificationContextHolder] =
|
|
notification.useNotification();
|
|
const { userSession, setUserSession } = UseUserSession();
|
|
|
|
if (!userSession) {
|
|
return <Login setUserSession={setUserSession} />;
|
|
}
|
|
|
|
console.info(
|
|
"\n %c Admin Dashboard %c v0.1.0 %c \n",
|
|
"background-color: #555;color: #fff;padding: 3px 2px 3px 3px;border-radius: 3px 0 0 3px;font-family: DejaVu Sans,Verdana,Geneva,sans-serif;text-shadow: 0 1px 0 rgba(1, 1, 1, 0.3)",
|
|
"background-color: #bc81e0;background-image: linear-gradient(90deg, #e67e22, #9b59b6);color: #fff;padding: 3px 3px 3px 2px;border-radius: 0 3px 3px 0;font-family: DejaVu Sans,Verdana,Geneva,sans-serif;text-shadow: 0 1px 0 rgba(1, 1, 1, 0.3)",
|
|
"background-color: transparent"
|
|
);
|
|
|
|
return (
|
|
<Layout style={{ minHeight: "100vh" }}>
|
|
{notificationContextHolder}
|
|
<WebSocketProvider
|
|
userSession={userSession}
|
|
setUserSession={setUserSession}
|
|
notificationApi={notificationApi}
|
|
>
|
|
<SideMenu setUserSession={setUserSession}></SideMenu>
|
|
<PageContent></PageContent>
|
|
</WebSocketProvider>
|
|
</Layout>
|
|
);
|
|
}
|