From 676a40f0d99aac777338b7509bc2d916c45f8a9c Mon Sep 17 00:00:00 2001 From: LaxmiB Date: Mon, 5 Jan 2026 18:53:25 +0530 Subject: [PATCH] New changes UI --- src/pages/AddProjects.jsx | 19 ++-- src/pages/Projects.jsx | 199 +++++++++++--------------------------- src/styles/IndiaMap.css | 26 +++++ 3 files changed, 94 insertions(+), 150 deletions(-) diff --git a/src/pages/AddProjects.jsx b/src/pages/AddProjects.jsx index 0e1d0f6..9d7d4d1 100644 --- a/src/pages/AddProjects.jsx +++ b/src/pages/AddProjects.jsx @@ -8,15 +8,16 @@ import { toast } from "react-toastify"; const API_BASE = process.env.REACT_APP_API_BASE_URL; const SECTORS = [ - { label: "Water Supply", value: "water supply" }, - { label: "Storm Water", value: "storm water" }, - { label: "Electromechanical", value: "electromechanical" }, - { label: "Real Estate / Buildings", value: "real estate / buildings" }, - { label: "Tunnel", value: "tunnel" }, - { label: "Roads", value: "roads" }, - { label: "Wastewater / Sewerage", value: "wastewater / sewerage" }, - { label: "Irrigation", value: "irrigation" }, - { label: "Renewable Energy", value: "renewable energy" }, + { label: "All", value: "All" }, + { label: "Water Supply", value: "Water Supply" }, + { label: "Storm Water", value: "Storm Water" }, + { label: "Electromechanical", value: "Electromechanical & Instrumentation" }, + { label: "Real Estate / Buildings", value: "Real estate / Buildings" }, + { label: "Tunnel", value: "Tunnel" }, + { label: "Roads", value: "Roads" }, + { label: "Wastewater / Sewerage", value: "Wastewater / Sewerage" }, + { label: "Irrigation", value: "Irrigation" }, + { label: "Renewable Energy", value: "Renewable Energy" }, ]; const AddProjects = () => { diff --git a/src/pages/Projects.jsx b/src/pages/Projects.jsx index 73ed78f..750b1ff 100644 --- a/src/pages/Projects.jsx +++ b/src/pages/Projects.jsx @@ -1,45 +1,7 @@ import React, { useState, useEffect, useRef } from "react"; import axios from "axios"; -import Slider from "react-slick"; import heroBg from "../assets/projects-hero.jpg"; import "../styles/Projects.css"; -import "slick-carousel/slick/slick.css"; -import "slick-carousel/slick/slick-theme.css"; - -/* ===================== - Custom Arrows -===================== */ -const NextArrow = ({ className, style, onClick }) => ( -
-); - -const PrevArrow = ({ className, style, onClick }) => ( -
-); const Projects = () => { const [selectedSector, setSelectedSector] = useState("all"); @@ -54,7 +16,7 @@ const Projects = () => { { label: "All", value: "all" }, { label: "Water Supply", value: "water supply" }, { label: "Storm Water", value: "storm water" }, - { label: "Electromechanical", value: "electromechanical" }, + { label: "Electromechanical", value: "electromechanical & instrumentation" }, { label: "Real Estate / Buildings", value: "real estate / buildings" }, { label: "Tunnel", value: "tunnel" }, { label: "Roads", value: "roads" }, @@ -63,9 +25,6 @@ const Projects = () => { { label: "Renewable Energy", value: "renewable energy" }, ]; - /* ===================== - Fetch Projects - ===================== */ useEffect(() => { const fetchProjects = async () => { try { @@ -82,9 +41,6 @@ const Projects = () => { fetchProjects(); }, []); - /* ===================== - Scroll to sectors - ===================== */ useEffect(() => { if (window.location.hash === "#sectors" && sectorRef.current) { setTimeout(() => { @@ -108,32 +64,9 @@ const Projects = () => { })); }; - /* ===================== - Slider Settings - ===================== */ - const sliderSettings = { - dots: false, - infinite: true, - speed: 600, - slidesToShow: 3, - slidesToScroll: 1, - autoplay: true, - autoplaySpeed: 1500, - arrows: true, - nextArrow: , - prevArrow: , - responsive: [ - { breakpoint: 1024, settings: { slidesToShow: 3 } }, - { breakpoint: 768, settings: { slidesToShow: 2 } }, - { breakpoint: 480, settings: { slidesToShow: 1 } }, - ], - }; - return (
- {/* ===================== - Hero Section - ====================== */} + {/* Hero Section */}
{
- {/* ===================== - Sector Buttons - ====================== */} + {/* Sector Buttons */}
{ "bg-gradient-to-r from-purple-400 to-purple-600", "bg-gradient-to-r from-red-400 to-red-600", ]; - const isSelected = selectedSector === sector.value; - return (
- {/* ===================== - Projects Slider - ====================== */} -
+ {/* Projects Grid */} +
{loading ? (

Loading projects...

) : filteredProjects.length === 0 ? ( -

- No projects available. -

+

No projects available.

) : ( - - {filteredProjects.map((project) => ( -
-
+ filteredProjects.map((project) => ( +
+ + {project.image && ( +
+ {project.name} { + e.stopPropagation(); + setLightboxImage(`${process.env.REACT_APP_API_BASE_URL}${project.image}`); + }} + /> +
+ )} - {/* ✅ FIXED IMAGE SIZE (NO BIG / SMALL ISSUE) */} - {project.image && ( -
- {project.name} { - e.stopPropagation(); - setLightboxImage( - `${process.env.REACT_APP_API_BASE_URL}${project.image}` - ); - }} - /> -
- )} +
+

+ {project.name} +

+

+ Sector: {project.sector + .split(" ") + .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) + .join(" ")} +

-
-

- {project.name} -

-

- Sector: {project.sector} + + + {project.location && ( +

+ Location: {project.location} +

+ )} + + {project.description && ( +
+

+ {expandedDescriptions[project.id] + ? project.description + : project.description.slice(0, 100) + "..."}

- - {project.location && ( -

- Location: {project.location} -

- )} - - {project.description && ( -

- {expandedDescriptions[project.id] - ? project.description - : project.description.slice(0, 100) + "..."} - {project.description.length > 100 && ( - - )} -

+ {project.description.length > 100 && ( + )}
-
+ )}
- ))} - +
+ )) )}
- {/* ===================== - Image Lightbox - ====================== */} + {/* Image Lightbox */} {lightboxImage && (
{ > × - Project + Project
)} diff --git a/src/styles/IndiaMap.css b/src/styles/IndiaMap.css index ca0b0ef..1c4eebe 100644 --- a/src/styles/IndiaMap.css +++ b/src/styles/IndiaMap.css @@ -28,3 +28,29 @@ stroke-width: 0.7; } } +.map-wrapper { + width: 100%; + max-width: 100%; + overflow: hidden; +} + +.map-wrapper svg { + width: 100%; + height: auto; +} + +@media (max-width: 767px) { + /* Optional: reduce stroke width and marker size for mobile */ + .map-wrapper svg .rsm-geography { + stroke-width: 0.5 !important; + } + + .map-wrapper svg circle { + r: 6 !important; /* smaller circles on mobile */ + stroke-width: 1 !important; + } + + .map-wrapper svg text { + font-size: 12px !important; /* smaller text on mobile */ + } +}