11import { FC , ReactNode } from 'react' ;
2- import { GitHubIcon , PaperIcon , PencilIcon , PRODUCTS } from '@theguild/components' ;
3- import { getDefaultMetadata , getPageMap , GuildLayout } from '@theguild/components/server' ;
2+ import localFont from 'next/font/local' ;
3+ import {
4+ Anchor ,
5+ GitHubIcon ,
6+ HiveFooter ,
7+ HiveNavigation ,
8+ ListIcon ,
9+ PaperIcon ,
10+ PencilIcon ,
11+ PRODUCTS ,
12+ YogaIcon ,
13+ } from '@theguild/components' ;
14+ import { getPageMap , HiveLayout } from '@theguild/components/server' ;
415import '@theguild/components/style.css' ;
516import { pageMap as changelogsPageMap } from './changelogs/[...slug]/page' ;
17+ import { rootMetadata , websiteDescription } from './metadata' ;
618import { pageMap as v2PageMap } from './v2/[[...slug]]/page' ;
719import { pageMap as v3PageMap } from './v3/[[...slug]]/page' ;
820import { pageMap as v4PageMap } from './v4/[[...slug]]/page' ;
921import { VersionDropdown } from './version-dropdown.client' ;
1022import { VersionedSearch } from './versioned-search' ;
23+ import './global.css' ;
24+ import { Metadata } from 'next' ;
1125
12- const description = PRODUCTS . YOGA . title ;
13- const websiteName = 'Yoga' ;
26+ export const metadata : Metadata = rootMetadata ;
1427
15- export const metadata = getDefaultMetadata ( {
16- description,
17- websiteName,
18- productName : 'YOGA' ,
28+ const neueMontreal = localFont ( {
29+ src : [
30+ { path : '../fonts/PPNeueMontreal-Regular.woff2' , weight : '400' } ,
31+ { path : '../fonts/PPNeueMontreal-Medium.woff2' , weight : '500' } ,
32+ // Medium is actually 530, so we use it both for 500 and 600
33+ { path : '../fonts/PPNeueMontreal-Medium.woff2' , weight : '600' } ,
34+ { path : '../fonts/PPNeueMontreal-SemiBold.woff2' , weight : '700' } ,
35+ ] ,
1936} ) ;
2037
2138const RootLayout : FC < {
2239 children : ReactNode ;
2340} > = async ( { children } ) => {
24- let [ meta , ...pageMap ] = await getPageMap ( ) ;
25- pageMap = [
41+ let [ meta , ..._pageMap ] = await getPageMap ( ) ;
42+ _pageMap = [
2643 {
2744 data : {
2845 // @ts -expect-error -- ignore
@@ -33,56 +50,71 @@ const RootLayout: FC<{
3350 v4 : { type : 'page' , title : 'Yoga 4 Docs' } ,
3451 } ,
3552 } ,
36- ...pageMap ,
53+ ..._pageMap ,
3754 { route : '/changelogs' , name : 'changelogs' , children : changelogsPageMap } ,
3855 { route : '/v4' , name : 'v4' , children : v4PageMap } ,
3956 { route : '/v3' , name : 'v3' , children : v3PageMap } ,
4057 { route : '/v2' , name : 'v2' , children : v2PageMap } ,
4158 ] ;
59+
4260 return (
43- < GuildLayout
44- htmlProps = { {
45- // Override nav width
46- className : '[&>.light_#h-navmenu-container]:max-w-[1392px]' ,
47- } }
48- websiteName = { websiteName }
49- description = { description }
50- logo = { < PRODUCTS . YOGA . logo className = "w-8 h-auto" /> }
51- layoutProps = { {
52- docsRepositoryBase : 'https://github.com/graphql-hive/graphql-yoga/tree/main/website' ,
53- } }
54- pageMap = { pageMap }
55- navbarProps = { {
56- navLinks : [ { href : '/tutorial' , children : 'Tutorial' } ] ,
57- developerMenu : [
58- {
59- href : '/docs' ,
60- icon : < PaperIcon /> ,
61- children : 'Documentation' ,
62- } ,
63- {
64- href : 'https://the-guild.dev/graphql/hive/blog' ,
65- icon : < PencilIcon /> ,
66- children : 'Blog' ,
67- } ,
68- {
69- href : 'https://github.com/graphql-hive/graphql-yoga' ,
70- icon : < GitHubIcon /> ,
71- children : 'GitHub' ,
72- } ,
73- {
74- href : '/changelog' ,
75- icon : null ,
76- children : 'Changelog' ,
77- } ,
78- ] ,
79- children : < VersionDropdown /> ,
80- } }
81- search = { < VersionedSearch /> }
61+ < HiveLayout
62+ className = "[&>.light_#h-navmenu-container]:max-w-[1392px]"
63+ fontFamily = { neueMontreal . style . fontFamily }
64+ docsRepositoryBase = "https://github.com/graphql-hive/graphql-yoga/tree/main/website"
65+ head = { null }
8266 lightOnlyPages = { [ '/' ] }
67+ navbar = {
68+ < HiveNavigation
69+ productName = { PRODUCTS . YOGA . name }
70+ logo = {
71+ < Anchor href = "/" className = "hive-focus -m-2 flex items-center rounded-md p-2 gap-2" >
72+ < YogaIcon className = "size-8 shrink-0" />
73+ < span className = "text-2xl font-medium tracking-[-0.16px]" > Yoga</ span >
74+ </ Anchor >
75+ }
76+ navLinks = { [ { href : '/tutorial' , children : 'Tutorial' } ] }
77+ developerMenu = { [
78+ {
79+ href : '/docs' ,
80+ icon : < PaperIcon /> ,
81+ children : 'Documentation' ,
82+ } ,
83+ {
84+ href : 'https://the-guild.dev/graphql/hive/blog' ,
85+ icon : < PencilIcon /> ,
86+ children : 'Blog' ,
87+ } ,
88+ {
89+ href : '/changelog' ,
90+ icon : < ListIcon /> ,
91+ children : 'Changelog' ,
92+ } ,
93+ {
94+ href : 'https://github.com/graphql-hive/graphql-yoga' ,
95+ icon : < GitHubIcon /> ,
96+ children : 'GitHub' ,
97+ } ,
98+ ] }
99+ search = { < VersionedSearch /> }
100+ >
101+ < VersionDropdown />
102+ </ HiveNavigation >
103+ }
104+ footer = {
105+ < HiveFooter
106+ logo = {
107+ < div className = "flex gap-2" >
108+ < YogaIcon className = "size-8 shrink-0" />
109+ < span className = "text-2xl font-medium tracking-[-0.16px]" > Yoga</ span >
110+ </ div >
111+ }
112+ description = { websiteDescription }
113+ />
114+ }
83115 >
84116 { children }
85- </ GuildLayout >
117+ </ HiveLayout >
86118 ) ;
87119} ;
88120
0 commit comments