Skip to content

Commit c2daf7b

Browse files
committed
Accept subtitle prop in Hero
1 parent 062c65c commit c2daf7b

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

src/app/conf/2025/code-of-conduct/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ export default function ResourcesPage() {
1919
return (
2020
<>
2121
<NavbarPlaceholder className="top-0 bg-neu-0 before:bg-white/30 dark:bg-neu-0 dark:before:bg-blk/40" />
22-
<Hero pageName="Code of Conduct" year="2025">
22+
<Hero pageName="Code of conduct" subtitle="The Linux Foundation">
2323
<Button
24-
href="mailto:graphql_events@linuxfoundation.org"
24+
href="https://events.linuxfoundation.org/about/code-of-conduct/"
2525
className="mt-[18px] w-fit"
2626
>
27-
Talk to us
27+
See on The Linux Foundation
2828
</Button>
2929
</Hero>
3030
<main className="gql-all-anchors-focusable gql-conf-navbar-strip text-neu-900 before:bg-white/40 before:dark:bg-blk/30">

src/app/conf/2025/components/hero/index.tsx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,35 @@ import GraphQLFoundationWordmark from "../../assets/graphql-foundation-wordmark.
66
import { ImageLoaded } from "../image-loaded"
77
import blurBean from "./blur-bean-cropped.webp"
88

9-
export function Hero({
10-
pageName,
11-
year,
12-
children,
13-
bottom,
14-
}: {
9+
export type HeroProps = {
1510
pageName?: string
16-
year: string
1711
children: React.ReactNode
1812
bottom?: React.ReactNode
19-
}) {
13+
} & (
14+
| { year: string | number; subtitle?: never }
15+
| { year?: never; subtitle: string }
16+
)
17+
18+
export function Hero(props: HeroProps) {
2019
return (
2120
<article className="gql-conf-navbar-strip relative isolate flex flex-col justify-center bg-pri-base text-neu-0 selection:bg-blk/40 before:bg-white/30 dark:bg-pri-darker dark:text-neu-900 dark:selection:bg-white/40 before:dark:bg-blk/40">
2221
<article className="relative">
2322
<HeroStripes />
2423
<div className="gql-conf-container mx-auto flex max-w-full flex-col gap-12 overflow-hidden p-4 pt-6 sm:p-8 sm:pt-12 md:gap-12 md:bg-left md:p-12 lg:px-24 lg:pb-16 lg:pt-24">
2524
<div className="flex gap-10 max-md:flex-col md:justify-between">
26-
{pageName ? (
25+
{props.pageName ? (
2726
<div>
2827
<span className="typography-h3 text-sec-base">
29-
GraphQLConf {year}
28+
{props.year ? `GraphQLConf ${props.year}` : props.subtitle}
3029
</span>
31-
<h1 className="typography-d1">{pageName}</h1>
30+
<h1 className="typography-d1">{props.pageName}</h1>
3231
</div>
3332
) : (
3433
<h1 className="typography-d1 flex flex-wrap gap-2">
3534
<span>GraphQLConf</span>
36-
<span className="text-sec-base">{year}</span>
35+
<span className="text-sec-base">
36+
{props.year || props.subtitle}
37+
</span>
3738
</h1>
3839
)}
3940
<div className="flex h-min items-center gap-4">
@@ -44,10 +45,10 @@ export function Hero({
4445
</div>
4546
</div>
4647

47-
<div className="flex flex-col gap-8">{children}</div>
48+
<div className="flex flex-col gap-8">{props.children}</div>
4849
</div>
4950
</article>
50-
{bottom}
51+
{props.bottom}
5152
</article>
5253
)
5354
}

0 commit comments

Comments
 (0)