diff --git a/src/components/application-loader/application-loader.tsx b/src/components/application-loader/application-loader.tsx index 184d1bc8e..36eec0913 100644 --- a/src/components/application-loader/application-loader.tsx +++ b/src/components/application-loader/application-loader.tsx @@ -1,7 +1,6 @@ import React, {Fragment, useEffect, useState} from "react"; -import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import "./application-loader.scss"; -import {Alert} from "react-bootstrap"; +import {LoadingScreen} from "./loading-screen"; interface ApplicationLoaderProps { initTasks: Promise[] @@ -28,17 +27,9 @@ export const ApplicationLoader: React.FC = ({children, i }) }, [initTasks]); - return ({ - doneTasks < initTasks.length || initTasks.length === 0 ? ( -
-
- -
- { - failed ? An error occured while loading the application! : null - } -
- ) : children - }
); -} + return ( + doneTasks < initTasks.length || initTasks.length === 0 ? + : + {children} + ); +} \ No newline at end of file diff --git a/src/components/application-loader/loading-screen.tsx b/src/components/application-loader/loading-screen.tsx new file mode 100644 index 000000000..57d06f8b3 --- /dev/null +++ b/src/components/application-loader/loading-screen.tsx @@ -0,0 +1,21 @@ +import React from "react"; +import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; +import {Alert} from "react-bootstrap"; + +export interface LoadingScreenProps { + failed: boolean +} + +export const LoadingScreen: React.FC = ({failed}) => { + return ( +
+
+ +
+ { + failed ? An error occured while loading the application! : null + } +
+ ) +} \ No newline at end of file