@@ -44,6 +44,7 @@ import Text from "../components/OldText"
44
44
import GlossaryTooltip from "../components/Glossary/GlossaryTooltip"
45
45
import MdLink from "../components/MdLink"
46
46
import LeftNavBar from "../components/LeftNavBar"
47
+ import { HubHero } from "../components/Hero"
47
48
import {
48
49
Page ,
49
50
ContentContainer ,
@@ -143,11 +144,16 @@ const components = {
143
144
}
144
145
145
146
const RoadmapPage = ( {
146
- data : { pageData : mdx } ,
147
+ data : { pageData : mdx , heroImage } ,
147
148
location,
148
149
} : PageProps < Queries . RoadmapPageQuery , Context > ) => {
149
150
// TODO: Replace with direct token implementation after UI migration is completed
150
151
const lgBp = useToken ( "breakpoints" , "lg" )
152
+ const parsedPathname = location . pathname
153
+ . split ( "/" )
154
+ . filter ( ( item ) => item !== "" )
155
+ . slice ( 1 )
156
+ . join ( "/" )
151
157
152
158
if ( ! mdx ?. frontmatter )
153
159
throw new Error (
@@ -213,58 +219,67 @@ const RoadmapPage = ({
213
219
214
220
return (
215
221
< Box position = "relative" >
216
- < HeroContainer >
217
- < Flex w = "100%" flexDirection = { { base : "column" , md : "row" } } >
218
- < TitleCard >
219
- < Breadcrumbs slug = { location . pathname } mb = "8" />
220
- < Title > { mdx . frontmatter . title } </ Title >
221
- < Text > { mdx . frontmatter . description } </ Text >
222
- { mdx ?. frontmatter ?. buttons && (
223
- // FIXME: remove the `ul` override once removed the corresponding
224
- // global styles in `src/@chakra-ui/gatsby-plugin/styles.ts`
225
- < Wrap spacing = { 2 } marginBottom = { 4 } sx = { { ul : { m : 0 } } } >
226
- { mdx . frontmatter . buttons . map ( ( button , idx ) => {
227
- if ( button ?. to ) {
222
+ { parsedPathname === "roadmap" ? (
223
+ < HubHero
224
+ heroImgSrc = { getImage ( heroImage ) ! }
225
+ header = { mdx . frontmatter . title }
226
+ title = { "" }
227
+ description = { mdx . frontmatter . description }
228
+ />
229
+ ) : (
230
+ < HeroContainer >
231
+ < Flex w = "100%" flexDirection = { { base : "column" , md : "row" } } >
232
+ < TitleCard >
233
+ < Breadcrumbs slug = { location . pathname } mb = "8" />
234
+ < Title > { mdx . frontmatter . title } </ Title >
235
+ < Text > { mdx . frontmatter . description } </ Text >
236
+ { mdx ?. frontmatter ?. buttons && (
237
+ // FIXME: remove the `ul` override once removed the corresponding
238
+ // global styles in `src/@chakra-ui/gatsby-plugin/styles.ts`
239
+ < Wrap spacing = { 2 } marginBottom = { 4 } sx = { { ul : { m : 0 } } } >
240
+ { mdx . frontmatter . buttons . map ( ( button , idx ) => {
241
+ if ( button ?. to ) {
242
+ return (
243
+ < WrapItem >
244
+ < ButtonLink
245
+ key = { idx }
246
+ variant = { button ?. variant }
247
+ to = { button ?. to }
248
+ >
249
+ { button . label }
250
+ </ ButtonLink >
251
+ </ WrapItem >
252
+ )
253
+ }
228
254
return (
229
255
< WrapItem >
230
- < ButtonLink
256
+ < Button
231
257
key = { idx }
232
258
variant = { button ?. variant }
233
- to = { button ?. to }
259
+ toId = { button ?. toId }
234
260
>
235
- { button . label }
236
- </ ButtonLink >
261
+ { button ? .label }
262
+ </ Button >
237
263
</ WrapItem >
238
264
)
239
- }
240
- return (
241
- < WrapItem >
242
- < Button
243
- key = { idx }
244
- variant = { button ?. variant }
245
- toId = { button ?. toId }
246
- >
247
- { button ?. label }
248
- </ Button >
249
- </ WrapItem >
250
- )
251
- } ) }
252
- </ Wrap >
253
- ) }
254
- < TableOfContents
255
- position = "relative"
256
- zIndex = "2"
257
- items = { tocItems }
258
- isMobile
265
+ } ) }
266
+ </ Wrap >
267
+ ) }
268
+ < TableOfContents
269
+ position = "relative"
270
+ zIndex = "2"
271
+ items = { tocItems }
272
+ isMobile
273
+ />
274
+ </ TitleCard >
275
+ < HeroImage
276
+ image = { getImage ( mdx . frontmatter . image ) ! }
277
+ alt = { mdx . frontmatter . alt || "" }
278
+ objectFit = "contain"
259
279
/>
260
- </ TitleCard >
261
- < HeroImage
262
- image = { getImage ( mdx . frontmatter . image ) ! }
263
- alt = { mdx . frontmatter . alt || "" }
264
- objectFit = "contain"
265
- />
266
- </ Flex >
267
- </ HeroContainer >
280
+ </ Flex >
281
+ </ HeroContainer >
282
+ ) }
268
283
< Page dir = { isRightToLeft ? "rtl" : "ltr" } >
269
284
< PageMetadata
270
285
title = { mdx . frontmatter . title }
@@ -309,6 +324,16 @@ export const roadmapPageQuery = graphql`
309
324
}
310
325
}
311
326
}
327
+ heroImage: file(relativePath: { eq: "heroes/roadmap-hub-hero.jpg" }) {
328
+ childImageSharp {
329
+ gatsbyImageData(
330
+ width: 1504
331
+ layout: CONSTRAINED
332
+ placeholder: BLURRED
333
+ quality: 100
334
+ )
335
+ }
336
+ }
312
337
pageData: mdx(fields: { relativePath: { eq: $relativePath } }) {
313
338
fields {
314
339
slug
0 commit comments