Skip to content

Commit d98933b

Browse files
committed
feat: modified project tile and section to a column
1 parent ba7a614 commit d98933b

File tree

3 files changed

+31
-12
lines changed

3 files changed

+31
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ to-do:
44
- [ ] check out about highlighting words
55
- [ ] YAML file parser for experience, projects
66
- [ ] skills, education section
7-
- [ ] projects in one column, instead of cards
7+
- [x] projects in one column, instead of cards

src/components/Projects.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function Projects({ arr }: ProjectProps) {
1111
<section id="projects" className="mb-12">
1212
<h2 className="text-2xl font-bold mb-4">Projects</h2>
1313
{projects && projects.length > 0 ? (
14-
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
14+
<div className="space-y-4">
1515
{projects.map((project, index) => (
1616
<ProjectTile key={index} {...project} />
1717
))}

src/components/Tiles/ProjectTile.tsx

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
1-
import { Github } from 'lucide-react'
1+
import { ArrowUpRight } from 'lucide-react'
2+
import { useMediaQuery } from '@/hooks/useMediaQuery'
23

34
export type ProjectTileProps = {
45
title: string
56
description: string
67
repo: boolean,
7-
repoUrl: string
8+
repoUrl?: string,
9+
live: boolean,
10+
liveUrl?: string,
811
}
912

10-
export function ProjectTile({ title, description, repo, repoUrl }: ProjectTileProps) {
13+
export function ProjectTile({ title, description, repo, repoUrl, live, liveUrl }: ProjectTileProps) {
14+
const isDesktop = useMediaQuery('(min-width: 768px)')
1115
return (
12-
<div className="bg-white dark:bg-neutral-800 p-6 rounded-lg shadow-md">
13-
<div className="flex justify-between items-start mb-2">
16+
<div className="items-center">
17+
<div className="flex flex-col md:items-start justify-between sm:flex-row mb-2">
1418
<h3 className="text-xl font-semibold">{title}</h3>
15-
{repo && (
16-
<a href={repoUrl} target="_blank" rel="noopener noreferrer" aria-label={`GitHub repository for ${title}`}>
17-
<Github className="w-6 h-6" />
18-
</a>
19-
)}
19+
<div className="space-x-2 justify-end">
20+
{repo && (
21+
<a
22+
href={repoUrl} target="_blank"
23+
rel="noopener noreferrer" aria-label={`GitHub repository for ${title}`}
24+
className="text-pink-500 inline-flex items-center hover:underline"
25+
>
26+
github <ArrowUpRight className="w-4 h-4 md:w-5 md:h-5"/>
27+
</a>
28+
)}
29+
{live && (
30+
<a
31+
href={liveUrl} target="_blank"
32+
rel="noopener noreferrer" aria-label={`Live link for ${title}`}
33+
className="text-midnight-blue-500 inline-flex items-center hover:underline"
34+
>
35+
link <ArrowUpRight className="w-4 h-4 md:w-5 md:h-5"/>
36+
</a>
37+
)}
38+
</div>
2039
</div>
2140
<p className="text-gray-700 dark:text-gray-300">{description}</p>
2241
</div>

0 commit comments

Comments
 (0)