From 9d3ee16aef11dd0c5c8dd99fdf6328c208dbe516 Mon Sep 17 00:00:00 2001 From: QwertyMD Date: Sun, 26 Apr 2026 16:24:04 +0545 Subject: [PATCH] feat: enhance UI components and improve layout for user side --- src/App.css | 2 +- src/components/user/FAQ.tsx | 15 +++- src/components/user/MemberUserCard.tsx | 4 +- src/components/user/ProjectSection.tsx | 89 ++++++++++--------- src/components/user/UpcomingEventUserCard.tsx | 7 +- src/components/user/UserNavbar.tsx | 2 +- src/pages/user/UserHome.tsx | 8 +- 7 files changed, 69 insertions(+), 58 deletions(-) diff --git a/src/App.css b/src/App.css index 7f6fa70..2580904 100644 --- a/src/App.css +++ b/src/App.css @@ -45,7 +45,7 @@ .hero-motion-panel { transform: translateY(calc((1 - var(--hero-progress)) * 44px)) scale(calc(0.985 + (var(--hero-progress) * 0.015))); - opacity: calc(0.6 + (var(--hero-progress) * 0.4)); + /* opacity: calc(0.6 + (var(--hero-progress) * 0.4)); */ box-shadow: 0 -20px 50px rgba(15, 23, 42, calc(var(--hero-progress) * 0.14)); transition: transform 120ms linear, diff --git a/src/components/user/FAQ.tsx b/src/components/user/FAQ.tsx index 25ab96c..924adec 100644 --- a/src/components/user/FAQ.tsx +++ b/src/components/user/FAQ.tsx @@ -51,6 +51,18 @@ const FAQ = () => { ]; return ( +
+
+
+ +

+ FAQ +

+
+

+ Frequently Asked Questions +

+
{faqs.map((faq, index) => ( @@ -73,7 +85,7 @@ const FAQ = () => { type="email" placeholder="Enter Your Email" className="w-full rounded-full border border-gray-200 bg-gray-50 px-8 py-5 text-gray-800 placeholder-gray-400 shadow-sm transition-all focus:border-red-500 focus:bg-white focus:ring-4 focus:ring-red-500/10 focus:outline-none" - /> + />
+
); }; diff --git a/src/components/user/MemberUserCard.tsx b/src/components/user/MemberUserCard.tsx index f02f2b0..1daddc6 100644 --- a/src/components/user/MemberUserCard.tsx +++ b/src/components/user/MemberUserCard.tsx @@ -28,7 +28,7 @@ const MemberUserCard = () => { return (
-
+

@@ -36,7 +36,7 @@ const MemberUserCard = () => {

- Meet our people + Meet Our People

diff --git a/src/components/user/ProjectSection.tsx b/src/components/user/ProjectSection.tsx index efe7f7c..9e22b21 100644 --- a/src/components/user/ProjectSection.tsx +++ b/src/components/user/ProjectSection.tsx @@ -1,26 +1,27 @@ import { useEffect, useState } from 'react'; -import { Calendar, GitBranch, ExternalLink } from 'lucide-react'; +import { Calendar, GitBranch, ExternalLink, Package, Monitor, Smartphone, Cpu } from 'lucide-react'; import { Button } from '../ui/button'; import { formatDate } from '@/utils/formatdate.utils'; import { getAllProjects } from '@/services/admin/projectServices'; +import type { Contributor, ProjectResponse, Tag } from '@/types/project.types'; const FILTERS = [ - { label: 'All Projects', tag: 'all', icon: '📦' }, - { label: 'Web', tag: 'Web', icon: '🖥️' }, - { label: 'Mobile', tag: 'Mobile', icon: '📱' }, - { label: 'AI/ML', tag: 'AI/ML', icon: '🤖' }, + { label: 'All Projects', tag: 'all', icon: }, + { label: 'Web', tag: 'Web', icon: }, + { label: 'Mobile', tag: 'Mobile', icon: }, + { label: 'AI/ML', tag: 'AI/ML', icon: }, ]; const ProjectSection: React.FC = () => { - const [projects, setProjects] = useState([]); - const [loading, setLoading] = useState(true); - const [error, setError] = useState(''); - const [activeFilter, setActiveFilter] = useState('all'); + const [projects, setProjects] = useState([]); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(''); + const [activeFilter, setActiveFilter] = useState('all'); useEffect(() => { const fetchProjects = async () => { try { - const projectsData = await getAllProjects(); + const projectsData: ProjectResponse[] = await getAllProjects(); setProjects(projectsData || []); } catch (err: any) { setError(err.message || 'Something went wrong'); @@ -34,60 +35,60 @@ const ProjectSection: React.FC = () => { if (loading) return

Loading projects...

; if (error) return

{error}

; - const filteredProjects = + const filteredProjects: ProjectResponse[] = activeFilter === 'all' ? projects - : projects.filter((project) => (project.tags || []).some((tag) => tag.name === activeFilter)); + : projects.filter((project: ProjectResponse) => + (project.tags || []).some((tag: Tag | string) => + typeof tag === 'string' ? tag === activeFilter : tag.name === activeFilter + ) + ); return (
-

- Projects -

+

Projects

-

- Built by the community -

+

Built by the community

{/* Filter Buttons */} -
- {FILTERS.map((filter, idx) => ( - - ))} -
+
+ {FILTERS.map((filter, idx) => ( + + ))} +
+ {/* Projects Grid */}
- {filteredProjects.map((project) => ( + {filteredProjects.map((project: ProjectResponse) => (
-
+ {/* Image */} +
{project.thumbnailUrl ? ( {project.name} ) : ( -
+
No Image
)} @@ -100,7 +101,7 @@ const ProjectSection: React.FC = () => { {/* Tech Stack */}
- {(project.techStacks || []).map((tech, idx) => ( + {(project.techStacks || []).map((tech: string, idx: number) => ( { {formatDate(project.createdAt)}

- {/* Contributors*/} + {/* Contributors (hex masked, overlapping) */}
- {(project.contributors || []).slice(0, 3).map((c) => ( + {(project.contributors || []).slice(0, 3).map((c: Contributor) => (
{

- What's happening + What's Happening

-

- Industry-grade events, workshops, and summits designed to push your skills forward. -

-
+
{/* Left Image */}
{ return ( -
-
-
+
+