From a2c226b5a8fb818b07cf966c23920ad0c1e39e92 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Wed, 16 Apr 2025 12:54:50 +0330 Subject: [PATCH] docker file --- next.config.ts | 62 ++++++++++++++++++------------------- src/app/blogs/[id]/page.tsx | 24 +++++++------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/next.config.ts b/next.config.ts index cdc7519..ef2c3d5 100644 --- a/next.config.ts +++ b/next.config.ts @@ -17,37 +17,37 @@ const nextConfig: NextConfig = { }, ], }, - // headers: async () => [ - // { - // source: "/:path*", - // headers: [ - // { - // key: "X-DNS-Prefetch-Control", - // value: "on", - // }, - // { - // key: "Strict-Transport-Security", - // value: "max-age=63072000; includeSubDomains; preload", - // }, - // { - // key: "X-XSS-Protection", - // value: "1; mode=block", - // }, - // { - // key: "X-Frame-Options", - // value: "SAMEORIGIN", - // }, - // { - // key: "X-Content-Type-Options", - // value: "nosniff", - // }, - // { - // key: "Referrer-Policy", - // value: "origin-when-cross-origin", - // }, - // ], - // }, - // ], + headers: async () => [ + { + source: "/:path*", + headers: [ + { + key: "X-DNS-Prefetch-Control", + value: "on", + }, + { + key: "Strict-Transport-Security", + value: "max-age=63072000; includeSubDomains; preload", + }, + { + key: "X-XSS-Protection", + value: "1; mode=block", + }, + { + key: "X-Frame-Options", + value: "SAMEORIGIN", + }, + { + key: "X-Content-Type-Options", + value: "nosniff", + }, + { + key: "Referrer-Policy", + value: "origin-when-cross-origin", + }, + ], + }, + ], }; export default nextConfig; diff --git a/src/app/blogs/[id]/page.tsx b/src/app/blogs/[id]/page.tsx index d12f3be..91fbed1 100644 --- a/src/app/blogs/[id]/page.tsx +++ b/src/app/blogs/[id]/page.tsx @@ -1,24 +1,24 @@ import { Suspense } from 'react' import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query' -import { blogSingleQueryOptions } from '../hooks/useBlogsData' +import { blogSingleQueryOptions, mostVisitedBlogsQueryOptions } from '../hooks/useBlogsData' import { NextPage } from 'next' import SingleBlogPage from '../components/SingleBlogPage' import Loading from './loading' -// interface PageProps { -// params: Promise<{ -// id: string -// }> -// } +interface PageProps { + params: Promise<{ + id: string + }> +} -const SingleBlog: NextPage = async () => { +const SingleBlog: NextPage = async ({ params }) => { - // const { id } = await params - // console.log("loading", id); + const { id } = await params + console.log("loading", id); return ( }> - + ) } @@ -28,8 +28,8 @@ async function BlogContent({ id }: { id: string }) { const queryClient = new QueryClient() await Promise.all([ - queryClient.prefetchQuery(blogSingleQueryOptions('7539fa00-e8e0-4b2b-a4b5-655284b5e8a1')), - // queryClient.prefetchQuery(mostVisitedBlogsQueryOptions) + queryClient.prefetchQuery(blogSingleQueryOptions(id)), + queryClient.prefetchQuery(mostVisitedBlogsQueryOptions) ]) return (