diff --git a/apps/web-next/src/app/about/page.tsx b/apps/web-next/src/app/about/page.tsx index 5f89088..b4753d7 100644 --- a/apps/web-next/src/app/about/page.tsx +++ b/apps/web-next/src/app/about/page.tsx @@ -1,35 +1,12 @@ -import { dehydrate, HydrationBoundary } from "@tanstack/react-query"; -import { appRouter } from "@repo/core-api"; -import { getQueryClient } from "@repo/core-trpc"; import { PageContent } from "@repo/marketing-pages/ui"; +import { bindAll } from "../../server/bind-production"; export default async function AboutPage() { - const caller = appRouter.createCaller({}); - const queryClient = getQueryClient(); - - const page = await caller.marketingPages.pageBySlug({ slug: "about" }); - - queryClient.setQueryData( - ["marketingPages", "pageBySlug", { input: { slug: "about" } }], - page, - ); - - if (!page) { - return ( -
-

About

-

- This page hasn't been published yet. -

-
- ); - } + await bindAll(); return ( - -
- -
-
+
+ +
); } diff --git a/apps/web-next/src/app/blog/[slug]/page.tsx b/apps/web-next/src/app/blog/[slug]/page.tsx index c637dcd..a86b11b 100644 --- a/apps/web-next/src/app/blog/[slug]/page.tsx +++ b/apps/web-next/src/app/blog/[slug]/page.tsx @@ -1,32 +1,17 @@ -import { notFound } from "next/navigation"; -import { dehydrate, HydrationBoundary } from "@tanstack/react-query"; -import { appRouter } from "@repo/core-api"; -import { getQueryClient } from "@repo/core-trpc"; import { ArticleDetail } from "@repo/blog/ui"; +import { bindAll } from "../../../server/bind-production"; type PageProps = { params: Promise<{ slug: string }>; }; export default async function BlogPostPage({ params }: PageProps) { + await bindAll(); const { slug } = await params; - const caller = appRouter.createCaller({}); - const queryClient = getQueryClient(); - - const article = await caller.blog.articleBySlug({ slug }); - - if (!article) notFound(); - - queryClient.setQueryData( - ["blog", "articleBySlug", { input: { slug } }], - article, - ); return ( - -
- -
-
+
+ +
); } diff --git a/apps/web-next/src/app/page.tsx b/apps/web-next/src/app/page.tsx index fa18e7c..a14f42e 100644 --- a/apps/web-next/src/app/page.tsx +++ b/apps/web-next/src/app/page.tsx @@ -1,37 +1,15 @@ -import { dehydrate, HydrationBoundary } from "@tanstack/react-query"; -import { appRouter } from "@repo/core-api"; -import { getQueryClient } from "@repo/core-trpc"; -import { SiteHeader } from "@repo/navigation/ui"; import { ArticleList } from "@repo/blog/ui"; +import { bindAll } from "../server/bind-production"; export default async function Home() { - const caller = appRouter.createCaller({}); - const queryClient = getQueryClient(); - - const [siteSettings, header, articles] = await Promise.all([ - caller.marketingPages.siteSettings({}), - caller.navigation.header({}), - caller.blog.listArticles({ status: "published", limit: 20 }), - ]); - - queryClient.setQueryData(["navigation", "header", { input: {} }], header); - queryClient.setQueryData( - ["blog", "listArticles", { input: { status: "published", limit: 20 } }], - articles, - ); + await bindAll(); return ( - - -
-

- Latest articles -

- -
-
+
+

+ Latest articles +

+ +
); }