Skip to content

Commit 34b2935

Browse files
committed
Quality of life changes
1 parent 55c2e14 commit 34b2935

File tree

4 files changed

+61
-42
lines changed

4 files changed

+61
-42
lines changed

src/app/chat/[id]/project.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@
1313
"id": "3",
1414
"projectname": "code-compass",
1515
"indexname": "code-compass"
16+
},
17+
{
18+
"id": "4",
19+
"projectname": "Vibe-n",
20+
"indexname": "codetest"
1621
}
1722
]
Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { motion } from 'framer-motion';
2+
import { useRouter } from 'next/navigation';
23
import { LuChevronRight, LuCode, LuStar, LuUsers } from 'react-icons/lu';
34

45
import { ProjectCardProps } from 'types';
@@ -11,49 +12,61 @@ const ProjectCard: React.FC<ProjectCardProps> = ({
1112
stars,
1213
contributors,
1314
isRight,
14-
}) => (
15-
<motion.div
16-
className={`flex ${isRight ? 'justify-start' : 'justify-end'} relative`}
17-
initial={{ opacity: 0, x: isRight ? 100 : -100 }}
18-
whileInView={{ opacity: 1, x: 0 }}
19-
viewport={{ once: true }}
20-
transition={{ duration: 0.6 }}
21-
>
22-
<div
23-
className={`w-full md:w-5/12 ${
24-
isRight ? 'md:ml-auto md:pr-8' : 'md:mr-auto md:pl-8'
25-
}`}
15+
url,
16+
}) => {
17+
const router = useRouter();
18+
19+
const handleExploreClick = () => {
20+
router.push(url);
21+
};
22+
23+
return (
24+
<motion.div
25+
className={`flex ${isRight ? 'justify-start' : 'justify-end'} relative`}
26+
initial={{ opacity: 0, x: isRight ? 100 : -100 }}
27+
whileInView={{ opacity: 1, x: 0 }}
28+
viewport={{ once: true }}
29+
transition={{ duration: 0.6 }}
2630
>
27-
<div className="rounded-xl bg-gradient-to-br from-green-700 to-primary-900 p-6 shadow-lg transition-all duration-300 hover:shadow-2xl">
28-
<div className="mb-4 flex items-center justify-between">
29-
<div className="flex items-center">
30-
<LuCode className="mr-2 text-green-300" size={24} />
31-
<h3 className="text-xl font-bold text-white">{title}</h3>
32-
</div>
33-
<span className="rounded-full bg-green-900 px-3 py-1 text-sm font-semibold text-green-300">
34-
{language}
35-
</span>
36-
</div>
37-
<p className="mb-4 text-gray-300">{description}</p>
38-
<div className="flex items-center justify-between text-gray-300">
39-
<div className="flex items-center space-x-4">
40-
<span className="flex items-center">
41-
<LuStar className="mr-1" /> {stars}
42-
</span>
43-
<span className="flex items-center">
44-
<LuUsers className="mr-1" /> {contributors}
31+
<div
32+
className={`w-full md:w-5/12 ${
33+
isRight ? 'md:ml-auto md:pr-8' : 'md:mr-auto md:pl-8'
34+
}`}
35+
>
36+
<div className="rounded-xl bg-gradient-to-br from-green-700 to-primary-900 p-6 shadow-lg transition-all duration-300 hover:shadow-2xl">
37+
<div className="mb-4 flex items-center justify-between">
38+
<div className="flex items-center">
39+
<LuCode className="mr-2 text-green-300" size={24} />
40+
<h3 className="text-xl font-bold text-white">{title}</h3>
41+
</div>
42+
<span className="rounded-full bg-green-900 px-3 py-1 text-sm font-semibold text-green-300">
43+
{language}
4544
</span>
4645
</div>
47-
<span className="text-sm">Updated {lastUpdated}</span>
48-
</div>
49-
<div className="mt-4 flex justify-end">
50-
<button className="flex items-center rounded-full bg-green-500 px-4 py-2 text-white transition-colors duration-300 hover:bg-green-400">
51-
Explore <LuChevronRight className="ml-1" />
52-
</button>
46+
<p className="mb-4 text-gray-300">{description}</p>
47+
<div className="flex items-center justify-between text-gray-300">
48+
<div className="flex items-center space-x-4">
49+
<span className="flex items-center">
50+
<LuStar className="mr-1" /> {stars}
51+
</span>
52+
<span className="flex items-center">
53+
<LuUsers className="mr-1" /> {contributors}
54+
</span>
55+
</div>
56+
<span className="text-sm">Updated {lastUpdated}</span>
57+
</div>
58+
<div className="mt-4 flex justify-end">
59+
<button
60+
className="flex items-center rounded-full bg-green-500 px-4 py-2 text-white transition-colors duration-300 hover:bg-green-400"
61+
onClick={handleExploreClick}
62+
>
63+
Explore <LuChevronRight className="ml-1" />
64+
</button>
65+
</div>
5366
</div>
5467
</div>
55-
</div>
56-
</motion.div>
57-
);
68+
</motion.div>
69+
);
70+
};
5871

5972
export default ProjectCard;

src/components/home/section/helper/projects.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const projects = [
55
'AttireX is a fashion e-commerce website that aims to provide a seamless and enjoyable shopping experience for customers looking to explore and purchase the latest fashion trends..',
66
language: 'React',
77
lastUpdated: 'last year',
8-
url: '/chat/3',
8+
url: '/chat/2',
99
stars: 8,
1010
contributors: 1,
1111
},
@@ -15,7 +15,7 @@ export const projects = [
1515
' Save time, boost productivity, and ensure seamless knowledge transfer across your organization. Transform how your team navigates project information.',
1616
language: 'NextJS',
1717
lastUpdated: 'a day ago',
18-
url: '/chat/1',
18+
url: '/chat/3',
1919
stars: 2,
2020
contributors: 2,
2121
},
@@ -26,7 +26,7 @@ export const projects = [
2626
language: 'Typescript',
2727
lastUpdated: '3 days ago',
2828
stars: 2,
29-
url: '/chat/2',
29+
url: '/chat/1',
3030
contributors: 1,
3131
},
3232
];

types/interface/projectCard.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export interface ProjectCardProps {
66
stars: number;
77
contributors: number;
88
isRight: boolean;
9+
url: string;
910
}

0 commit comments

Comments
 (0)