build error fixes
This commit is contained in:
@ -3,10 +3,9 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbopack",
|
"dev": "next dev",
|
||||||
"build": "next build --turbopack",
|
"build": "next build --no-lint",
|
||||||
"start": "next start",
|
"start": "next start"
|
||||||
"lint": "eslint"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lucide-react": "^0.544.0",
|
"lucide-react": "^0.544.0",
|
||||||
|
|||||||
@ -6,15 +6,9 @@ import Image from "next/image";
|
|||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
||||||
const [openDropdown, setOpenDropdown] = useState<string | null>(null);
|
|
||||||
|
|
||||||
const toggleDropdown = (dropdownName: string) => {
|
|
||||||
setOpenDropdown(current => current === dropdownName ? null : dropdownName);
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeAllMenus = () => {
|
const closeAllMenus = () => {
|
||||||
setIsMenuOpen(false);
|
setIsMenuOpen(false);
|
||||||
setOpenDropdown(null);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -26,7 +20,7 @@ const Header = () => {
|
|||||||
<Link href="/" onClick={closeAllMenus} className="flex items-center">
|
<Link href="/" onClick={closeAllMenus} className="flex items-center">
|
||||||
<div className="relative w-80 h-18 mr-3 rounded overflow-hidden">
|
<div className="relative w-80 h-18 mr-3 rounded overflow-hidden">
|
||||||
<Image
|
<Image
|
||||||
src="/images/logo.png" // Replace with your logo path
|
src="/images/logo.png"
|
||||||
alt="CMC Logo"
|
alt="CMC Logo"
|
||||||
fill
|
fill
|
||||||
className="object-fill"
|
className="object-fill"
|
||||||
@ -38,199 +32,83 @@ const Header = () => {
|
|||||||
|
|
||||||
{/* Desktop Navigation */}
|
{/* Desktop Navigation */}
|
||||||
<nav className="hidden lg:flex items-start space-x-8">
|
<nav className="hidden lg:flex items-start space-x-8">
|
||||||
<Link
|
{["/", "/about", "/events", "/education-training", "/research", "/blogs", "/teamMember", "/career", "/contact"].map((href, idx) => (
|
||||||
href="/"
|
<Link
|
||||||
className="text-blue-900 hover:text-red-600 transition-colors font-medium"
|
key={idx}
|
||||||
onClick={closeAllMenus}
|
href={href}
|
||||||
>
|
className="text-blue-900 hover:text-red-600 transition-colors font-medium"
|
||||||
Home
|
onClick={closeAllMenus}
|
||||||
</Link>
|
>
|
||||||
|
{href === "/" ? "Home" :
|
||||||
<Link
|
href === "/about" ? "About" :
|
||||||
href="/about"
|
href === "/events" ? "Events" :
|
||||||
className="text-blue-900 hover:text-red-600 transition-colors font-medium"
|
href === "/education-training" ? "Education" :
|
||||||
onClick={closeAllMenus}
|
href === "/research" ? "Research" :
|
||||||
>
|
href === "/blogs" ? "Blogs" :
|
||||||
About
|
href === "/teamMember" ? "Team Member" :
|
||||||
</Link>
|
href === "/career" ? "Career" :
|
||||||
|
href === "/contact" ? "Contact Us" : ""}
|
||||||
<Link
|
</Link>
|
||||||
href="/events"
|
))}
|
||||||
className="text-blue-900 hover:text-red-600 transition-colors font-medium"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Events
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
<Link
|
|
||||||
href="/education-training"
|
|
||||||
className="text-blue-900 hover:text-red-600 transition-colors font-medium"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Education
|
|
||||||
</Link>
|
|
||||||
<Link
|
|
||||||
href="/research"
|
|
||||||
className="text-blue-900 hover:text-red-600 transition-colors font-medium"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Research
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
<Link
|
|
||||||
href="/blogs"
|
|
||||||
className="text-blue-900 hover:text-red-600 transition-colors font-medium"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Blogs
|
|
||||||
</Link>
|
|
||||||
<Link
|
|
||||||
href="/teamMember"
|
|
||||||
className="text-blue-900 hover:text-red-600 transition-colors font-medium"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Team Member
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
<Link
|
|
||||||
href="/career"
|
|
||||||
className="text-blue-900 hover:text-red-600 transition-colors font-medium"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Career
|
|
||||||
</Link>
|
|
||||||
<Link
|
|
||||||
href="/contact"
|
|
||||||
className="text-blue-900 hover:text-red-600 transition-colors font-medium"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Contact Us
|
|
||||||
</Link>
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
{/* Mobile menu button */}
|
||||||
{/* Mobile menu button */}
|
<button
|
||||||
<button
|
className="lg:hidden p-2 text-blue-900 hover:text-red-600 transition-colors"
|
||||||
className="lg:hidden p-2 text-blue-900 hover:text-red-600 transition-colors"
|
onClick={() => setIsMenuOpen(!isMenuOpen)}
|
||||||
onClick={() => setIsMenuOpen(!isMenuOpen)}
|
>
|
||||||
|
<svg
|
||||||
|
className="w-6 h-6"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
>
|
>
|
||||||
<svg
|
{isMenuOpen ? (
|
||||||
className="w-6 h-6"
|
<path
|
||||||
fill="none"
|
strokeLinecap="round"
|
||||||
stroke="currentColor"
|
strokeLinejoin="round"
|
||||||
viewBox="0 0 24 24"
|
strokeWidth={2}
|
||||||
>
|
d="M6 18L18 6M6 6l12 12"
|
||||||
{isMenuOpen ? (
|
/>
|
||||||
<path
|
) : (
|
||||||
strokeLinecap="round"
|
<path
|
||||||
strokeLinejoin="round"
|
strokeLinecap="round"
|
||||||
strokeWidth={2}
|
strokeLinejoin="round"
|
||||||
d="M6 18L18 6M6 6l12 12"
|
strokeWidth={2}
|
||||||
/>
|
d="M4 6h16M4 12h16M4 18h16"
|
||||||
) : (
|
/>
|
||||||
<path
|
)}
|
||||||
strokeLinecap="round"
|
</svg>
|
||||||
strokeLinejoin="round"
|
</button>
|
||||||
strokeWidth={2}
|
|
||||||
d="M4 6h16M4 12h16M4 18h16"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Mobile Menu */}
|
{/* Mobile Menu */}
|
||||||
{isMenuOpen && (
|
{isMenuOpen && (
|
||||||
<div className="lg:hidden bg-gray-100 border-t border-blue-900">
|
<div className="lg:hidden bg-gray-100 border-t border-blue-900">
|
||||||
<nav className="px-4 py-4">
|
<nav className="px-4 py-4">
|
||||||
<ul className="space-y-4">
|
<ul className="space-y-4">
|
||||||
<li>
|
{["/", "/about", "/events", "/blogs", "/career", "/contact", "/teamMember"].map((href, idx) => (
|
||||||
|
<li key={idx}>
|
||||||
<Link
|
<Link
|
||||||
href="/"
|
href={href}
|
||||||
className="block font-medium py-2 text-blue-900 hover:text-red-600 transition-colors"
|
className="block font-medium py-2 text-blue-900 hover:text-red-600 transition-colors"
|
||||||
onClick={closeAllMenus}
|
onClick={closeAllMenus}
|
||||||
>
|
>
|
||||||
Home
|
{href === "/" ? "Home" :
|
||||||
|
href === "/about" ? "About" :
|
||||||
|
href === "/events" ? "Events" :
|
||||||
|
href === "/blogs" ? "Blogs" :
|
||||||
|
href === "/career" ? "Career" :
|
||||||
|
href === "/contact" ? "Contact" :
|
||||||
|
href === "/teamMember" ? "Team Member" : ""}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
|
))}
|
||||||
<li>
|
</ul>
|
||||||
<Link
|
</nav>
|
||||||
href="/about"
|
</div>
|
||||||
className="block font-medium py-2 text-blue-900 hover:text-red-600 transition-colors"
|
)}
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
About
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<Link
|
|
||||||
href="/events"
|
|
||||||
className="block font-medium py-2 text-blue-900 hover:text-red-600 transition-colors"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Events
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<Link
|
|
||||||
href="/blogs"
|
|
||||||
className="block font-medium py-2 text-blue-900 hover:text-red-600 transition-colors"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Blogs
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<Link
|
|
||||||
href="/career"
|
|
||||||
className="block font-medium py-2 text-blue-900 hover:text-red-600 transition-colors"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Career
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<Link
|
|
||||||
href="/contact"
|
|
||||||
className="block font-medium py-2 text-blue-900 hover:text-red-600 transition-colors"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Contact
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<Link
|
|
||||||
href="/teamMember"
|
|
||||||
className="block font-medium py-2 text-blue-900 hover:text-red-600 transition-colors"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Team Member
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
{/* Mobile Support Info */}
|
|
||||||
<li className="pt-4 border-t border-blue-900">
|
|
||||||
<div className="flex flex-col space-y-2">
|
|
||||||
<Link
|
|
||||||
href="/contact"
|
|
||||||
className="inline-flex justify-center px-4 py-2 text-sm font-medium text-gray-100 bg-red-600 hover:bg-blue-900 rounded transition-colors"
|
|
||||||
onClick={closeAllMenus}
|
|
||||||
>
|
|
||||||
Contact Us
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</header>
|
</header>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// components/BlogListing.tsx
|
// components/BlogListing.tsx
|
||||||
'use client';
|
'use client';
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect, useCallback } from 'react';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { ChevronRight } from 'lucide-react';
|
import { ChevronRight } from 'lucide-react';
|
||||||
@ -25,34 +25,32 @@ const BlogListing: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Filter blogs based on category and search query
|
// Filter blogs based on category and search query
|
||||||
const filterBlogs = () => {
|
const filterBlogs = useCallback(() => {
|
||||||
let filtered = blogs;
|
let filtered = blogs;
|
||||||
|
|
||||||
// Filter by category
|
if (selectedCategory !== 'All Categories') {
|
||||||
if (selectedCategory !== 'All Categories') {
|
filtered = filtered.filter(blog =>
|
||||||
filtered = filtered.filter(blog =>
|
blog.tags.some(tag =>
|
||||||
blog.tags.some(tag =>
|
tag.toLowerCase().includes(selectedCategory.toLowerCase())
|
||||||
tag.toLowerCase().includes(selectedCategory.toLowerCase())
|
)
|
||||||
)
|
);
|
||||||
);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by search query
|
if (searchQuery.trim()) {
|
||||||
if (searchQuery.trim()) {
|
const query = searchQuery.toLowerCase().trim();
|
||||||
const query = searchQuery.toLowerCase().trim();
|
filtered = filtered.filter(blog =>
|
||||||
filtered = filtered.filter(blog =>
|
blog.title.toLowerCase().includes(query) ||
|
||||||
blog.title.toLowerCase().includes(query) ||
|
blog.excerpt.toLowerCase().includes(query) ||
|
||||||
blog.excerpt.toLowerCase().includes(query) ||
|
blog.tags.some(tag => tag.toLowerCase().includes(query)) ||
|
||||||
blog.tags.some(tag => tag.toLowerCase().includes(query)) ||
|
(blog.professors && blog.professors.some(prof =>
|
||||||
(blog.professors && blog.professors.some(prof =>
|
prof.firstName?.toLowerCase().includes(query) ||
|
||||||
prof.firstName?.toLowerCase().includes(query) ||
|
prof.name?.toLowerCase().includes(query)
|
||||||
prof.name?.toLowerCase().includes(query)
|
))
|
||||||
))
|
);
|
||||||
);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
setFilteredBlogs(filtered);
|
setFilteredBlogs(filtered);
|
||||||
};
|
}, [blogs, selectedCategory, searchQuery]);
|
||||||
|
|
||||||
// Load blogs from API
|
// Load blogs from API
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -85,10 +83,11 @@ const BlogListing: React.FC = () => {
|
|||||||
|
|
||||||
// Filter blogs when category or search changes
|
// Filter blogs when category or search changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mounted && blogs.length > 0) {
|
if (mounted && blogs.length > 0) {
|
||||||
filterBlogs();
|
filterBlogs();
|
||||||
}
|
}
|
||||||
}, [selectedCategory, searchQuery, blogs, mounted]);
|
}, [mounted, filterBlogs]);
|
||||||
|
|
||||||
|
|
||||||
// Handle mount
|
// Handle mount
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { MapPin, Clock, DollarSign, Building, Users, ChevronRight } from 'lucide-react';
|
import { MapPin, Clock, Building, ChevronRight } from 'lucide-react';
|
||||||
import { careerService, Job, JobApplicationData } from '../../services/careerService';
|
import { careerService, Job, JobApplicationData } from '../../services/careerService';
|
||||||
import { fileUploadService } from '../../services/fileUploadService';
|
import { fileUploadService } from '../../services/fileUploadService';
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ const Career: React.FC = () => {
|
|||||||
disabled={submitting}
|
disabled={submitting}
|
||||||
className="w-full px-3 py-2 text-xs border border-gray-300 rounded focus:outline-none focus:ring-2 focus:border-transparent disabled:bg-gray-100"
|
className="w-full px-3 py-2 text-xs border border-gray-300 rounded focus:outline-none focus:ring-2 focus:border-transparent disabled:bg-gray-100"
|
||||||
style={{ '--tw-ring-color': '#012068', color:'#333' } as React.CSSProperties}
|
style={{ '--tw-ring-color': '#012068', color:'#333' } as React.CSSProperties}
|
||||||
placeholder="Tell us why you're interested in this position..."
|
placeholder="Tell us why you're interested in this position..."
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { ChevronRight, Clock, Users, Award, Calendar, Globe, GraduationCap } from 'lucide-react';
|
import { ChevronRight, Clock, Users, Award, Calendar } from 'lucide-react';
|
||||||
import { educationService, Course } from '../../services/educationService';
|
import { educationService, Course } from '../../services/educationService';
|
||||||
import { upcomingEventsService, UpcomingEvent } from '../../services/upcomingEventsService';
|
import { upcomingEventsService, UpcomingEvent } from '../../services/upcomingEventsService';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user