Skip to content

Commit

Permalink
Merge branch 'main' into checkedin-counter
Browse files Browse the repository at this point in the history
  • Loading branch information
phipsae authored Dec 12, 2024
2 parents a469fb2 + 49dc849 commit 62bb542
Show file tree
Hide file tree
Showing 11 changed files with 915 additions and 13 deletions.
19 changes: 19 additions & 0 deletions packages/nextjs/app/api/builders/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { NextResponse } from "next/server";
import { readdir } from "fs/promises";
import path from "path";

export async function GET() {
const buildersPath = path.join(process.cwd(), "app/builders");

try {
const directories = await readdir(buildersPath, { withFileTypes: true });
const addresses = directories
.filter(dirent => dirent.isDirectory())
.map(dirent => dirent.name)
.filter(name => name.startsWith("0x"));

return NextResponse.json(addresses);
} catch {
return NextResponse.json([], { status: 500 });
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import Link from "next/link";
import type { NextPage } from "next";

const RoheemahBuilderPage: NextPage = () => {
return (
<div className="min-h-screen flex flex-col md:flex-row items-start justify-start gap-16 px-4 md:px-20">
<div className="flex-1">
<div className="flex flex-col-reverse lg:flex-row items-center lg:items-start justify-start gap-14 mt-20">
<div className="relative">
<div className="absolute top-0 left-0 w-full h-full bg-[#9BF9F3] rounded-tl-[100px] rounded-br-[100px] -z-10 transform -translate-x-[4px] -translate-y-[4px]"></div>
<div className="leaf-shaped py-8 px-6 md:px-10 border-2 flex flex-col items-center justify-start bg-[#0D1117] rounded-tl-[100px] rounded-br-[100px] relative z-10">
<div className="flex flex-col items-center justify-start">
<div className="w-24 h-24 rounded-full bg-cover bg-center bg-no-repeat border-2 border-[#6EF4E6] text-[20px] font-bold text-white flex items-center justify-center">
A.R.A
</div>
<p className="text-[24px] font-normal">Roheemah</p>
<p className="text-md text-[#9B9EA1]">Frontend & Blockchain Dev</p>
</div>
<div className="mt-6 text-[#9B9EA1]">
{[
{ icon: "link", text: "[email protected]", href: "mailto:[email protected]" },
{
icon: "link",
text: "www.github.com/AbolareRoheemah",
href: "https://www.github.com/AbolareRoheemah",
},
{ icon: "link", text: "https://rhorheeymarh.vercel.app", href: "https://rhorheeymarh.vercel.app" },
].map(({ text, href }) => (
<div key={text} className="flex items-center justify-start gap-4 mb-4">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#6AECD9"
className="size-6"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"
/>
</svg>
{href ? <Link href={href}>{text}</Link> : <span>{text}</span>}
</div>
))}
</div>
<div className="flex items-center justify-between flex-wrap gap-2">
{["HTML/CSS", "JS", "REACT", "NEXT", "VUE", "NUXT", "SOLIDITY", "RUST"].map(skill => (
<p
key={skill}
className="bg-[#9BF9F3] text-[#000] text-center text-sm px-2 py-[1px] basis-2/12 rounded-full"
>
{skill}
</p>
))}
</div>
<a
href="https://docs.google.com/document/d/1iLtYWAaMytZ2K9NEQ3f8LVEUUOVBfcGFhkmYYE1tPdI/edit?usp=sharing"
download="Abolare_Roheemah_CV.pdf"
target="_blank"
rel="noopener noreferrer"
className="flex items-center justify-center gap-4 bg-white px-8 text-[#000] rounded-full font-medium mt-4 cursor-pointer"
>
<p>Click to view CV</p>
</a>
</div>
</div>
<div className="flex flex-col md:flex-row md:items-start md:justify-start gap-10 pt-10">
<div className="">
<div>
<p className="text-sm text-[#6AECD9]">&lt;h1&gt;</p>
<p className="text-[34px] lg:text-[46px] pl-4 leading-[50px] font-medium">Hey👋</p>
<p className="text-[34px] lg:text-[46px] pl-4 leading-[50px] font-medium">
I&apos;m <span className="text-[#6AECD9]">Roheemah</span>,
</p>
<p className="text-[34px] lg:text-[46px] leading-[50px] font-medium ml-[1rem]">
Frontend & Blockchain Developer
</p>
<p>
{" "}
<span className="text-sm text-[#6AECD9]">&lt;/h1&gt;</span>
</p>
</div>
<div className="mt-8">
<p className="text-sm text-[#6AECD9]">&lt;p&gt;</p>
<p className="pl-4 text-md font-bold text-[#9B9EA1]">
I build user-friendly and visually appealing web applications. I also design, implement and maintain
blockchain based applications. I love meeting people and having meaningful conversations :)
</p>
<p className="text-sm text-[#6AECD9]">&lt;/p&gt;</p>
</div>
</div>
<div className="py-10 px-8 bg-[#1A1E23] rounded-lg md:rounded-full">
{[
{ number: "4", text: "Programming Languages" },
{ number: "6", text: "Development Tools" },
{ number: "3+", text: "Years of Experience" },
].map(item => (
<div
key={item.text}
className="flex items-center justify-start md:items-center md:justify-center gap-4 mt-8"
>
<p className="text-[#6AECD9] text-[50px] font-medium">{item.number}</p>
<p className="text-md font-bold text-[#9B9EA1]">{item.text}</p>
</div>
))}
</div>
</div>
</div>
</div>
</div>
);
};

export default RoheemahBuilderPage;
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const GbolahanAkandeBuilderPage: NextPage = () => {
<div className={styles.card}>
<div className={styles.profileSection}>
<div className={styles.avatarContainer}>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={builderDetails.avatar} alt="Profile" className={styles.avatar} />
</div>
<div className={styles.nameSection}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const DeveloperProfilePage: NextPage = () => {
{/* Hero Section */}
<div className="text-center mb-16">
<div className="relative inline-block mb-8">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src="https://avatars.githubusercontent.com/u/71647648?v=4"
alt="Profile"
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "~~/styles/globals.css";
import { getMetadata } from "~~/utils/scaffold-eth/getMetadata";

export const metadata = getMetadata({
title: "Scaffold-ETH 2 App",
title: "BuidlGuidl-Batch-11",
description: "Built with 🏗 Scaffold-ETH 2",
});

Expand Down
3 changes: 3 additions & 0 deletions packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Link from "next/link";
import type { NextPage } from "next";
import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
import { useScaffoldReadContract } from "~~/hooks/scaffold-eth";
import BuildersGrid from "~~/components/batch/BuildersGrid";

const Home: NextPage = () => {
const { data: checkedInCounter } = useScaffoldReadContract({
Expand Down Expand Up @@ -50,6 +51,8 @@ const Home: NextPage = () => {
</div>
</div>
</div>
{/* Builders Grid */}
<BuildersGrid />
</div>
</>
);
Expand Down
13 changes: 11 additions & 2 deletions packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,17 @@ export const Header = () => {
<Image alt="SE2 logo" className="cursor-pointer" fill src="/logo.svg" />
</div>
<div className="flex flex-col">
<span className="font-bold leading-tight">Scaffold-ETH</span>
<span className="text-xs">Ethereum dev stack</span>
<span className="font-bold leading-tight">Batch #11</span>
<div className="text-xs flex items-center justify-center gap-1">
Guardians of the Chain
<Image
alt="SE2 Subtitle Icon"
className="cursor-pointer"
width={20}
height={20}
src="/spartan_icon.svg"
/>
</div>
</div>
</Link>
<ul className="hidden lg:flex lg:flex-nowrap menu menu-horizontal px-1 gap-2">
Expand Down
72 changes: 72 additions & 0 deletions packages/nextjs/components/batch/BuildersGrid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import Link from "next/link";
import { useQuery } from "@tanstack/react-query";
import { Address } from "~~/components/scaffold-eth";
import { useScaffoldEventHistory } from "~~/hooks/scaffold-eth";

const BuildersGrid = () => {
// Get builder profiles from filesystem
const { data: profileBuilders = [], isLoading: profilesLoading } = useQuery<string[]>({
queryKey: ["builders-profiles"],
queryFn: async () => {
const response = await fetch("/api/builders");
if (!response.ok) throw new Error("Failed to fetch builders");
return response.json();
},
});

// Get checked-in builders from contract events
const { data: events, isLoading: eventsLoading } = useScaffoldEventHistory({
contractName: "BatchRegistry",
eventName: "CheckedIn",
fromBlock: 127324219n,
});

if (profilesLoading || eventsLoading) {
return (
<div className="w-full px-6 py-8 text-center">
<span className="loading loading-spinner loading-lg text-primary"></span>
</div>
);
}

const buildersWithoutProfile = (events ?? [])
.map(event => event.args.builder)
.filter(address => address && !profileBuilders.includes(address));

return (
<div className="w-full px-6 py-8">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{profileBuilders.map((address, idx) => (
<div
key={`${address}-${idx}`}
className="bg-base-100 rounded-xl p-6 shadow-lg hover:shadow-xl transition-all duration-200 border border-base-200"
>
<div className="flex flex-col gap-2">
<Address address={address} size="lg" />
<div className="flex justify-between items-center">
<Link href={`/builders/${address}`} className="text-sm font-semibold hover:underline">
View Profile →
</Link>
</div>
</div>
</div>
))}
{buildersWithoutProfile.map((address, idx) => (
<div
key={`${address}-${idx}`}
className="bg-base-100 rounded-xl p-6 shadow-lg hover:shadow-xl transition-all duration-200 border border-base-200"
>
<div className="flex flex-col gap-2">
<Address address={address} size="lg" />
<div className="flex justify-between items-center">
<span className="text-sm font-semibold text-primary">No Profile</span>
</div>
</div>
</div>
))}
</div>
</div>
);
};

export default BuildersGrid;
Binary file modified packages/nextjs/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 62bb542

Please sign in to comment.