|
1 | 1 | import clsx from 'clsx';
|
2 | 2 | import * as React from 'react';
|
3 | 3 |
|
4 |
| -import CloudinaryImg from '@/components/images/CloudinaryImg'; |
5 | 4 | import UnstyledLink from '@/components/links/UnstyledLink';
|
6 | 5 | import TechIcons, { TechListType } from '@/components/TechIcons';
|
7 | 6 |
|
8 |
| -import { ProjectFrontmatter } from '@/types/frontmatters'; |
| 7 | +import { ProjectsType } from '@/types/frontmatters'; |
9 | 8 |
|
10 | 9 | type ProjectCardProps = {
|
11 |
| - project: ProjectFrontmatter; |
| 10 | + project: ProjectsType; |
12 | 11 | } & React.ComponentPropsWithoutRef<'li'>;
|
13 | 12 |
|
14 | 13 | export default function ProjectCard({ project, className }: ProjectCardProps) {
|
15 | 14 | return (
|
16 |
| - <li |
17 |
| - className={clsx( |
18 |
| - 'project-card md:w-full rounded-md', |
19 |
| - 'border dark:border-gray-600', |
20 |
| - 'scale-100 hover:scale-[1.02] active:scale-[0.97] motion-safe:transform-gpu', |
21 |
| - 'transition duration-100', |
22 |
| - 'motion-reduce:hover:scale-100', |
23 |
| - 'animate-shadow', |
24 |
| - className |
25 |
| - )} |
26 |
| - > |
27 |
| - <UnstyledLink |
28 |
| - href={`/projects/${project.slug}`} |
29 |
| - className='flex h-full flex-col items-start rounded-md p-4 focus:outline-none focus-visible:ring focus-visible:ring-primary-300' |
30 |
| - > |
31 |
| - <h4>{project.title}</h4> |
32 |
| - <p className='mb-auto text-sm text-gray-700 dark:text-gray-300'> |
33 |
| - {project.description} |
34 |
| - </p> |
35 |
| - <div className='mt-2'> |
36 |
| - <TechIcons techs={project.techs.split(',') as Array<TechListType>} /> |
37 |
| - </div> |
| 15 | + <ul className='mt-6 grid grid-cols-4 gap-4'> |
| 16 | + {project.child.map((projectItem) => ( |
| 17 | + <li |
| 18 | + key={projectItem.title} |
| 19 | + className={clsx( |
| 20 | + 'project-card md:w-full rounded-md', |
| 21 | + 'border dark:border-gray-600', |
| 22 | + 'scale-100 hover:scale-[1.02] active:scale-[0.97] motion-safe:transform-gpu', |
| 23 | + 'transition duration-100', |
| 24 | + 'motion-reduce:hover:scale-100', |
| 25 | + 'animate-shadow', |
| 26 | + className |
| 27 | + )} |
| 28 | + > |
| 29 | + <UnstyledLink |
| 30 | + href={projectItem.link} |
| 31 | + className='flex h-full flex-col items-start rounded-md p-4 focus:outline-none focus-visible:ring focus-visible:ring-primary-300' |
| 32 | + > |
| 33 | + <h4>{projectItem.title}</h4> |
| 34 | + <p className='mb-auto text-sm text-gray-700 dark:text-gray-300'> |
| 35 | + {projectItem.description} |
| 36 | + </p> |
| 37 | + <div className='mt-2'> |
| 38 | + <TechIcons |
| 39 | + techs={projectItem.techs.split(',') as Array<TechListType>} |
| 40 | + /> |
| 41 | + </div> |
38 | 42 |
|
39 |
| - <CloudinaryImg |
40 |
| - className='pointer-events-none mt-3 w-full' |
41 |
| - publicId={`theodorusclarence/${project.banner}`} |
42 |
| - alt={project.title} |
43 |
| - width={1440} |
44 |
| - height={792} |
45 |
| - preview={false} |
46 |
| - /> |
47 |
| - |
48 |
| - <p className='animated-underline mt-2 inline-block font-medium'> |
49 |
| - See more → |
50 |
| - </p> |
51 |
| - </UnstyledLink> |
52 |
| - </li> |
| 43 | + <p className='animated-underline mt-2 inline-block font-medium'> |
| 44 | + See On My Github → |
| 45 | + </p> |
| 46 | + </UnstyledLink> |
| 47 | + </li> |
| 48 | + ))} |
| 49 | + ; |
| 50 | + </ul> |
53 | 51 | );
|
54 | 52 | }
|
0 commit comments