From 93bcf4d560dda16de0455e418e4193fe0659a395 Mon Sep 17 00:00:00 2001 From: defiQUG Date: Sun, 5 Oct 2025 09:31:54 -0700 Subject: [PATCH] feat: Refactor UI components by extracting Navigation, Footer, LogoMark, and Card; implement responsive design and improve code organization --- src/App.tsx | 237 +--------------------------- src/components/Footer.tsx | 64 ++++++++ src/components/Navigation.tsx | 154 ++++++++++++++++++ src/components/ui/Card.tsx | 23 +++ src/components/ui/LogoMark.tsx | 24 +++ src/components/ui/Magnetic.tsx | 15 ++ src/components/ui/SectionHeader.tsx | 17 ++ src/components/ui/index.tsx | 11 ++ src/layouts/MainLayout.tsx | 32 +++- 9 files changed, 344 insertions(+), 233 deletions(-) create mode 100644 src/components/Footer.tsx create mode 100644 src/components/Navigation.tsx create mode 100644 src/components/ui/Card.tsx create mode 100644 src/components/ui/LogoMark.tsx create mode 100644 src/components/ui/Magnetic.tsx create mode 100644 src/components/ui/SectionHeader.tsx create mode 100644 src/components/ui/index.tsx diff --git a/src/App.tsx b/src/App.tsx index f8e2fff..4ba96a0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,19 +4,14 @@ import { ArrowRight, Backpack, CheckCircle2, - Facebook, Globe, Heart, - Instagram, Mail, MapPin, - Menu, - Moon, Phone, Shirt, Sparkles, Star, - SunMedium, Users, Building2, BookOpenText, @@ -67,6 +62,10 @@ import AdvancedAnalyticsDashboard from './components/AdvancedAnalyticsDashboard' import MobileVolunteerApp from './components/MobileVolunteerApp' import StaffTrainingDashboard from './components/StaffTrainingDashboard' +// Phase 4: Extracted Components +import { Navigation } from './components/Navigation' +import { Footer } from './components/Footer' + /** * Miracles in Motion — Complete Non-Profit Website * A comprehensive 501(c)3 organization website with modern design, @@ -778,175 +777,9 @@ function SkipToContent() { ) } -interface NavProps { - darkMode: boolean - setDarkMode: (value: boolean) => void - mobileMenuOpen: boolean - setMobileMenuOpen: (value: boolean) => void -} +// Nav component has been extracted to ./components/Navigation.tsx -function Nav({ darkMode, setDarkMode, mobileMenuOpen, setMobileMenuOpen }: NavProps) { - // Close mobile menu when route changes - useEffect(() => { - setMobileMenuOpen(false) - }, [window.location.hash]) - - // Handle keyboard navigation - const handleKeyDown = (e: React.KeyboardEvent, action: () => void) => { - if (e.key === 'Enter' || e.key === ' ') { - e.preventDefault() - action() - } - } - - return ( - <> - - - {/* Mobile Menu */} - -
-
- Success Stories - Testimonies - Volunteer - Corporate Partners - - - Staff & Partner Portals - Legal & Privacy -
- - -
-
-
-
- - ) -} - -function LogoMark() { - return ( -
- - -
- ) -} +// LogoMark component has been extracted to ./components/ui/LogoMark.tsx /* ===================== Home Page ===================== */ function HomePage() { @@ -4374,61 +4207,7 @@ function BackgroundDecor() { ) } -function Footer() { - return ( - - ) -} +// Footer component has been extracted to ./components/Footer.tsx function StickyDonate() { return ( @@ -4615,7 +4394,7 @@ function AppContent() { )}
-