From 61e66824b99a8a173cba8b506397b129aa13d3b5 Mon Sep 17 00:00:00 2001 From: Replit Agent Date: Fri, 5 Jun 2026 18:33:23 +0000 Subject: [PATCH] Fix nav active state & populate services menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task #9: Two header fixes on artifacts/ehsan-poc. 1. Nav active state no longer stuck on "فرص التبرع". Active page now gets a moving green outline box (Home) matching the real ehsan.sa nav. "فرص التبرع" stays a solid green CTA but only shows an active green ring when on /opportunities. Applied consistent active styling across desktop and mobile nav (Home, Opportunities, Request). 2. "خدماتنا" dropdown now lists the eight official services from the reference image, each with a lucide icon: غراس (Sprout), الزكاة (HandCoins), هدية (Gift), الأضاحي (Beef), الحملات (Megaphone), التبرع الدوري (Repeat), التبرع بالرسائل (MessageSquare), تطهير الأسهم (TrendingUp). Each routes to /opportunities (POC has no per-service pages). Kept "طلب دعم" below a separator so desktop users retain access to /request. Mobile menu mirrors the services list. Added serviceItems i18n group (AR + EN) in translations.ts. Files: src/components/layout/Header.tsx, src/lib/i18n/translations.ts. Verified: tsc --noEmit clean; e2e UI test passed (active state moves, dropdown shows all 8 items + request, routing works); console clean after HMR-restart of the web workflow. No emojis. --- .../src/components/layout/Header.tsx | 81 ++++++++++++++++--- .../ehsan-poc/src/lib/i18n/translations.ts | 20 +++++ 2 files changed, 92 insertions(+), 9 deletions(-) diff --git a/artifacts/ehsan-poc/src/components/layout/Header.tsx b/artifacts/ehsan-poc/src/components/layout/Header.tsx index 231aec9..8207dda 100644 --- a/artifacts/ehsan-poc/src/components/layout/Header.tsx +++ b/artifacts/ehsan-poc/src/components/layout/Header.tsx @@ -7,6 +7,7 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, + DropdownMenuSeparator, DropdownMenuTrigger, } from "../ui/dropdown-menu"; import { @@ -18,6 +19,15 @@ import { X, LogOut, Globe, + Sprout, + HandCoins, + Gift, + Beef, + Megaphone, + Repeat, + MessageSquare, + TrendingUp, + HeartHandshake, } from "lucide-react"; import ehsanLogo from "../../assets/ehsan-logo.png"; @@ -31,6 +41,17 @@ export function Header() { const isActive = (path: string) => location === path; + const services = [ + { key: "ghiras", label: t.serviceItems.ghiras, icon: Sprout }, + { key: "zakat", label: t.serviceItems.zakat, icon: HandCoins }, + { key: "gift", label: t.serviceItems.gift, icon: Gift }, + { key: "adahi", label: t.serviceItems.adahi, icon: Beef }, + { key: "campaigns", label: t.serviceItems.campaigns, icon: Megaphone }, + { key: "recurring", label: t.serviceItems.recurring, icon: Repeat }, + { key: "sms", label: t.serviceItems.sms, icon: MessageSquare }, + { key: "stocks", label: t.serviceItems.stocks, icon: TrendingUp }, + ]; + return (
@@ -43,8 +64,10 @@ export function Header() {