Skip to content

Commit 089d79b

Browse files
committed
fix : sidebar newspage position & update nextConfig & add news section in frist page
1 parent 39e7519 commit 089d79b

5 files changed

Lines changed: 344 additions & 219 deletions

File tree

next.config.js

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
const nextConfig = {
77
// 🔹 فعال‌کردن سورس‌مپ در پروداکشن (برای رفع هشدار Missing source maps)
88
productionBrowserSourceMaps: true,
9-
output: 'standalone',
9+
output: "standalone",
1010
logging: {
1111
fetches: {
1212
fullUrl: true,
@@ -15,19 +15,19 @@ const nextConfig = {
1515
async redirects() {
1616
return [
1717
{
18-
source: '/',
19-
destination: '/fa',
18+
source: "/",
19+
destination: "/fa",
2020
permanent: true,
2121
basePath: false,
2222
},
2323
{
24-
source: '/:lang/citizen',
25-
destination: '/:lang/citizens',
24+
source: "/:lang/citizen",
25+
destination: "/:lang/citizens",
2626
permanent: true,
2727
},
2828
{
29-
source: '/:lang/citizen/:id',
30-
destination: '/:lang/citizens/:id',
29+
source: "/:lang/citizen/:id",
30+
destination: "/:lang/citizens/:id",
3131
permanent: true,
3232
},
3333
];
@@ -37,21 +37,21 @@ const nextConfig = {
3737
return [
3838
{
3939
// 📌 کش برای تصاویر (یک‌ساله + immutable)
40-
source: '/uploads/calendars/:path*',
40+
source: "/uploads/calendars/:path*",
4141
headers: [
4242
{
43-
key: 'Cache-Control',
44-
value: 'public, max-age=31536000, immutable',
43+
key: "Cache-Control",
44+
value: "public, max-age=31536000, immutable",
4545
},
4646
],
4747
},
4848
{
4949
// 📌 کش برای فونت‌ها
50-
source: '/fonts/:path*',
50+
source: "/fonts/:path*",
5151
headers: [
5252
{
53-
key: 'Cache-Control',
54-
value: 'public, max-age=31536000, immutable',
53+
key: "Cache-Control",
54+
value: "public, max-age=31536000, immutable",
5555
},
5656
],
5757
},
@@ -68,7 +68,7 @@ const nextConfig = {
6868
// 🔹 پشتیبانی از فایل‌های SVG
6969
config.module.rules.push({
7070
test: /\.svg$/,
71-
use: [{ loader: '@svgr/webpack', options: { icon: true } }],
71+
use: [{ loader: "@svgr/webpack", options: { icon: true } }],
7272
});
7373

7474
return config;
@@ -78,28 +78,43 @@ const nextConfig = {
7878
deviceSizes: [320, 480, 640, 768, 1024, 1280, 1536],
7979
imageSizes: [16, 32, 64, 128, 256, 384, 512, 540, 600],
8080
qualities: [25, 50, 75],
81-
formats: ['image/avif', 'image/webp'],
81+
formats: ["image/avif", "image/webp"],
8282
remotePatterns: [
83-
{ protocol: 'https', hostname: 'dl.qzparadise.ir' },
84-
{ protocol: 'https', hostname: 'api.metarang.com' },
85-
{ protocol: 'https', hostname: 'api.rgb.irpsc.com' },
86-
{ protocol: 'https', hostname: 'admin.metarang.com' },
87-
{ protocol: 'https', hostname: 'admin.rgb.irpsc.com' },
88-
{ protocol: 'https', hostname: 'dev-nextjs.metarang.com' },
89-
{ protocol: 'https', hostname: '*.irpsc.com' },
90-
{ protocol: 'https', hostname: 'rgb.irpsc.com' },
91-
{ protocol: 'http', hostname: 'rgb.irpsc.com' },
92-
{ protocol: 'https', hostname: 'metarang.com' },
93-
{ protocol: 'http', hostname: 'localhost' },
94-
{ protocol: 'https', hostname: 'irpsc.com' },
95-
{ protocol: 'https', hostname: 'frdevelop2.irpsc.com' },
96-
{ protocol: 'https', hostname: 'supabase.com' },
97-
{ protocol: 'https', hostname: '3d.irpsc.com' },
98-
{ protocol: 'https', hostname: 'metarang.com' },
83+
{ protocol: "https", hostname: "metarang.com", pathname: "/**", },
84+
{ protocol: "https", hostname: "api.metarang.com", pathname: "/**", },
85+
{ protocol: "http", hostname: "api.metarang.com", pathname: "/**", },
86+
{
87+
protocol: "https",
88+
hostname: "admin.metarang.com",
89+
pathname: "/**",
90+
},
91+
{
92+
protocol: "http",
93+
hostname: "admin.metarang.com",
94+
pathname: "/**",
95+
},
96+
{ protocol: "https", hostname: "admin.rgb.irpsc.com" },
97+
{ protocol: "https", hostname: "api.rgb.irpsc.com", pathname: "/**", },
98+
{ protocol: "https", hostname: "dev-nextjs.metarang.com" },
99+
{
100+
protocol: "https",
101+
hostname: "**.irpsc.com",
102+
},
103+
{ protocol: "https", hostname: "rgb.irpsc.com" },
104+
{ protocol: "http", hostname: "rgb.irpsc.com" },
105+
{ protocol: "http", hostname: "localhost" },
106+
{
107+
protocol: "https",
108+
hostname: "**.irpsc.com",
109+
pathname: "/**",
110+
},
111+
{ protocol: "https", hostname: "frdevelop2.irpsc.com" },
112+
{ protocol: "https", hostname: "supabase.com" },
113+
{ protocol: "https", hostname: "3d.irpsc.com" },
114+
{ protocol: "https", hostname: "dl.qzparadise.ir" },
99115

100116
],
101117
},
102-
103118
};
104119

105-
module.exports = nextConfig;
120+
module.exports = nextConfig;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ const SideCard: React.FC<SideCardProps> = ({ params, mainData }) => {
6969
return (
7070
<section className="flex flex-col gap-5 w-full">
7171
<div className="flex items-center justify-between">
72-
<div className="h-6 w-32 bg-neutral-200 dark:bg-neutral-700 rounded relative overflow-hidden">
72+
<div className="h-6 w-32 bg-neutral-200 dark:bg-neutral-700 rounded relative">
7373
<div className="absolute inset-0 bg-gradient-to-r from-gray-200 via-gray-300 to-gray-200 dark:from-gray-700 dark:via-gray-600 dark:to-gray-700 animate-pulse" />
7474
</div>
75-
<div className="h-5 w-16 bg-neutral-200 dark:bg-neutral-700 rounded relative overflow-hidden">
75+
<div className="h-5 w-16 bg-neutral-200 dark:bg-neutral-700 rounded relative ">
7676
<div className="absolute inset-0 bg-gradient-to-r from-gray-200 via-gray-300 to-gray-200 dark:from-gray-700 dark:via-gray-600 dark:to-gray-700 animate-pulse" />
7777
</div>
7878
</div>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ export default async function NewsPage({ params }: NewsPageProps) {
398398
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
399399
/>
400400
<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">
401+
<Link aria-label="SocialLink" href={"#em"} className="bg-light-primary dark:bg-dark-yellow rounded-full w-[60px] h-[60px] flex items-center justify-center">
402402

403403
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
404404
<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" />
@@ -411,12 +411,12 @@ export default async function NewsPage({ params }: NewsPageProps) {
411411
</Link>
412412
</div>
413413
<CleanAutoRetryParam />
414-
<section className="w-full overflow-y-auto relative bg-[#f8f8f8] dark:bg-black mt-[60px] lg:mt-0">
414+
<section className="w-full bg-[#f8f8f8] dark:bg-black mt-[60px] lg:mt-0">
415415
<div className="px-5 2xl:px-10">
416416
<BreadCrumb params={resolvedParams} title={news.title} articleCat={news.category || ""} />
417417
</div>
418418

419-
<div className="mainContainer w-full flex flex-col gap-5 items-center lg:flex-row lg:items-start px-5 lg:px-10">
419+
<div className="mainContainer w-full flex flex-col gap-5 items-center lg:flex-row lg:items-start px-5 lg:px-10 ">
420420
{/* محتوای اصلی */}
421421
<div className="lg:w-[70%] 3xl:w-[80%]">
422422
<div className="flex flex-col gap-10 w-full items-center rounded-xl bg-white dark:bg-[#1A1A18] shadow-lg p-5 xl:p-10">
@@ -470,7 +470,7 @@ export default async function NewsPage({ params }: NewsPageProps) {
470470
</div>
471471
</div>
472472

473-
<div className="w-full hidden lg:block lg:w-[30%] 3xl:w-[20%] sticky top-5">
473+
<div className="w-full hidden lg:block lg:w-[30%] 3xl:w-[20%] sticky self-start z-10 top-5">
474474
<SideCard params={resolvedParams} mainData={mainData} />
475475
</div>
476476
</div>

src/app/[lang]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import TopTrainersFirstPage, { getTopTrainerUsers } from "@/components/templates
1616
const EducationFirstPage = React.lazy(() => import('@/components/templates/firstpage/EducationFirstPage'));
1717
const DetailsEducationSection = React.lazy(() => import('@/components/templates/firstpage/DetailsEducationSection'));
1818
const VersionSection = React.lazy(() => import('@/components/templates/firstpage/VersionSection'));
19-
import LastContent from '@/components/templates/firstpage/LastContent.client';
19+
// import LastContent from '@/components/templates/firstpage/LastContent.client';
2020
import {
2121
getTranslation,
2222
getMainFile,
@@ -277,11 +277,11 @@ const viewportWidth = headersList.get('viewport-width'); // حالا امن ا
277277
<EducationFirstPage params={resolvedParams} mainData={mainData} />
278278
</Suspense>
279279
</div>
280-
<div className="w-[90%] h-fit mt-[60px] xl:mt-[100px] 2xl:mt-[180px]">
280+
{/* <div className="w-[90%] h-fit mt-[60px] xl:mt-[100px] 2xl:mt-[180px]">
281281
<Suspense fallback={<div>Loading Header...</div>}>
282282
<LastContent mainData={mainData} params={resolvedParams} />
283283
</Suspense>
284-
</div>
284+
</div> */}
285285
<div className="w-[90%] relative h-fit mt-[60px] xl:mt-[100px] 2xl:mt-[180px]">
286286
<Suspense fallback={<div>Loading Header...</div>}>
287287
<DetailsEducationSection mainData={mainData} />

0 commit comments

Comments
 (0)