From 893013df33854af0b55d1d83785c43243bd8d859 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Tue, 22 Apr 2025 10:58:32 +0330 Subject: [PATCH] title pages and ... --- public/images/linkedin3.svg | 44 +++++++++++++++++++ src/app/about/page.tsx | 15 ++++++- src/app/blogs/[id]/page.tsx | 17 +++++++ src/app/blogs/components/ContactUs.tsx | 2 +- src/app/blogs/page.tsx | 10 ++++- src/app/danak-services/page.tsx | 13 ++++++ src/app/page.tsx | 14 ++++++ src/app/products/[id]/page.tsx | 19 +++++++- src/app/products/components/ServiceHeader.tsx | 2 +- src/app/products/page.tsx | 14 ++++++ 10 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 public/images/linkedin3.svg diff --git a/public/images/linkedin3.svg b/public/images/linkedin3.svg new file mode 100644 index 0000000..ffb1d70 --- /dev/null +++ b/public/images/linkedin3.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index f0d7f07..4f1a8d9 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -5,6 +5,19 @@ import React from 'react' import Accordion from '@/components/Accordion' import WhyDanak from '../home/WhyDanak' +export const metadata = { + title: 'داناک | درباره ما', + description: 'درباره ما', + openGraph: { + title: 'داناک | درباره ما', + description: 'درباره ما', + url: 'https://danakcorp.com/about', + siteName: 'داناک', + locale: 'fa_IR', + type: 'website', + }, +} + const About: NextPage = () => { return (
@@ -62,7 +75,7 @@ const About: NextPage = () => { مشاوره استقرار ISMS
- نظام صنفی + نظام صنفی رایانه ای
GDPR diff --git a/src/app/blogs/[id]/page.tsx b/src/app/blogs/[id]/page.tsx index 8a66de3..0da7468 100644 --- a/src/app/blogs/[id]/page.tsx +++ b/src/app/blogs/[id]/page.tsx @@ -1,9 +1,11 @@ +import { Metadata } from 'next' import { Suspense } from 'react' import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query' import { blogSingleQueryOptions, mostVisitedBlogsQueryOptions } from '../hooks/useBlogsData' import { NextPage } from 'next' import SingleBlogPage from '../components/SingleBlogPage' import Loading from './loading' +import { BlogSingleResponse } from '../types/BlogTypes' interface PageProps { params: Promise<{ @@ -11,6 +13,21 @@ interface PageProps { }> } +export async function generateMetadata( + { params }: PageProps +): Promise { + const { id } = await params + const queryClient = new QueryClient() + + await queryClient.prefetchQuery(blogSingleQueryOptions(id)) + const blog = queryClient.getQueryData(blogSingleQueryOptions(id).queryKey) as BlogSingleResponse + + return { + title: 'مجله داناک' + ' | ' + blog.data.blog.metaTitle, + description: blog.data.blog.metaDescription, + } +} + const SingleBlog: NextPage = async ({ params }) => { const { id } = await params diff --git a/src/app/blogs/components/ContactUs.tsx b/src/app/blogs/components/ContactUs.tsx index c80dda8..ead6614 100644 --- a/src/app/blogs/components/ContactUs.tsx +++ b/src/app/blogs/components/ContactUs.tsx @@ -11,7 +11,7 @@ const ContactUs: FC = () => {
contact us { return ( }> diff --git a/src/app/page.tsx b/src/app/page.tsx index cfda450..7860e7e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -7,6 +7,20 @@ import { landingQueryOptions } from './home/hooks/useHomeData' import LangingPage from './home/LangingPage' import Loading from './loading' +export const metadata = { + title: 'شرکت نرم افزاری داناک', + description: 'ارائه راهکارهای مبتنی بر تکنولوژی نوآورانه برای بهبود کسب‌وکار، افزایش بهره‌وری و رشد پایدار', + openGraph: { + title: 'شرکت نرم افزاری داناک', + description: 'ارائه راهکارهای مبتنی بر تکنولوژی نوآورانه برای بهبود کسب‌وکار، افزایش بهره‌وری و رشد پایدار', + url: 'https://danakcorp.com/', + siteName: 'شرکت نرم افزاری داناک', + locale: 'fa_IR', + type: 'website', + }, +} + + const Home: NextPage = () => { return ( }> diff --git a/src/app/products/[id]/page.tsx b/src/app/products/[id]/page.tsx index 4e36e06..4003710 100644 --- a/src/app/products/[id]/page.tsx +++ b/src/app/products/[id]/page.tsx @@ -1,9 +1,10 @@ import { Suspense } from 'react' import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query' import { detailServiceQueryOptions } from '../hooks/useProductData' -import { NextPage } from 'next' +import { Metadata, NextPage } from 'next' import DetailService from '../DetailService' import Loading from './loading' +import { ServiceDetailResponse } from '../types/ProductTypes' interface PageProps { params: Promise<{ @@ -11,6 +12,22 @@ interface PageProps { }> } + +export async function generateMetadata( + { params }: PageProps +): Promise { + const { id } = await params + const queryClient = new QueryClient() + + await queryClient.prefetchQuery(detailServiceQueryOptions(id)) + const service = queryClient.getQueryData(detailServiceQueryOptions(id).queryKey) as ServiceDetailResponse + + return { + title: 'مجله داناک' + ' | ' + service.data.danakService.name, + description: service.data.danakService.metaDescription, + } +} + const SingleService: NextPage = async ({ params }) => { const { id } = await params diff --git a/src/app/products/components/ServiceHeader.tsx b/src/app/products/components/ServiceHeader.tsx index 5fd82a6..9639199 100644 --- a/src/app/products/components/ServiceHeader.tsx +++ b/src/app/products/components/ServiceHeader.tsx @@ -77,7 +77,7 @@ const ServiceHeader: FC = (props: Props) => {
{ - finalPrice !== price && + finalPrice !== price && !!price &&
{NumberFormat(Number(price))}
diff --git a/src/app/products/page.tsx b/src/app/products/page.tsx index bdffd95..322311d 100644 --- a/src/app/products/page.tsx +++ b/src/app/products/page.tsx @@ -7,6 +7,20 @@ import { categoriesQueryOptions, danakServiceSuggestedQueryOptions, servicesQuer import Products from './ProductsPage' import Loading from './loading' +export const metadata = { + title: 'داناک | محصولات', + description: 'محصولات و خدمات ما', + openGraph: { + title: 'داناک | محصولات', + description: 'محصولات و خدمات ما', + url: 'https://danakcorp.com/products', + siteName: 'داناک', + locale: 'fa_IR', + type: 'website', + }, +} + + const ProductsPage: NextPage = () => { return ( }>