From fa96d5ad98abed4214319cba05a82c45b461f44b Mon Sep 17 00:00:00 2001 From: SomshekharArabali Date: Sat, 15 Nov 2025 15:12:00 +0530 Subject: [PATCH] refactor: Remove redundant local language selectors --- user/src/components/Contact.jsx | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/user/src/components/Contact.jsx b/user/src/components/Contact.jsx index effdb28..3e3bff5 100644 --- a/user/src/components/Contact.jsx +++ b/user/src/components/Contact.jsx @@ -1,9 +1,11 @@ import banner from "./../assets/header-banner2.jpg"; import { Mail, MapPin, User, BookUser, MessageSquare, CheckCircle, XCircle, AlertTriangle, X } from "lucide-react"; import { useState, useEffect, useMemo } from "react"; +import { useTranslation } from "react-i18next"; // ✅ Import i18n hook const Contact = () => { - const [lang, setLang] = useState("en"); + const { i18n } = useTranslation(); // ✅ Use global i18n + const lang = i18n.language || "en"; // ✅ Get language from i18n const t = useMemo( () => ({ @@ -117,7 +119,7 @@ const Contact = () => { { id: "form", title: S.formTitle }, ]; - // Smooth scroll function (cross-browser safe) + // Smooth scroll function (cross-browser safe) const smoothScrollTo = (id) => { const target = document.getElementById(id); if (!target) return; @@ -139,12 +141,14 @@ const Contact = () => {

{S.subtitle}

{S.lastUpdated}

-
- - - setLang("en")} /> - - setLang("hi")} /> + {/* ✅ REMOVED: Local language selector - now uses global navbar selector */} +
+
@@ -180,11 +184,11 @@ const Contact = () => {
-

Email

- {S.email} +

Email

+ {S.email}
-

Phone

+

Phone

{S.phone}
@@ -208,7 +212,7 @@ const Contact = () => { )}
-
+
-

Map data © Google

+

Map data © Google

@@ -342,4 +346,4 @@ const Contact = () => { ); }; -export default Contact; +export default Contact; \ No newline at end of file