new LoadingScreen to replace old loading divs

This commit is contained in:
jojopirker
2022-12-28 20:49:03 +01:00
parent f208f65faf
commit d4887e0054
7 changed files with 57 additions and 18 deletions
+7 -1
View File
@@ -8,6 +8,7 @@ import poster from "src/lib/poster";
import { Messages } from "src/components/Messages";
import { TwoColumns } from "src/components/TwoColumns";
import { Button } from "src/components/Button";
import { LoadingScreen } from "@/components/Loading/LoadingScreen";
const UserReply = () => {
const [tasks, setTasks] = useState([]);
@@ -39,11 +40,16 @@ const UserReply = () => {
});
};
if (isLoading) {
return (<LoadingScreen text="Loading..."/>);
}
/**
* TODO: Make this a nicer loading screen.
*/
if (tasks.length == 0) {
return <div className="p-6 bg-slate-100 text-gray-800">Loading...</div>;
return <div className="p-6 bg-slate-100 text-gray-800">No tasks found...</div>;
}
const task = tasks[0].task;