Skip to content

Commit 8427944

Browse files
authored
Merge pull request #82 from iranpsc/newspage
add ad section
2 parents 01a1eb3 + 00fb0ad commit 8427944

5 files changed

Lines changed: 70 additions & 6 deletions

File tree

public/adNews.png

78.7 KB
Loading

src/app/[lang]/layout.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,19 @@ export default async function LangLayout({
114114
</Suspense>
115115

116116
<div className='flex flex-col w-full h-screen overflow-y-auto light-scrollbar dark:dark-scrollbar'>
117-
<Suspense fallback={<div>Loading Content...</div>}>
117+
<Suspense fallback={<div className="fixed top-0 left-0 bottom-0 w-full h-screen !z-[70] flex items-center justify-center bg-black/60 backdrop-blur-sm" >
118+
<div className="container flex w-full h-screen items-center justify-center md:ms-[25vw] lg:ms-[17vw] xl:ms-[15vw] 3xl:ms-[16vw]">
119+
<div className="holder">
120+
<div className="box"></div>
121+
</div>
122+
<div className="holder">
123+
<div className="box"></div>
124+
</div>
125+
<div className="holder">
126+
<div className="box"></div>
127+
</div>
128+
</div>
129+
</div>}>
118130
{children}
119131
<div className="w-full xl:px-32 lg:px-32 md:px-5 sm:px-5 xs:px-1 bg-[#f8f8f8] dark:bg-black">
120132
<FooterClient footerTabs={footerTabs} mainData={mainData} params={resolvedParams} />
@@ -123,7 +135,7 @@ export default async function LangLayout({
123135
</div>
124136

125137
<a
126-
href="https://t.me/metargb"
138+
href="https://web.bale.ai/chat?uid=4677411537"
127139
aria-label="Join us on Telegram"
128140
target='_blank'
129141
title="همکاری در توسعه متارنگ"

src/app/[lang]/news/categories/[category]/[slug]/components/NewsGallery.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ export default function NewsGallerySimple({ gallery, mainImage , params }: NewsG
139139
<>
140140
{/* پیش‌نمایش گالری گرید - تعداد متغیر بر اساس دستگاه */}
141141
<div className="w-full my-8">
142-
<div className={`grid gap-3 md:gap-4 ${
142+
<div className={`grid gap-3 md:gap-3 ${
143143
displayCount === 4
144-
? 'grid-cols-4' // موبایل: 4 ستون
144+
? 'grid-cols-2' // موبایل: 4 ستون
145145
: 'grid-cols-3' // دسکتاپ: 3 ستون
146146
}`}>
147147
{previewImages.map((img, idx) => (
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// components/WindowsNews.tsx
2+
import React from 'react';
3+
import Image from 'next/image';
4+
5+
const WindowsNews = () => {
6+
return (
7+
<div className=" mx-auto w-full bg-gradient-to-r to-light-primary from-blue-400 dark:to-dark-yellow dark:from-yellow-600 rounded-xl overflow-hidden my-10 p-5">
8+
<div className="p-6 flex flex-col md:flex-row justify-between" dir="rtl">
9+
<div className='w-[300px] mx-auto lg:mx-0 relative'>
10+
<div className='bg-[#5d9eff80] dark:bg-[#d8a90054] w-[240px] h-[240px] rounded-full relative z-0' />
11+
<Image src={'/adNews.png'} fill alt={'ad pic'} className=' w-full max-w-[270px] !h-auto z-10 my-auto ms-[-15px]' />
12+
</div>
13+
<div className=" flex flex-col gap-4">
14+
<p className="text-xl lg:text-3xl font-rokh font-bold text-white dark:text-black">
15+
عرضه‌ی جدیدترین نسخه ویندوز به بازار
16+
</p>
17+
<p className='text-white dark:text-black max-w-3xl'>
18+
ماکروسافت نسخه جایگزین ویندوز ۸.۱ را با نام ویندوز ۱۰ به صورت رسمی منتشر کرد.
19+
ماکروسافت منوی استارترا که با معرفی ویندوز ۸ حذف شده بود،
20+
به محیط دسکتاپ ویندوز ۱۰ بازگردانده است. سیستم جستجو در ویندوز ۱۰ بهبود یافته و
21+
پشتیبانی از ماوس و صفحه‌کلید نیز بهتر شده است.
22+
</p>
23+
</div>
24+
25+
<div className=" flex items-center lg:items-end lg:pe-10">
26+
<button className="bg-black w-max text-light-primary dark:text-dark-yellow font-bold py-3 px-6 rounded-lg transition duration-300 shadow-md flex items-center gap-2">
27+
آموزش نصب
28+
</button>
29+
</div>
30+
</div>
31+
</div>
32+
);
33+
};
34+
35+
export default WindowsNews;

src/app/[lang]/news/categories/[category]/[slug]/page.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import CustomErrorPage from "@/components/shared/CustomErrorPage";
2424
import CleanAutoRetryParam from "@/components/shared/CleanAutoRetryParam";
2525
import NewsTags from "./components/NewsTags";
2626
import fallbackNewsData from "@/components/utils/news.json";
27+
import WindowsNews from "./components/WindowsNews"
28+
import Link from "next/link";
2729

2830
interface NewsPageProps {
2931
params: Promise<{
@@ -395,6 +397,19 @@ export default async function NewsPage({ params }: NewsPageProps) {
395397
type="application/ld+json"
396398
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
397399
/>
400+
<div className="fixed z-[1000] end-10 bottom-[100px]">
401+
<Link href={"#em"} className="bg-light-primary dark:bg-dark-yellow rounded-full w-[60px] h-[60px] flex items-center justify-center">
402+
403+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
404+
<path className="stroke-white dark:stroke-black" d="M22 11.5V15.5C22 19 20 20.5 17 20.5H7C4 20.5 2 19 2 15.5V8.5C2 5 4 3.5 7 3.5H12" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
405+
<path className="stroke-white dark:stroke-black" d="M7 9L11 11.5C12.048 12.2897 13.952 11.2897 15 10.5" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
406+
<path d="M19.0062 1.96875C17.9029 1.96875 17.0062 2.86542 17.0062 3.96875V4.93208C17.0062 5.13542 16.9195 5.44542 16.8162 5.61875L16.4329 6.25542C16.1962 6.64875 16.3595 7.08542 16.7929 7.23208C18.2295 7.71208 19.7795 7.71208 21.2162 7.23208C21.6195 7.09875 21.7962 6.62208 21.5762 6.25542L21.1929 5.61875C21.0929 5.44542 21.0062 5.13542 21.0062 4.93208V3.96875C21.0062 2.86875 20.1062 1.96875 19.0062 1.96875Z" stroke="#18C08F" stroke-miterlimit="10" stroke-linecap="round" />
407+
<path className="stroke-white dark:stroke-black" d="M19.623 2.06844C19.5196 2.03844 19.413 2.0151 19.303 2.00177C18.983 1.96177 18.6763 1.9851 18.3896 2.06844C18.4863 1.82177 18.7263 1.64844 19.0063 1.64844C19.2863 1.64844 19.5263 1.82177 19.623 2.06844Z" stroke-width="0.8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
408+
<path className="stroke-white dark:stroke-black" d="M20.0068 7.35156C20.0068 7.90156 19.5568 8.35156 19.0068 8.35156C18.7335 8.35156 18.4802 8.23823 18.3002 8.05823C18.1202 7.87823 18.0068 7.6249 18.0068 7.35156" stroke-miterlimit="10" />
409+
</svg>
410+
411+
</Link>
412+
</div>
398413
<CleanAutoRetryParam />
399414
<section className="w-full overflow-y-auto relative bg-[#f8f8f8] dark:bg-black mt-[60px] lg:mt-0">
400415
<div className="px-5 2xl:px-10">
@@ -431,7 +446,7 @@ export default async function NewsPage({ params }: NewsPageProps) {
431446
params={resolvedParams}
432447
mainData={mainData}
433448
/>
434-
<NewsContent content={news.content} gallery={news.gallery} params={resolvedParams}/>
449+
<NewsContent content={news.content} gallery={news.gallery} params={resolvedParams} />
435450
<NewsStats
436451
stats={news.stats}
437452
category={news.category}
@@ -451,16 +466,18 @@ export default async function NewsPage({ params }: NewsPageProps) {
451466
<div className="w-full mt-10 space-y-28">
452467
<ShowSocialWrapper params={resolvedParams} mainData={mainData} news={news} />
453468
<PrevNextNews params={resolvedParams} news={categoryNews || []} mainData={mainData} />
469+
<WindowsNews />
454470
</div>
455471
</div>
456472
<div className="w-full hidden lg:block lg:w-[30%] 3xl:w-[20%] sticky top-5">
457473
<SideCard params={resolvedParams} mainData={mainData} />
458474
</div>
459475
</div>
460476
<div className="ps-5 lg:ps-10 w-full flex items-center mt-14 lg:mt-20 flex-col gap-14">
477+
461478
<PopularNews params={resolvedParams} mainData={mainData} initialNews={[]} />
462479
</div>
463-
<div className="w-full px-5 flex flex-col items-center mt-10">
480+
<div id="em" className="w-full px-5 flex flex-col items-center mt-10">
464481
<svg xmlns="http://www.w3.org/2000/svg" width="364" height="364" viewBox="0 0 364 364" fill="none" className="mb-[-140px] dark:hidden">
465482
<path d="M333.666 174.419V235.086C333.666 288.169 303.333 310.919 257.833 310.919H106.166C60.6663 310.919 30.333 288.169 30.333 235.086V128.919C30.333 75.8359 60.6663 53.0859 106.166 53.0859H182" stroke="url(#paint0_linear_4633_15252)" strokeWidth="6" strokeMiterlimit="10" strokeLinecap="round" strokeLinejoin="round" />
466483
<path d="M106.167 136.5L166.834 174.417C182.728 186.394 211.606 171.228 227.5 159.25" stroke="url(#paint1_linear_4633_15252)" strokeWidth="6" strokeMiterlimit="10" strokeLinecap="round" strokeLinejoin="round" />

0 commit comments

Comments
 (0)