-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add tech stack tags to ProjectCard component (#152)
- Loading branch information
1 parent
a9b001f
commit 0dbed4c
Showing
8 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import FancyRectangle from '@/components/FancyRectangle'; | ||
import Tag from '@/components/Tag'; | ||
import { TECH_COLORS } from '@/constants/colours'; | ||
import type { FutureProject } from '@/data/future-projects'; | ||
|
||
export default function ProjectCard({ project }: { project: FutureProject }) { | ||
return ( | ||
<FancyRectangle colour="white" offset="8" rounded fullWidth> | ||
<div className="w-full gap-6 rounded-xl bg-white p-4 text-black"> | ||
<div className="space-y-2 md:space-y-4"> | ||
<div className="gap-6"> | ||
<div className="space-y-2"> | ||
<h4 className="text-2xl font-bold md:pb-1 md:text-3xl"> | ||
{project.title} | ||
</h4> | ||
<p>{project.description}</p> | ||
</div> | ||
</div> | ||
{project.techStacks.length !== 0 && ( | ||
<div className="flex flex-wrap gap-3"> | ||
{project.techStacks.map((tech, i) => ( | ||
<Tag key={i} name={tech} backgroundColor={TECH_COLORS[tech]} /> | ||
))} | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
</FancyRectangle> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { getContrastColor } from '@/constants/colours'; | ||
|
||
interface TagProps { | ||
name: string; | ||
backgroundColor: string; | ||
} | ||
|
||
export default function Tag({ name, backgroundColor }: TagProps) { | ||
const textColor: string = getContrastColor(backgroundColor); | ||
|
||
return ( | ||
<div | ||
className="h-fit w-fit rounded-xl border-2 border-black px-3 py-1.5" | ||
style={{ backgroundColor, color: textColor }} | ||
> | ||
<span>{name}</span> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export const TECH_STACK = [ | ||
'Python', | ||
'FastAPI', | ||
'TypeScript', | ||
'React', | ||
'Next.js', | ||
'Tailwind CSS', | ||
'Supabase', | ||
'Discord.py', | ||
] as const; | ||
export type TechStack = (typeof TECH_STACK)[number]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { TechStack } from '@/constants/tech-stack'; | ||
|
||
export interface FutureProject { | ||
title: string; | ||
description: string; | ||
techStacks: TechStack[]; | ||
} | ||
|
||
export const FUTURE_PROJECTS: FutureProject[] = [ | ||
{ | ||
title: 'Courses API', | ||
description: | ||
'Scrapes course info from the UofA website and provides course data for other projects through an API endpoint.', | ||
techStacks: ['Python', 'FastAPI'], | ||
}, | ||
{ | ||
title: 'MyTimetable', | ||
description: | ||
'An interactive drag-and-drop timetable scheduler to help UofA students optimise their weekly timetable.', | ||
techStacks: ['TypeScript', 'React', 'Next.js', 'Tailwind CSS'], | ||
}, | ||
{ | ||
title: 'MyStudyPlan', | ||
description: | ||
'A UofA degree planner that allows you to explore and validate your degree structure.', | ||
techStacks: ['TypeScript', 'React', 'Next.js', 'Tailwind CSS'], | ||
}, | ||
{ | ||
title: 'MyCourseReviews', | ||
description: 'Allows students to share reviews and rate UofA courses.', | ||
techStacks: ['TypeScript', 'React', 'Next.js', 'Tailwind CSS', 'Supabase'], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters