Become a Pro / website · becomeapro.ai / src / app / page.tsx
| 1 | import Link from "next/link"; |
| 2 | import { BranchBand } from "@/components/branch-band"; |
| 3 | import { AREAS } from "@/lib/catalog"; |
| 4 | import { getFieldLessons } from "@/lib/lessons"; |
| 5 | import { pageMetadata, SITE_DESCRIPTION, SITE_TITLE } from "@/lib/seo"; |
| 6 | |
| 7 | export const metadata = pageMetadata({ title: SITE_TITLE, description: SITE_DESCRIPTION, absoluteTitle: true }); |
| 8 | |
| 9 | export default function HomePage() { |
| 10 | return ( |
| 11 | <div className="page"> |
| 12 | <h1 className="text-4xl font-bold md:text-5xl">Become a Pro</h1> |
| 13 | <p className="mt-4 text-xl">Free lessons that teach the useful skills of your trade, step by step.</p> |
| 14 | <div className="visitor-welcome mt-6" data-visitor-odometer="" data-visitor-site="becomeapro" /> |
| 15 | |
| 16 | {AREAS.map((area) => ( |
| 17 | <section key={area.slug} className="mt-12" aria-labelledby={`area-${area.slug}`}> |
| 18 | <h2 id={`area-${area.slug}`} className="text-2xl font-bold"> |
| 19 | <Link href={`/${area.slug}`} className="underline"> |
| 20 | {area.name} |
| 21 | </Link> |
| 22 | </h2> |
| 23 | <p className="mt-1 text-[var(--ash)]">{area.summary}</p> |
| 24 | <ul className="mt-3 list-disc space-y-1 pl-6"> |
| 25 | {area.fields.map((field) => { |
| 26 | const count = getFieldLessons(field.slug).length; |
| 27 | return ( |
| 28 | <li key={field.slug}> |
| 29 | <Link href={`/${area.slug}/${field.slug}`} className="underline"> |
| 30 | {field.name} |
| 31 | </Link> |
| 32 | {count > 0 && <span className="text-[var(--ash)]"> ({count === 1 ? "1 lesson" : `${count} lessons`})</span>} |
| 33 | </li> |
| 34 | ); |
| 35 | })} |
| 36 | </ul> |
| 37 | </section> |
| 38 | ))} |
| 39 | |
| 40 | <BranchBand /> |
| 41 | </div> |
| 42 | ); |
| 43 | } |