@@ -6,34 +6,35 @@ import GraphQLFoundationWordmark from "../../assets/graphql-foundation-wordmark.
6
6
import { ImageLoaded } from "../image-loaded"
7
7
import blurBean from "./blur-bean-cropped.webp"
8
8
9
- export function Hero ( {
10
- pageName,
11
- year,
12
- children,
13
- bottom,
14
- } : {
9
+ export type HeroProps = {
15
10
pageName ?: string
16
- year : string
17
11
children : React . ReactNode
18
12
bottom ?: React . ReactNode
19
- } ) {
13
+ } & (
14
+ | { year : string | number ; subtitle ?: never }
15
+ | { year ?: never ; subtitle : string }
16
+ )
17
+
18
+ export function Hero ( props : HeroProps ) {
20
19
return (
21
20
< 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" >
22
21
< article className = "relative" >
23
22
< HeroStripes />
24
23
< 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" >
25
24
< div className = "flex gap-10 max-md:flex-col md:justify-between" >
26
- { pageName ? (
25
+ { props . pageName ? (
27
26
< div >
28
27
< span className = "typography-h3 text-sec-base" >
29
- GraphQLConf { year }
28
+ { props . year ? ` GraphQLConf ${ props . year } ` : props . subtitle }
30
29
</ span >
31
- < h1 className = "typography-d1" > { pageName } </ h1 >
30
+ < h1 className = "typography-d1" > { props . pageName } </ h1 >
32
31
</ div >
33
32
) : (
34
33
< h1 className = "typography-d1 flex flex-wrap gap-2" >
35
34
< span > GraphQLConf</ span >
36
- < span className = "text-sec-base" > { year } </ span >
35
+ < span className = "text-sec-base" >
36
+ { props . year || props . subtitle }
37
+ </ span >
37
38
</ h1 >
38
39
) }
39
40
< div className = "flex h-min items-center gap-4" >
@@ -44,10 +45,10 @@ export function Hero({
44
45
</ div >
45
46
</ div >
46
47
47
- < div className = "flex flex-col gap-8" > { children } </ div >
48
+ < div className = "flex flex-col gap-8" > { props . children } </ div >
48
49
</ div >
49
50
</ article >
50
- { bottom }
51
+ { props . bottom }
51
52
</ article >
52
53
)
53
54
}
0 commit comments