loading screen
parent
65b33f8009
commit
994baf9b1c
|
@ -70,6 +70,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"app": {
|
||||||
|
"loading": "Lade Profil..."
|
||||||
|
},
|
||||||
"pageNotFound": {
|
"pageNotFound": {
|
||||||
"title": "Seite nicht gefunden",
|
"title": "Seite nicht gefunden",
|
||||||
"subTitle": "Die Seite, die Sie besucht haben, existiert leider nicht.",
|
"subTitle": "Die Seite, die Sie besucht haben, existiert leider nicht.",
|
||||||
|
|
|
@ -70,6 +70,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"app": {
|
||||||
|
"loading": "Loading profile..."
|
||||||
|
},
|
||||||
"pageNotFound": {
|
"pageNotFound": {
|
||||||
"title": "Page Not Found",
|
"title": "Page Not Found",
|
||||||
"subTitle": "The page you visited does not exist.",
|
"subTitle": "The page you visited does not exist.",
|
||||||
|
|
|
@ -14,9 +14,3 @@
|
||||||
content: unset;
|
content: unset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 576px) {
|
|
||||||
.res {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
71
src/App.js
71
src/App.js
|
@ -1,7 +1,7 @@
|
||||||
import "antd/dist/reset.css";
|
import "antd/dist/reset.css";
|
||||||
import "./App.css";
|
import "./App.css";
|
||||||
import Login from "./Pages/Login";
|
import Login from "./Pages/Login";
|
||||||
import { Layout, Spin } from "antd";
|
import { Layout, Space, Spin, Typography } from "antd";
|
||||||
import { Constants, UseUserSession, myFetch } from "./utils";
|
import { Constants, UseUserSession, myFetch } from "./utils";
|
||||||
import DashboardLayout from "./Components/DashboardLayout";
|
import DashboardLayout from "./Components/DashboardLayout";
|
||||||
import SideBarProvider from "./Contexts/SideBarContext";
|
import SideBarProvider from "./Contexts/SideBarContext";
|
||||||
|
@ -13,6 +13,50 @@ import { useEffect, useState } from "react";
|
||||||
import StoresProvider from "./Contexts/StoresContext";
|
import StoresProvider from "./Contexts/StoresContext";
|
||||||
import { clarity } from "react-microsoft-clarity";
|
import { clarity } from "react-microsoft-clarity";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { ReactComponent as ZeitAdler } from "./ZeitAdler.svg";
|
||||||
|
|
||||||
|
export function Loading() {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "center",
|
||||||
|
flexDirection: "column",
|
||||||
|
alignItems: "center",
|
||||||
|
height: "100vh",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ZeitAdler
|
||||||
|
style={{
|
||||||
|
maxHeight: 100,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: 20,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Spin />
|
||||||
|
|
||||||
|
<Typography.Title
|
||||||
|
level={3}
|
||||||
|
strong
|
||||||
|
style={{
|
||||||
|
letterSpacing: 2,
|
||||||
|
margin: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("app.loading")}
|
||||||
|
</Typography.Title>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
/*const [notificationApi, notificationContextHolder] =
|
/*const [notificationApi, notificationContextHolder] =
|
||||||
|
@ -54,30 +98,7 @@ export default function App() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appUserData === null) {
|
if (appUserData === null) {
|
||||||
return (
|
return <Loading />;
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
height: "100vh",
|
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
gap: 40,
|
|
||||||
}}
|
|
||||||
className="App"
|
|
||||||
>
|
|
||||||
<Spin size="large" />
|
|
||||||
|
|
||||||
<span
|
|
||||||
style={{
|
|
||||||
fontWeight: "bold",
|
|
||||||
fontSize: 24,
|
|
||||||
letterSpacing: 2,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Lade Daten...
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.info(
|
console.info(
|
||||||
|
|
|
@ -17,6 +17,7 @@ import {
|
||||||
RequestState,
|
RequestState,
|
||||||
RequestStateItem,
|
RequestStateItem,
|
||||||
} from "../../Components/MyRequestStateItem";
|
} from "../../Components/MyRequestStateItem";
|
||||||
|
import { LogoutOutlined } from "@ant-design/icons";
|
||||||
|
|
||||||
export default function UserProfile({ setUserSession }) {
|
export default function UserProfile({ setUserSession }) {
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
|
@ -98,6 +99,7 @@ export default function UserProfile({ setUserSession }) {
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
loading={isRequestingLogout}
|
loading={isRequestingLogout}
|
||||||
|
icon={<LogoutOutlined />}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsRequestingLogout(true);
|
setIsRequestingLogout(true);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
/*font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
|
||||||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",sans-serif;*/
|
|
||||||
font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
|
@ -13,34 +11,3 @@ code {
|
||||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||||
monospace;
|
monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading text {
|
|
||||||
stroke: #e67e22;
|
|
||||||
font-size: 300px;
|
|
||||||
font-weight: 700;
|
|
||||||
stroke-width: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loading-init text {
|
|
||||||
animation: textAnimate 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loading-reconnecting text {
|
|
||||||
animation: textAnimate 1s infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes textAnimate {
|
|
||||||
0% {
|
|
||||||
stroke-dasharray: 0 50%;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
stroke-dasharray: 50% 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
25
src/index.js
25
src/index.js
|
@ -1,35 +1,18 @@
|
||||||
import React from "react";
|
import { Suspense } from "react";
|
||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import App from "./App";
|
import App, { Loading } from "./App";
|
||||||
import { BrowserRouter } from "react-router-dom";
|
import { BrowserRouter } from "react-router-dom";
|
||||||
import "./i18n";
|
import "./i18n";
|
||||||
//import reportWebVitals from './reportWebVitals';
|
//import reportWebVitals from './reportWebVitals';
|
||||||
|
|
||||||
const Loading = () => {
|
|
||||||
return (
|
|
||||||
<svg id="loading-init" className="loading" viewBox="0 0 1350 600">
|
|
||||||
<text x="50%" y="50%" fill="transparent" textAnchor="middle">
|
|
||||||
C O M P A N Y
|
|
||||||
</text>
|
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO: Undo this
|
|
||||||
/*
|
|
||||||
<text x="50%" y="50%" fill="transparent" textAnchor="middle">
|
|
||||||
J A N N E X
|
|
||||||
</text>
|
|
||||||
*/
|
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(document.getElementById("root"));
|
const root = ReactDOM.createRoot(document.getElementById("root"));
|
||||||
root.render(
|
root.render(
|
||||||
<React.Suspense fallback={<Loading />}>
|
<Suspense fallback={<Loading />}>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<App />
|
<App />
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</React.Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
|
|
||||||
// If you want to start measuring performance in your app, pass a function
|
// If you want to start measuring performance in your app, pass a function
|
||||||
|
|
Loading…
Reference in New Issue