Task detail page finalized and added user loading skeleton

This commit is contained in:
Thastertyn committed 2025-06-23 00:09:21 +02:00
1 parent 2204ffeece
commit e5e565430c
7 files changed
+126 -23

No files matched your search

+3 -2
View File
@@ -10,6 +10,7 @@ import {
Button,
Card,
CardHeader,
Skeleton,
TextField,
} from "@mui/material";
import { DatePicker } from "@mui/x-date-pickers/DatePicker";
@@ -37,6 +38,7 @@ const TaskForm: React.FC = () => {
const creationDate = useRef<Date>(new Date());
function addTask(data: FormValues) {
creationDate.current = new Date();
const currentIdMaxId = Math.max(...tasks.map((task) => task.id)) + 1;
const newId = Math.max(currentIdMaxId, 1);
@@ -53,8 +55,7 @@ const TaskForm: React.FC = () => {
reset();
}
// TODO make a skeleton
if (loading) return <div>Loading...</div>;
if (loading) return <Skeleton className="task-form-skeleton" />;
// TODO Better error display
if (users == null) return <div>{error}</div>;