@@ -19,7 +19,6 @@ import React from "react";
19
19
import {
20
20
getMdxComponents ,
21
21
MDXH1 ,
22
- MDXH3 ,
23
22
MDXH4 ,
24
23
MDXWrapper ,
25
24
} from "../../components/client/MDX/MDX" ;
@@ -259,30 +258,31 @@ export function ResourceRoute(props: {
259
258
</ Inset >
260
259
</ Box >
261
260
) }
261
+
262
262
< Box >
263
- < MDXH3 > { props . resource . data . name } </ MDXH3 >
263
+ < Text size = "5" weight = { "bold" } className = "mt-2 block" >
264
+ { props . resource . data . name }
265
+ </ Text >
264
266
< Link
265
267
href = { AppUrl . creator ( {
266
268
id : props . creator . id ,
267
269
} ) }
268
270
color = "gray"
269
271
className = "hover:text-(--accent-12)"
270
272
>
271
- < Text size = { "4" } > By { props . creator . data . name } </ Text >
273
+ < Text size = { "3" } className = "block" >
274
+ By { props . creator . data . name }
275
+ </ Text >
272
276
</ Link >
273
277
</ Box >
274
278
</ Flex >
279
+ < Box > { renderLocalesDropdown ( ) } </ Box >
280
+
275
281
< Box >
276
282
{ Object . keys ( props . doc . sidebar . categories ) . map ( ( category ) => {
277
283
return (
278
284
< React . Fragment key = { category } >
279
- < Heading
280
- size = "1"
281
- mt = "3"
282
- mb = "1"
283
- className = "uppercase"
284
- color = "gray"
285
- >
285
+ < Heading size = "2" className = "mt-3 mb-2 uppercase" color = "gray" >
286
286
{ category }
287
287
</ Heading >
288
288
< Flex direction = "column" >
@@ -314,13 +314,7 @@ export function ResourceRoute(props: {
314
314
} ) }
315
315
{ Object . keys ( props . doc . sidebar . categories ) . length === 0 ? (
316
316
< >
317
- < Heading
318
- size = "1"
319
- mt = "3"
320
- mb = "1"
321
- className = "uppercase"
322
- color = "gray"
323
- >
317
+ < Heading size = "2" className = "mt-3 mb-2 uppercase" color = "gray" >
324
318
Chapters
325
319
</ Heading >
326
320
</ >
@@ -348,43 +342,46 @@ export function ResourceRoute(props: {
348
342
) ;
349
343
} ) }
350
344
</ Box >
351
- < Box >
352
- < Select . Root
353
- defaultValue = { props . resource . data . _locale }
354
- size = { "1" }
355
- onValueChange = { ( newLocale ) => {
356
- location . href = AppUrl . resourcePage ( {
357
- id : [
358
- props . resource . data . _idWithoutLocale ,
359
- newLocale === "en" ? "" : newLocale ,
360
- ] . join ( "/" ) as CollectionEntry < "resources" > [ "id" ] ,
361
- page : "" ,
362
- } ) ;
363
- } }
364
- >
365
- < Select . Trigger />
366
- < Select . Content >
367
- { props . locales . map ( ( locale ) => {
368
- const codeToWord : Record < string , string > = {
369
- en : "English" ,
370
- es : "Español" ,
371
- fr : "Français" ,
372
- it : "Italiano" ,
373
- ua : "Українська" ,
374
- } ;
375
- return (
376
- < Select . Item key = { locale } value = { locale } >
377
- { codeToWord [ locale ] }
378
- </ Select . Item >
379
- ) ;
380
- } ) }
381
- </ Select . Content >
382
- </ Select . Root >
383
- </ Box >
384
345
</ Flex >
385
346
) ;
386
347
}
387
348
349
+ function renderLocalesDropdown ( ) {
350
+ return (
351
+ < Select . Root
352
+ defaultValue = { props . resource . data . _locale }
353
+ size = { "2" }
354
+ onValueChange = { ( newLocale ) => {
355
+ location . href = AppUrl . resourcePage ( {
356
+ id : [
357
+ props . resource . data . _idWithoutLocale ,
358
+ newLocale === "en" ? "" : newLocale ,
359
+ ] . join ( "/" ) as CollectionEntry < "resources" > [ "id" ] ,
360
+ page : "" ,
361
+ } ) ;
362
+ } }
363
+ >
364
+ < Select . Trigger className = "w-full" variant = "surface" />
365
+ < Select . Content >
366
+ { props . locales . map ( ( locale ) => {
367
+ const codeToWord : Record < string , string > = {
368
+ en : "English" ,
369
+ es : "Español" ,
370
+ fr : "Français" ,
371
+ it : "Italiano" ,
372
+ ua : "Українська" ,
373
+ } ;
374
+ return (
375
+ < Select . Item key = { locale } value = { locale } >
376
+ { codeToWord [ locale ] }
377
+ </ Select . Item >
378
+ ) ;
379
+ } ) }
380
+ </ Select . Content >
381
+ </ Select . Root >
382
+ ) ;
383
+ }
384
+
388
385
function renderToc ( ) {
389
386
return (
390
387
< >
0 commit comments