-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create page to show info about project
- Loading branch information
1 parent
6b67f6f
commit d68f42b
Showing
11 changed files
with
275 additions
and
22 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
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,27 @@ | ||
export default function Loading() { | ||
return ( | ||
<div | ||
className={"flex flex-col items-center h-screen justify-center w-full"} | ||
> | ||
<div role="status"> | ||
<svg | ||
aria-hidden="true" | ||
className="w-8 h-8 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" | ||
viewBox="0 0 100 101" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" | ||
fill="currentColor" | ||
/> | ||
<path | ||
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" | ||
fill="currentFill" | ||
/> | ||
</svg> | ||
<span className="sr-only">Loading...</span> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import BackButton from "@/components/shared/back"; | ||
import { Projects } from "@/constants"; | ||
import { upperFirst } from "@/utils/uppercase"; | ||
import { Metadata } from "next"; | ||
import Image from "next/image"; | ||
import { FiExternalLink, FiGithub } from "react-icons/fi"; | ||
|
||
export async function generateStaticParams() { | ||
return Projects.map((p) => ({ | ||
name: encodeURIComponent(p.name), | ||
})); | ||
} | ||
interface Props { | ||
params: { | ||
name: string; | ||
}; | ||
} | ||
|
||
export async function generateMetadata({ params }: Props): Promise<Metadata> { | ||
const project = Projects.find((p) => p.slug === params.name)!; | ||
|
||
return { | ||
title: project.name, | ||
description: project.description, | ||
openGraph: { | ||
type: "website", | ||
title: project.name, | ||
description: project.description, | ||
images: [ | ||
{ | ||
url: project.image?.url, | ||
width: project.image?.width, | ||
height: project.image?.height, | ||
alt: project.image?.alt, | ||
}, | ||
], | ||
}, | ||
twitter: { | ||
card: "summary_large_image", | ||
site: "@gurpalsingh287", | ||
}, | ||
}; | ||
} | ||
|
||
async function ProjectPage(props: Props) { | ||
const project = Projects.find((p) => p.slug === props.params.name)!; | ||
return ( | ||
<div className="min-h-screen lg:pt-20 pt-10 container items-center justify-center flex-col lg:max-w-xl"> | ||
<BackButton /> | ||
<Image | ||
className="max-w-[850px] max-h-[450px] mx-auto rounded-md mt-5" | ||
src={project.image?.url} | ||
alt={project.image?.alt} | ||
width={project.image?.width} | ||
height={project.image?.height} | ||
/> | ||
{project.image.source ? ( | ||
<p className="text-center text-gray-400">Source: {project.image.source}</p> | ||
) : null} | ||
<div className="flex flex-row items-center my-5"> | ||
<h1 className="text-2xl font-bold text-left">{project.name}</h1> | ||
<div className="flex flex-row items-center flex-nowrap ml-auto"> | ||
{Object.keys(project.urls).map((key: keyof typeof project.urls) => ( | ||
<a | ||
href={project.urls[key]} | ||
target="_blank" | ||
rel="noreferrer" | ||
key={key} | ||
className="flex flex-row items-center justify-start gap-2.5 | ||
text-white transition duration-300 ease-in-out | ||
bg-neutral-700 hover:bg-neutral-900 rounded-md px-3 py-2.5" | ||
> | ||
{key === "githubUrl" ? ( | ||
<FiGithub className="text-white text-xl" /> | ||
) : ( | ||
<FiExternalLink className="text-white text-xl" /> | ||
)} | ||
</a> | ||
))} | ||
</div> | ||
</div> | ||
|
||
<div className="flex flex-col items-start justify-start gap-2.5"> | ||
<p className="text-lg text-left text-gray-300">{project.description}</p> | ||
<div className="flex flex-row flex-wrap items-center justify-start gap-2.5"> | ||
{project.tags?.map((tag) => ( | ||
<span | ||
key={tag} | ||
className=" text-sm bg-neutral-200 text-black font-medium rounded-xl px-2 py-1" | ||
> | ||
{upperFirst(tag)} | ||
</span> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default ProjectPage; |
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,21 @@ | ||
"use client"; | ||
|
||
import { useRouter } from "next/navigation"; | ||
import { BiArrowBack } from "react-icons/bi"; | ||
|
||
export default function BackButton() { | ||
const { back } = useRouter(); | ||
return ( | ||
<button | ||
onClick={back} | ||
className="flex flex-row items-center justify-start gap-2.5 | ||
text-white transition duration-300 ease-in-out | ||
bg-neutral-700 hover:bg-neutral-900 rounded-md px-3 py-2.5" | ||
title="Back" | ||
aria-label="Back" | ||
aria-roledescription="button" | ||
> | ||
<BiArrowBack /> | ||
</button> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,23 +1,131 @@ | ||
interface Project { | ||
name: string; | ||
slug: string; | ||
image: { | ||
url: string; | ||
alt: string; | ||
width: number; | ||
height: number; | ||
source?: string; | ||
}; | ||
urls: { | ||
githubUrl?: string; | ||
liveUrl?: string; | ||
[key: string]: string | undefined; | ||
}; | ||
description: string; | ||
tags: string[]; | ||
} | ||
|
||
export const Projects = [ | ||
export const Projects: Project[] = [ | ||
{ | ||
name: "Lend My Skill", | ||
href: "https://github.com/PhantomKnight287/lend-my-skill", | ||
slug: "lend-my-skill", | ||
image: { | ||
url: "https://github.com/PhantomKnight287/lend-my-skill/blob/main/assets/lms-logo.png?raw=true", | ||
alt: "Lend My Skill", | ||
width: 164, | ||
height: 164, | ||
}, | ||
urls: { | ||
githubUrl: "https://github.com/PhantomKnight287/lend-my-skill", | ||
}, | ||
description: `A Freelance platform designed specially for Indians supporting payment methods like Rupay Card and UPI.`, | ||
tags: [ | ||
"Next.js", | ||
"TypeScript", | ||
"Tailwind CSS", | ||
"Nest.js", | ||
"Socket.io", | ||
"PostgreSQL", | ||
], | ||
}, | ||
{ | ||
name: "Voto", | ||
description: | ||
"A realtime voting platform where organisations can register and create junior admins to create and manage polls, register candidates and allow them to participate in certain polls, voters can register and vote for their favourite candidates and view a realtime graph of the results. Used by 3000 voters and over 7000 votes casted in the first 1 month of launch.", | ||
slug: "voto", | ||
urls: { | ||
liveUrl: "https://voto.com.ng", | ||
}, | ||
image: { | ||
url: "/voto.png", | ||
width: 417, | ||
height: 234, | ||
alt: "Voto", | ||
}, | ||
tags: [ | ||
"Next.js", | ||
"Express", | ||
"Typescript", | ||
"Cloudinary", | ||
"PostgreSQL", | ||
"Prisma", | ||
"Socket.io", | ||
"Tailwind CSS", | ||
"Mantine", | ||
"Chart.js", | ||
], | ||
}, | ||
{ | ||
name: "PhantomKnight", | ||
href: "https://github.com/PhantomKnight287/phantomknight", | ||
slug: "phantomknight", | ||
urls: { | ||
githubUrl: "https://github.com/PhantomKnight287/phantomknight", | ||
}, | ||
image: { | ||
url: "/phantomknight.jpg", | ||
alt: "PhantomKnight", | ||
width: 520, | ||
height: 360, | ||
source: "Unsplash.com", | ||
}, | ||
description: `A discord bot built using discord.js and TypeScript.`, | ||
tags: ["TypeScript", "Discord.js", "Node.js"], | ||
}, | ||
{ | ||
name: "Fluxt", | ||
href: "https://github.com/PhantomKnight287/fluxt", | ||
slug: "fluxt", | ||
urls: { | ||
githubUrl: "https://github.com/PhantomKnight287/fluxt", | ||
}, | ||
image: { | ||
url: "/chat.png", | ||
alt: "Fluxt", | ||
width: 360, | ||
height: 360, | ||
}, | ||
description: `A Realtime chat app created using flask,socket io and nextjs`, | ||
tags: ["Flask", "Socket.io", "Next.js", "TypeScript", "Mantine", "Sqlite3"], | ||
}, | ||
{ | ||
name: "Reactive Chat", | ||
href: "https://github.com/PhantomKnight287/reactnative", | ||
slug: "reactive-chat", | ||
urls: { | ||
githubUrl: "https://github.com/PhantomKnight287/reactnative", | ||
}, | ||
tags: ["React Native", "Firebase"], | ||
description: `A Realtime chat app created using React Native and Firebase`, | ||
image: { | ||
url: "/chat.png", | ||
alt: "Fluxt", | ||
width: 360, | ||
height: 360, | ||
}, | ||
}, | ||
{ | ||
name: "React Cli", | ||
href: "https://github.com/PhantomKnight287/react-cli", | ||
slug: "react-cli", | ||
urls: { | ||
githubUrl: "https://github.com/PhantomKnight287/react-cli", | ||
}, | ||
tags: ["Rust"], | ||
description: "A CLI tool to generate react components and hooks.", | ||
image: { | ||
url: "/cli.png", | ||
width: 360, | ||
height: 360, | ||
alt: "React Cli", | ||
}, | ||
}, | ||
]; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,2 @@ | ||
export const upperFirst = (str: string) => | ||
str.charAt(0).toUpperCase() + str.slice(1); |