Skip to content

Commit

Permalink
Build hero section for main pages (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
benborgers authored Jan 9, 2025
1 parent df01303 commit d0e6290
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 69 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always",
"source.organizeImports": "always"
}
}
18 changes: 18 additions & 0 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Hero from "@/components/hero";

export default function AboutPage() {
return (
<div>
<Hero
title={<>About</>}
subtitle={
<>
JumboCode is a student-run digital agency at Tufts University that
provides custom and high-quality software to nonprofits through
year-long pro bono projects.
</>
}
/>
</div>
);
}
24 changes: 24 additions & 0 deletions app/apply/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Button from "@/components/button";
import Hero from "@/components/hero";

export default function ApplyPage() {
return (
<div>
<Hero
title={<>Apply</>}
subtitle={
<>
Join us — we’re a passionate community of developers and designers
committed to building meaningful products for non-profits.
</>
}
buttons={
<>
<Button text="For students" href="/" variant="secondary" />
<Button text="For non-profits" href="/" variant="secondary" />
</>
}
/>
</div>
);
}
31 changes: 0 additions & 31 deletions app/components/button.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions app/dev/buttons/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ export default function Home() {
<div className="p-4 space-y-4 bg-black">
<Button
text="Email Us"
route="/testing"
href="/testing"
variant="primary"
icon={EnvelopeIcon}
/>

<Button
text="Email Us"
route="/testing"
href="/testing"
variant="secondary"
icon={EnvelopeIcon}
/>

<Button
text="Email Us"
route="/testing"
href="/testing"
variant="ghost"
icon={EnvelopeIcon}
/>

<Button text="Email Us" route="/testing" variant="primary" />
<Button text="Email Us" href="/testing" variant="primary" />
</div>
);
}
Binary file removed app/favicon.ico
Binary file not shown.
22 changes: 19 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import Nav from "@/components/nav";
import type { Metadata } from "next";
import Link from "next/link";
import "./globals.css";

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "JumboCode",
description: "TODO: description",
};

export default function RootLayout({
Expand All @@ -13,7 +15,21 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className="antialiased">{children}</body>
<body className="antialiased bg-gray-950">
<div className="max-w-screen-lg mx-auto px-4 pt-4 sm:pt-8 pb-24">
{/* Gradient background */}
<div className="absolute inset-0 h-[85vh] bg-gradient-to-b from-brand/25 to-gray-950 -z-10" />

<header className="flex justify-between items-center">
<Link href="/">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src="/logo.svg" alt="JumboCode" className="h-8" />
</Link>
<Nav />
</header>
<main>{children}</main>
</div>
</body>
</html>
);
}
42 changes: 17 additions & 25 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
import Button from "@/app/components/button";
import { EnvelopeIcon } from "@heroicons/react/24/outline";
import Button from "@/components/button";
import Hero from "@/components/hero";

export default function Home() {
export default function HomePage() {
return (
<div className="p-4 space-y-4 bg-black">
<Button
text="Email Us"
route="/testing"
variant="primary"
icon={EnvelopeIcon}
<div>
<Hero
title={
<>
Jumbo<span className="text-brand">Code</span>
</>
}
subtitle={<>Empowering students, Elevating non-profits.</>}
buttons={
<>
<Button text="What we do" href="/about" variant="secondary" />
<Button text="Get involved" href="/apply" variant="primary" />
</>
}
/>

<Button
text="Email Us"
route="/testing"
variant="secondary"
icon={EnvelopeIcon}
/>

<Button
text="Email Us"
route="/testing"
variant="ghost"
icon={EnvelopeIcon}
/>

<Button text="Email Us" route="/testing" variant="primary" />
</div>
);
}
20 changes: 20 additions & 0 deletions app/projects/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Button from "@/components/button";
import Hero from "@/components/hero";

export default function ProjectsPage() {
return (
<div>
<Hero
title={<>Projects</>}
subtitle={<>Check out our current and past projects!</>}
buttons={
<Button
text="View our GitHub"
href="https://github.com/jumbocode"
variant="secondary"
/>
}
/>
</div>
);
}
12 changes: 7 additions & 5 deletions components/button.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import clsx from "clsx";
import Link from "next/link";

export default function Button({
text,
route,
href,
variant,
icon = undefined,
}: {
text: string;
route: string;
href: string;
variant: "primary" | "secondary" | "ghost";
icon?: React.ElementType;
}) {
const Element = href.startsWith("/") ? Link : "a";
const Icon = icon;
return (
<a
href={route}
<Element
href={href}
className={clsx(
"block max-w-max px-4 py-2 rounded-lg font-semibold",
"flex items-center gap-2",
Expand All @@ -26,6 +28,6 @@ export default function Button({
>
{Icon && <Icon className="w-4 h-4" />}
<span>{text}</span>
</a>
</Element>
);
}
21 changes: 21 additions & 0 deletions components/hero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default function Hero({
title,
subtitle,
buttons,
}: {
title: React.ReactNode;
subtitle: React.ReactNode;
buttons?: React.ReactNode;
}) {
return (
<div className="py-24 sm:py-48">
<h1 className="text-white font-semibold text-4xl">{title}</h1>

<h2 className="mt-4 text-white/70 text-xl font-medium max-w-screen-md">
{subtitle}
</h2>

{buttons && <div className="mt-8 flex gap-x-4">{buttons}</div>}
</div>
);
}
32 changes: 32 additions & 0 deletions components/nav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"use client";

import clsx from "clsx";
import Link from "next/link";
import { usePathname } from "next/navigation";

export default function Nav() {
return (
<nav className="flex gap-x-6">
<NavLink href="/" label="Home" />
<NavLink href="/about" label="About" />
<NavLink href="/projects" label="Projects" />
<NavLink href="/apply" label="Apply" />
</nav>
);
}

function NavLink({ href, label }: { href: string; label: string }) {
const location = usePathname();
const isCurrent = location === href;
return (
<Link
href={href}
className={clsx(
"font-medium",
isCurrent ? "text-white" : "text-white/60"
)}
>
{label}
</Link>
);
}
76 changes: 76 additions & 0 deletions public/logo.svg
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 d0e6290

Please sign in to comment.