Added placeholder-text for overview
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import Loading from "@/components/Loading";
|
||||||
import { apiCall } from "@/lib";
|
import { apiCall } from "@/lib";
|
||||||
import zustand, { StateUser } from "@/Zustand";
|
import zustand, { StateUser } from "@/Zustand";
|
||||||
import { Spinner } from "@heroui/react";
|
|
||||||
import { usePathname, useRouter } from "next/navigation";
|
import { usePathname, useRouter } from "next/navigation";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ export default function Main({ children }: { children: React.ReactNode }) {
|
|||||||
|
|
||||||
switch (auth) {
|
switch (auth) {
|
||||||
case AuthState.Loading:
|
case AuthState.Loading:
|
||||||
return <Spinner label="Loading..." />;
|
return <Loading />;
|
||||||
case AuthState.LoggedIn:
|
case AuthState.LoggedIn:
|
||||||
case AuthState.LoginScreen:
|
case AuthState.LoginScreen:
|
||||||
return children;
|
return children;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import AssignmentTable from "@/components/Event/AssignmentTable";
|
import AssignmentTable from "@/components/Event/AssignmentTable";
|
||||||
import Event from "@/components/Event/Event";
|
import Event from "@/components/Event/Event";
|
||||||
|
import Loading from "@/components/Loading";
|
||||||
import { apiCall } from "@/lib";
|
import { apiCall } from "@/lib";
|
||||||
import zustand, { EventData } from "@/Zustand";
|
import zustand, { EventData } from "@/Zustand";
|
||||||
import { useAsyncList } from "@react-stately/data";
|
import { useAsyncList } from "@react-stately/data";
|
||||||
@@ -27,7 +28,14 @@ export default function MyEvents() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.debug(events);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div>
|
||||||
|
<h1 className="mb-4 text-center text-4xl">My Events</h1>
|
||||||
|
{events.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : events.items.length > 0 ? (
|
||||||
<div className="flex justify-center gap-4">
|
<div className="flex justify-center gap-4">
|
||||||
{events.items.map((e) => (
|
{events.items.map((e) => (
|
||||||
<Event key={e.eventID} event={e}>
|
<Event key={e.eventID} event={e}>
|
||||||
@@ -39,5 +47,11 @@ export default function MyEvents() {
|
|||||||
</Event>
|
</Event>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-center italic text-gray-400">
|
||||||
|
No assigned events
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import AvailabilitySelector from "@/components/Event/AvailabilitySelector";
|
import AvailabilitySelector from "@/components/Event/AvailabilitySelector";
|
||||||
import Event from "@/components/Event/Event";
|
import Event from "@/components/Event/Event";
|
||||||
|
import Loading from "@/components/Loading";
|
||||||
import { apiCall } from "@/lib";
|
import { apiCall } from "@/lib";
|
||||||
import { EventAvailability } from "@/Zustand";
|
import { EventAvailability } from "@/Zustand";
|
||||||
import { useAsyncList } from "@react-stately/data";
|
import { useAsyncList } from "@react-stately/data";
|
||||||
@@ -28,6 +29,13 @@ export default function PendingEvents() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div>
|
||||||
|
<h1 className="mb-4 mt-8 w-full text-center text-4xl lg:mt-0">
|
||||||
|
Pending Events
|
||||||
|
</h1>
|
||||||
|
{events.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : events.items.length > 0 ? (
|
||||||
<div className="flex justify-center gap-4">
|
<div className="flex justify-center gap-4">
|
||||||
{events.items.map((e) => (
|
{events.items.map((e) => (
|
||||||
<Event key={e.eventID} event={e}>
|
<Event key={e.eventID} event={e}>
|
||||||
@@ -35,5 +43,11 @@ export default function PendingEvents() {
|
|||||||
</Event>
|
</Event>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-center italic text-gray-400">
|
||||||
|
No events with missing availability
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,17 +3,9 @@ import PendingEvents from "./PendingEvents";
|
|||||||
|
|
||||||
export default function Overview() {
|
export default function Overview() {
|
||||||
return (
|
return (
|
||||||
<div className="relative mx-auto flex-1 grid-cols-2 lg:grid lg:max-w-screen-lg">
|
<div className="relative mx-auto flex-1 grid-cols-2 gap-8 lg:grid lg:max-w-screen-lg">
|
||||||
<div>
|
|
||||||
<h1 className="mb-4 text-center text-4xl">My Events</h1>
|
|
||||||
<MyEvents />
|
<MyEvents />
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h1 className="mb-4 mt-8 text-center text-4xl lg:mt-0">
|
|
||||||
Pending Events
|
|
||||||
</h1>
|
|
||||||
<PendingEvents />
|
<PendingEvents />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ import {
|
|||||||
ModalContent,
|
ModalContent,
|
||||||
ModalFooter,
|
ModalFooter,
|
||||||
ModalHeader,
|
ModalHeader,
|
||||||
Spinner,
|
|
||||||
Textarea,
|
Textarea,
|
||||||
} from "@heroui/react";
|
} from "@heroui/react";
|
||||||
import { EventData } from "@/Zustand";
|
import { EventData } from "@/Zustand";
|
||||||
import { useAsyncList } from "@react-stately/data";
|
import { useAsyncList } from "@react-stately/data";
|
||||||
import { getTasks } from "@/lib";
|
import { getTasks } from "@/lib";
|
||||||
|
import Loading from "../Loading";
|
||||||
|
|
||||||
export interface EventSubmitData {
|
export interface EventSubmitData {
|
||||||
eventID: number;
|
eventID: number;
|
||||||
@@ -128,7 +128,7 @@ export default function EventEditor(props: {
|
|||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<Spinner label="Loading" />
|
<Loading />
|
||||||
)}
|
)}
|
||||||
</CheckboxGroup>
|
</CheckboxGroup>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
|||||||
5
client/src/components/Loading.tsx
Normal file
5
client/src/components/Loading.tsx
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { Spinner } from "@heroui/react";
|
||||||
|
|
||||||
|
export default function Loading() {
|
||||||
|
return <Spinner label="Loading..." />;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user