File tree Expand file tree Collapse file tree 2 files changed +30
-11
lines changed Expand file tree Collapse file tree 2 files changed +30
-11
lines changed Original file line number Diff line number Diff line change 11"use client" ;
22import React from "react" ;
33import ProjectCard from "./ProjectCard" ;
4- import projects from "../constants/projects" ;
4+ import projects , { Project } from "../constants/projects" ;
55import { motion } from "framer-motion" ;
66
77const Projects = ( ) => {
88 // Group projects by year (assuming you'll add year to your project data)
9- const projectsByYear = projects . reduce ( ( acc , project ) => {
10- const year = project . year || 2023 ; // Default to 2023 if year is not specified
11- if ( ! acc [ year ] ) {
12- acc [ year ] = [ ] ;
13- }
14- acc [ year ] . push ( project ) ;
15- return acc ;
16- } , { } ) ;
9+ const projectsByYear = projects . reduce (
10+ ( acc : { [ key : string ] : Project [ ] } , project ) => {
11+ const year = project . year || 2023 ; // Default to 2023 if year is not specified
12+ if ( ! acc [ year ] ) {
13+ acc [ year ] = [ ] ;
14+ }
15+ acc [ year ] . push ( project ) ;
16+ return acc ;
17+ } ,
18+ { }
19+ ) ;
1720
1821 // Sort years in descending order
19- const sortedYears = Object . keys ( projectsByYear ) . sort ( ( a , b ) => b - a ) ;
22+ const sortedYears = Object . keys ( projectsByYear ) . sort (
23+ ( a : string , b : string ) => parseInt ( b ) - parseInt ( a )
24+ ) ;
2025
2126 return (
2227 < section className = "py-8 sm:py-16 px-3 sm:px-4 bg-gray-900" >
Original file line number Diff line number Diff line change 1- export default [
1+ export type Project = {
2+ name : string ;
3+ domains : string [ ] ;
4+ country : string ;
5+ desc : string ;
6+ year : number ;
7+ image : string ;
8+ playStore ?: string ;
9+ appStore ?: string ;
10+ isPersonalProject ?: boolean ;
11+ } ;
12+
13+ const projects : Project [ ] = [
214 {
315 name : "Account & Expense Manager" ,
416 domains : [ "Finance" ] ,
@@ -197,3 +209,5 @@ export default [
197209 appStore : "https://apps.apple.com/in/app/eqwe/id1527450909" ,
198210 } ,
199211] ;
212+
213+ export default projects ;
You can’t perform that action at this time.
0 commit comments