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:Loading projects...
) : filteredProjects.length === 0 ? ( -- No projects available. -
+No projects available.
) : ( -+ Sector: {project.sector + .split(" ") + .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) + .join(" ")} +
-- 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 && ( + )}