mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
trying to get nextjs fast
This commit is contained in:
@@ -81,7 +81,8 @@ function Pages({ moduleName, day }: { moduleName: string; day: string }) {
|
||||
encodeURIComponent(moduleName) +
|
||||
"/page/" +
|
||||
encodeURIComponent(p.name)
|
||||
} shallow={true}
|
||||
}
|
||||
shallow={true}
|
||||
>
|
||||
{p.name}
|
||||
</Link>
|
||||
@@ -142,7 +143,8 @@ function Quizzes({ moduleName, day }: { moduleName: string; day: string }) {
|
||||
encodeURIComponent(moduleName) +
|
||||
"/quiz/" +
|
||||
encodeURIComponent(q.name)
|
||||
} shallow={true}
|
||||
}
|
||||
shallow={true}
|
||||
>
|
||||
{q.name}
|
||||
</Link>
|
||||
@@ -204,7 +206,8 @@ function Assignments({ moduleName, day }: { moduleName: string; day: string }) {
|
||||
encodeURIComponent(moduleName) +
|
||||
"/assignment/" +
|
||||
encodeURIComponent(a.name)
|
||||
} shallow={true}
|
||||
}
|
||||
shallow={true}
|
||||
>
|
||||
{a.name}
|
||||
</Link>
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
|
||||
import { getQueryClient } from "@/app/providersQueryClientUtils";
|
||||
import { hydrateCourse } from "@/hooks/hookHydration";
|
||||
import CourseContextProvider from "./context/CourseContextProvider";
|
||||
import { Suspense } from "react";
|
||||
|
||||
@@ -16,18 +13,10 @@ export default async function CourseLayout({
|
||||
console.log("cannot load course that is .js.map " + decodedCourseName);
|
||||
return <div></div>;
|
||||
}
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
await hydrateCourse(queryClient, decodedCourseName);
|
||||
const dehydratedState = dehydrate(queryClient);
|
||||
|
||||
// console.log("hydrated course state", courseName, dehydratedState);
|
||||
return (
|
||||
<Suspense>
|
||||
<CourseContextProvider localCourseName={decodedCourseName}>
|
||||
<HydrationBoundary state={dehydratedState}>
|
||||
{children}
|
||||
</HydrationBoundary>
|
||||
{children}
|
||||
</CourseContextProvider>
|
||||
</Suspense>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user