PLS!
This commit is contained in:
parent
f7b35f1de6
commit
6e4af484ae
6 changed files with 20 additions and 18 deletions
|
@ -1,6 +1,4 @@
|
||||||
"use client";
|
const LoadingIndicator = () => {
|
||||||
|
|
||||||
const Loading = () => {
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center">
|
<div className="flex items-center justify-center">
|
||||||
<span className="loading loading-dots loading-lg"></span>
|
<span className="loading loading-dots loading-lg"></span>
|
||||||
|
@ -8,4 +6,4 @@ const Loading = () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Loading;
|
export default LoadingIndicator;
|
|
@ -6,7 +6,7 @@ import { useState } from "react";
|
||||||
import { IoEnterOutline, IoTrashBinOutline } from "react-icons/io5";
|
import { IoEnterOutline, IoTrashBinOutline } from "react-icons/io5";
|
||||||
import { env } from "@/env.mjs";
|
import { env } from "@/env.mjs";
|
||||||
import { trpc } from "../_trpc/client";
|
import { trpc } from "../_trpc/client";
|
||||||
import Loading from "./Loading";
|
import LoadingIndicator from "./LoadingIndicator";
|
||||||
import { useUser } from "@clerk/nextjs";
|
import { useUser } from "@clerk/nextjs";
|
||||||
|
|
||||||
export const dynamic = "force-dynamic";
|
export const dynamic = "force-dynamic";
|
||||||
|
@ -137,7 +137,7 @@ const RoomList = () => {
|
||||||
New Room
|
New Room
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
{roomsFromDb === undefined && <Loading />}
|
{roomsFromDb === undefined && <LoadingIndicator />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,7 +24,7 @@ import { env } from "@/env.mjs";
|
||||||
import { isAdmin, isVIP, jsonToCsv } from "@/utils/helpers";
|
import { isAdmin, isVIP, jsonToCsv } from "@/utils/helpers";
|
||||||
import type { PresenceItem } from "@/utils/types";
|
import type { PresenceItem } from "@/utils/types";
|
||||||
import { trpc } from "@/app/_trpc/client";
|
import { trpc } from "@/app/_trpc/client";
|
||||||
import Loading from "@/app/_components/Loading";
|
import LoadingIndicator from "@/app/_components/LoadingIndicator";
|
||||||
import { useUser } from "@clerk/nextjs";
|
import { useUser } from "@clerk/nextjs";
|
||||||
|
|
||||||
export const dynamic = "force-dynamic";
|
export const dynamic = "force-dynamic";
|
||||||
|
@ -211,7 +211,7 @@ const VoteUI = () => {
|
||||||
|
|
||||||
// Room is loading
|
// Room is loading
|
||||||
if (roomFromDb === undefined) {
|
if (roomFromDb === undefined) {
|
||||||
return <Loading />;
|
return <LoadingIndicator />;
|
||||||
// Room has been loaded
|
// Room has been loaded
|
||||||
} else if (roomFromDb) {
|
} else if (roomFromDb) {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -3,11 +3,12 @@ import { FaShieldAlt } from "react-icons/fa";
|
||||||
import { GiStarFormation } from "react-icons/gi";
|
import { GiStarFormation } from "react-icons/gi";
|
||||||
import { isAdmin, isVIP } from "@/utils/helpers";
|
import { isAdmin, isVIP } from "@/utils/helpers";
|
||||||
import { currentUser } from "@clerk/nextjs";
|
import { currentUser } from "@clerk/nextjs";
|
||||||
import { Suspense } from "react";
|
|
||||||
import Loading from "../_components/Loading";
|
|
||||||
|
|
||||||
export const runtime = "edge";
|
export const runtime = "edge";
|
||||||
export const preferredRegion = ["pdx1"];
|
export const preferredRegion = ["pdx1"];
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
export const revalidate = 0;
|
||||||
|
export const fetchCache = "force-no-store";
|
||||||
|
|
||||||
export default async function Dashboard() {
|
export default async function Dashboard() {
|
||||||
const user = await currentUser();
|
const user = await currentUser();
|
||||||
|
@ -24,9 +25,7 @@ export default async function Dashboard() {
|
||||||
)}
|
)}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<Suspense fallback={<Loading />}>
|
<RoomList />
|
||||||
<RoomList />
|
|
||||||
</Suspense>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
6
src/app/room/[id]/loading.tsx
Normal file
6
src/app/room/[id]/loading.tsx
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import LoadingIndicator from "@/app/_components/LoadingIndicator";
|
||||||
|
|
||||||
|
export default function Loading() {
|
||||||
|
// You can add any UI inside Loading, including a Skeleton.
|
||||||
|
return <LoadingIndicator />;
|
||||||
|
}
|
|
@ -1,16 +1,15 @@
|
||||||
import Loading from "@/app/_components/Loading";
|
|
||||||
import VoteUI from "@/app/_components/VoteUI";
|
import VoteUI from "@/app/_components/VoteUI";
|
||||||
import { Suspense } from "react";
|
|
||||||
|
|
||||||
export const runtime = "edge";
|
export const runtime = "edge";
|
||||||
export const preferredRegion = ["pdx1"];
|
export const preferredRegion = ["pdx1"];
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
export const revalidate = 0;
|
||||||
|
export const fetchCache = "force-no-store";
|
||||||
|
|
||||||
export default function Room() {
|
export default function Room() {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center justify-center text-center gap-2">
|
<div className="flex flex-col items-center justify-center text-center gap-2">
|
||||||
<Suspense fallback={<Loading />}>
|
<VoteUI />
|
||||||
<VoteUI />
|
|
||||||
</Suspense>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue