From de1f307574921f9a38037ef9cb79b5afc496d19d Mon Sep 17 00:00:00 2001 From: Ehsan Date: Mon, 12 May 2025 23:04:52 +0330 Subject: [PATCH] handle active list header links --- app/about-us/page.js | 2 +- app/blogs/page.js | 2 +- app/clinics/page.js | 2 +- app/contact-us/page.js | 2 +- app/page.js | 2 +- app/specialties/page.js | 2 +- components/layout/StLayout.js | 4 ++-- components/layout/header/list/Row.js | 13 ++++++------- helper/index.js | 5 +---- 9 files changed, 15 insertions(+), 19 deletions(-) diff --git a/app/about-us/page.js b/app/about-us/page.js index a1ab82c..6250812 100644 --- a/app/about-us/page.js +++ b/app/about-us/page.js @@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout"; function AboutUs() { return ( - + ); diff --git a/app/blogs/page.js b/app/blogs/page.js index 5232f7b..8afea25 100644 --- a/app/blogs/page.js +++ b/app/blogs/page.js @@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout"; function Blogs() { return ( - + ); diff --git a/app/clinics/page.js b/app/clinics/page.js index 7adbf3f..4c89a3f 100644 --- a/app/clinics/page.js +++ b/app/clinics/page.js @@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout"; function Clinics() { return ( - + ); diff --git a/app/contact-us/page.js b/app/contact-us/page.js index 61595d6..d63877b 100644 --- a/app/contact-us/page.js +++ b/app/contact-us/page.js @@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout"; function ContactUs() { return ( - + ); diff --git a/app/page.js b/app/page.js index b492f75..ed4c21c 100644 --- a/app/page.js +++ b/app/page.js @@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout"; export default function Home() { return ( - + ); diff --git a/app/specialties/page.js b/app/specialties/page.js index ddcd60c..f8764e9 100644 --- a/app/specialties/page.js +++ b/app/specialties/page.js @@ -3,7 +3,7 @@ import SpecialtiesPage from "@/components/specialties"; function Specialties() { return ( - + ); diff --git a/components/layout/StLayout.js b/components/layout/StLayout.js index 0c6c313..ae04960 100644 --- a/components/layout/StLayout.js +++ b/components/layout/StLayout.js @@ -2,7 +2,7 @@ import { getStateInfo } from "@/lib/getStateInfo"; import Footer from "./footer"; import Header from "./header"; -function StLayout({ children }) { +function StLayout({ children, name }) { const { matchedCity } = getStateInfo(); return ( @@ -10,7 +10,7 @@ function StLayout({ children }) {
-
+
{nav.name} diff --git a/helper/index.js b/helper/index.js index 1f8489d..9414033 100644 --- a/helper/index.js +++ b/helper/index.js @@ -6,15 +6,12 @@ export const numberToArStyle = (num) => num.toLocaleString("ar-AE"); export const isActiveURL = (link, name) => link === name; export const convertToJalali = (date) => { - // Get the current Gregorian date const currentDate = date; - // Convert the Gregorian date to Jalali date const jalaliDate = moment(currentDate).format("jYYYY/jM/jD"); - // Get Jalali year, month, and day const jalaliYear = moment(jalaliDate, "jYYYY/jM/jD").jYear(); - const jalaliMonth = moment(jalaliDate, "jYYYY/jM/jD").jMonth() + 1; // Note: jalali-moment months are zero-based + const jalaliMonth = moment(jalaliDate, "jYYYY/jM/jD").jMonth() + 1; const jalaliDay = moment(jalaliDate, "jYYYY/jM/jD").jDate(); return `${jalaliYear}/${jalaliMonth}/${jalaliDay}`;