From 7119d7a48dba6e5abffb4e6d355f014bd62ce84b Mon Sep 17 00:00:00 2001 From: Maaz Khokhar Date: Wed, 25 Jun 2025 12:40:38 -0400 Subject: [PATCH] feat: Implement dark mode theme support across components - Added ThemeContext for managing theme state and toggling between light and dark modes. - Updated components (EntrepreneurshipSection, Footer, HeroSection, LeadershipSection, ReviewSection, TechSection, UniqueSection) to utilize theme context and apply conditional styling based on the current theme. - Enhanced CSS with custom properties for theming and transitions. - Configured Tailwind CSS to support dark mode. - Ensured consistent styling and transitions for text and background colors in dark mode. --- src/App.tsx | 115 ++++++++++--- src/components/AcademicStemHighlights.tsx | 183 ++++++++++++++------- src/components/AthleticsSection.tsx | 42 ++--- src/components/EntrepreneurshipSection.tsx | 56 +++---- src/components/Footer.tsx | 19 ++- src/components/HeroSection.tsx | 31 +++- src/components/LeadershipSection.tsx | 47 ++++-- src/components/ReviewSection.tsx | 45 +++-- src/components/TechSection.tsx | 111 ++++++++++--- src/components/UniqueSection.tsx | 65 ++++++-- src/contexts/ThemeContext.tsx | 73 ++++++++ src/index.css | 52 +++++- src/main.tsx | 19 ++- tailwind.config.js | 7 + 14 files changed, 640 insertions(+), 225 deletions(-) create mode 100644 src/contexts/ThemeContext.tsx create mode 100644 tailwind.config.js diff --git a/src/App.tsx b/src/App.tsx index 895bff4..c6f738d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,9 +1,7 @@ import { useState, type JSX, useEffect } from "react"; -import { - Star, - X, -} from "lucide-react"; +import { Star, X, Sun, Moon } from "lucide-react"; import { addReview, fetchReviews, type Review } from "./reviewsApi"; +import { useTheme } from "./contexts/ThemeContext"; import HeroSection from "./components/HeroSection"; import UniqueSection from "./components/UniqueSection"; import AcademicSTEMHighlights from "./components/AcademicStemHighlights"; @@ -15,6 +13,7 @@ import ReviewSection from "./components/ReviewSection"; import Footer from "./components/Footer"; const App = () => { + const { theme, toggleTheme } = useTheme(); const [showModal, setShowModal] = useState(false); const [reviews, setReviews] = useState([]); const [newReview, setNewReview] = useState({ @@ -69,11 +68,34 @@ const App = () => { }; return ( -
+
+ {/* Theme Toggle Button */} + + {/* Hero Section */} -
+
{/* Academic & STEM Highlights */} @@ -85,7 +107,6 @@ const App = () => { {/* Leadership, Service, & School */} - {/* Athletics & Competitions */} @@ -93,7 +114,11 @@ const App = () => { {/* Reviews Section */} - + {/* Footer */}