Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion packages/nextjs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Inter, JetBrains_Mono } from "next/font/google";
import QueryClientProviderWrapper from "./QueryClientProvider";
import "@rainbow-me/rainbowkit/styles.css";
import "@scaffold-ui/components/styles.css";
Expand All @@ -6,6 +7,18 @@ import { ThemeProvider } from "~~/components/ThemeProvider";
import "~~/styles/globals.css";
import { getMetadata } from "~~/utils/scaffold-eth/getMetadata";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
display: "swap",
});

const jetbrainsMono = JetBrains_Mono({
subsets: ["latin"],
variable: "--font-mono",
display: "swap",
});

export const metadata = getMetadata({
title: "Batch #22 | BuidlGuidl",
description:
Expand All @@ -14,7 +27,7 @@ export const metadata = getMetadata({

const ScaffoldEthApp = ({ children }: { children: React.ReactNode }) => {
return (
<html suppressHydrationWarning>
<html suppressHydrationWarning className={`${inter.variable} ${jetbrainsMono.variable}`}>
<body>
<QueryClientProviderWrapper>
<ThemeProvider enableSystem>
Expand Down
69 changes: 19 additions & 50 deletions packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,61 +1,30 @@
"use client";

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 { ActionCards } from "~~/components/ActionCards";
import { BatchStatus } from "~~/components/BatchStatus";

const Home: NextPage = () => {
const { data: checkedInCounter, isSuccess: isCheckedInCounterSuccess } = useScaffoldReadContract({
contractName: "BatchRegistry",
functionName: "checkedInCounter",
});

return (
<>
<div className="flex items-center flex-col grow pt-10">
<div className="px-5">
<h1 className="text-center">
<span className="block text-2xl mb-2">Welcome to</span>
<span className="block text-4xl font-bold">Batch 22</span>
</h1>
<p className="text-center text-lg mt-2">Building the future of web3 together</p>
<p className="text-lg flex gap-2 justify-center mt-6">
<span className="font-bold">Checked in builders count:</span>
{isCheckedInCounterSuccess ? (
<span>{checkedInCounter ? checkedInCounter.toString() : 0}</span>
) : (
<span className="loading loading-spinner"></span>
)}
</p>
</div>
<div className="batch22-home min-h-screen w-full flex flex-col items-center">
<section className="hero relative flex flex-col items-center text-center px-5 pt-14 pb-10">
<h1 className="text-5xl font-semibold tracking-tight">
Batch <span className="opacity-90">22</span>
</h1>

<p className="mt-4 max-w-xl text-lg opacity-70">A decentralized cohort learning and building Web3</p>

<div className="grow bg-base-300 w-full mt-16 px-8 py-12">
<div className="flex justify-center items-center gap-12 flex-col md:flex-row">
<div className="flex flex-col bg-base-100 px-10 py-10 text-center items-center max-w-xs rounded-3xl">
<BugAntIcon className="h-8 w-8 fill-secondary" />
<p>
Tinker with your smart contract using the{" "}
<Link href="/debug" passHref className="link">
Debug Contracts
</Link>{" "}
tab.
</p>
</div>
<div className="flex flex-col bg-base-100 px-10 py-10 text-center items-center max-w-xs rounded-3xl">
<MagnifyingGlassIcon className="h-8 w-8 fill-secondary" />
<p>
Explore your local transactions with the{" "}
<Link href="/blockexplorer" passHref className="link">
Block Explorer
</Link>{" "}
tab.
</p>
</div>
</div>
<div className="mt-6 h-px w-32 bg-gradient-to-r from-transparent via-white/20 to-transparent" />

<div className="batch-state-wrapper">
<BatchStatus />
</div>
</div>
</>
</section>

<section className="relative -mt-6 flex justify-center">
<ActionCards />
</section>
</div>
);
};

Expand Down
35 changes: 35 additions & 0 deletions packages/nextjs/components/ActionCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { ReactNode } from "react";
import Link from "next/link";

type ActionCardProps = {
href: string;
icon: ReactNode;
title: string;
description: string;
};

export function ActionCard({ href, icon, title, description }: ActionCardProps) {
return (
<Link href={href} className="group">
<div
className="
flex flex-col items-center justify-center text-center gap-3
w-64 h-40 rounded-2xl
bg-base-200
border border-base-300
shadow-[0_10px_30px_rgba(0,0,0,0.35)]
backdrop-blur-sm
transition-all duration-300
hover:-translate-y-1
"
>
<div className="action-card-icon">{icon}</div>

<div>
<h3 className="font-semibold">{title}</h3>
<p className="text-sm opacity-70">{description}</p>
</div>
</div>
</Link>
);
}
22 changes: 22 additions & 0 deletions packages/nextjs/components/ActionCards.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ActionCard } from "./ActionCard";
import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";

export function ActionCards() {
return (
<section className="relative mt-10 flex justify-center gap-24">
<ActionCard
href="/debug"
icon={<BugAntIcon className="h-8 w-8" />}
title="Debug Contracts"
description="Interact with the batch smart contracts"
/>
<div className="connector" />
<ActionCard
href="/blockexplorer"
icon={<MagnifyingGlassIcon className="h-8 w-8" />}
title="Block Explorer"
description="Explore local transactions and blocks"
/>
</section>
);
}
58 changes: 58 additions & 0 deletions packages/nextjs/components/BatchStatus.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import Link from "next/link";
import { useScaffoldReadContract } from "~~/hooks/scaffold-eth";

export function BatchStatus() {
useScaffoldReadContract({
contractName: "BatchRegistry",
functionName: "checkedInCounter",
});

return (
<Link href="/builders" className="block w-full max-w-3xl">
<section
className="
relative
rounded-3xl
bg-base-200
border border-base-300
px-12 py-10
transition-shadow
hover:shadow-[0_24px_60px_rgba(0,0,0,0.25)]
"
>
{/* Title */}
<header className="mb-8">
<h2 className="text-2xl font-semibold tracking-tight">Batch Status</h2>
</header>

{/* Grid */}
<div className="grid grid-cols-2 gap-y-6 gap-x-12 text-base">
<div>
<div className="text-sm opacity-60">Builders onboarded</div>
<div className="mt-1 text-2xl font-mono font-semibold">16</div>
</div>

<div>
<div className="text-sm opacity-60">Registry status</div>
<div className="mt-1 text-lg font-semibold text-success">Active</div>
</div>

<div>
<div className="text-sm opacity-60">Deployment</div>
<div className="mt-1 font-mono text-lg">Arbitrum</div>
</div>

<div>
<div className="text-sm opacity-60">Current phase</div>
<div className="mt-1 text-lg font-medium">Actively building</div>
</div>
</div>

{/* Footer CTA */}
<footer className="mt-10 flex justify-end">
<div className="batch-cta mt-6 text-sm font-medium">View builders →</div>
</footer>
</section>
</Link>
);
}
50 changes: 50 additions & 0 deletions packages/nextjs/styles/globals.css
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if you've used Tailwind to style, we find it easier to read and style the code by adding pre-built CSS classes directly to the HTML.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback!
That makes sense, I agree using Tailwind utility classes directly keeps styling more readable and easier to maintain. I’ll refactor the home page styling to rely on Tailwind classes instead of custom CSS rules, while keeping everything scoped to the Batch 22 home page.

I’ll push an update shortly.

Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,53 @@
.link:hover {
opacity: 80%;
}

/* =========================
Batch 22 Home – Scoped Styles
========================= */

/* Background depth only for Batch 22 home */
[data-theme="dark"] .batch22-home {
background:
radial-gradient(1200px 600px at 50% -10%, rgba(73, 105, 166, 0.18), transparent 60%),
radial-gradient(900px 500px at 80% 20%, rgba(73, 105, 166, 0.12), transparent 55%),
linear-gradient(180deg, var(--color-base-200), var(--color-base-200));
}

[data-theme="light"] .batch22-home {
background:
radial-gradient(900px 500px at 50% -10%, rgba(147, 187, 251, 0.18), transparent 60%),
linear-gradient(180deg, var(--color-base-200), var(--color-base-200));
}
/* Subtle depth for cards on home only */
.batch22-home .card,
.batch22-home .bg-base-200 {
backdrop-filter: saturate(110%);
}
.batch22-home > .hero {
background: radial-gradient(700px 300px at 50% 0%, rgba(147, 187, 251, 0.12), transparent 70%);
}
.batch22-home .batch-state-wrapper {
position: relative;
}

.batch22-home .batch-state-wrapper::before {
content: "";
position: absolute;
inset: -40px;
background: radial-gradient(300px 200px at 50% 30%, rgba(147, 187, 251, 0.18), transparent 70%);
z-index: -1;
pointer-events: none;
}

.batch22-home .connector {
height: 1px;
width: 120px;
background: linear-gradient(90deg, transparent, rgba(147, 187, 251, 0.4), transparent);
}
[data-theme="dark"] .batch22-home .batch-cta {
color: #9bbcff;
}
[data-theme="dark"] .batch22-home .action-card-icon {
color: #9bbcff;
}