@@ -351,13 +351,20 @@ function Toolbar({ border = 'top' }: { border?: 'top' | 'bottom' }) {
351351 return (
352352 < section
353353 className = { cn (
354- 'yv:flex yv:justify-center yv:gap-2 yv:p-4 yv:bg-background yv:border-border' ,
354+ 'yv:flex yv:justify-center yv:gap-2 yv:p-4 yv:bg-background yv:border-border yv:max-w-screen yv:overflow-x-hidden ' ,
355355 border === 'top' && 'yv:border-t' ,
356356 border === 'bottom' && 'yv:border-b' ,
357357 ) }
358358 >
359- < div className = { cn ( 'yv:flex yv:grow yv:w-full yv:items-center yv:max-w-lg yv:gap-3' ) } >
360- { ! ! yvContext ?. authEnabled && < UserMenu /> }
359+ < div
360+ className = { cn (
361+ 'yv:grid yv:w-full yv:items-center yv:sm:max-w-lg yv:max-w-[calc(100vw-2rem)] yv:gap-3' ,
362+ yvContext ?. authEnabled
363+ ? 'yv:grid-cols-[auto_1fr_auto_auto]'
364+ : 'yv:grid-cols-[1fr_auto_auto]' ,
365+ ) }
366+ >
367+ { yvContext ?. authEnabled && < UserMenu /> }
361368
362369 < BibleChapterPicker . Root
363370 book = { book }
@@ -369,11 +376,14 @@ function Toolbar({ border = 'top' }: { border?: 'top' | 'bottom' }) {
369376 >
370377 < BibleChapterPicker . Trigger >
371378 { ( { chapterLabel, currentBook, loading } ) => (
372- < div className = "yv:relative yv:grow" >
379+ < div
380+ className = "yv:grid yv:grid-cols-[auto_1fr_auto]
381+ yv:justify-start yv:grid-rows-1 yv:overflow-hidden yv:rounded-full yv:min-w-30 yv:bg-muted yv:text-muted-foreground yv:hover:bg-muted/80"
382+ >
373383 < Button
374- className = "yv:group yv:absolute yv:place-self-center yv:top-0 yv:bottom-0 yv:left-4 yv:z-10 yv: size-6! yv:-translate-x-2 yv:touch-hitbox"
384+ className = "yv:min-w-0 yv:group yv:place-self-center yv:max- size-9 yv:touch-hitbox"
375385 size = "icon"
376- variant = "secondary "
386+ variant = "ghost "
377387 disabled = { ! canNavigatePrevious }
378388 aria-label = "Previous chapter"
379389 onClick = { ( e ) => {
@@ -390,14 +400,21 @@ function Toolbar({ border = 'top' }: { border?: 'top' | 'bottom' }) {
390400 < Button
391401 size = "lg"
392402 variant = "secondary"
393- className = "yv:w-full yv:font-bold yv:text-foreground yv:tabular-nums "
403+ className = "yv:px-0 yv:font-bold yv:text-foreground yv:min-w-[5ch] "
394404 disabled = { loading }
395405 aria-label = "Change Bible book and chapter"
396406 >
397407 { loading ? (
398408 < LoaderIcon className = "yv:size-4 yv:animate-spin yv:text-muted-foreground" />
399409 ) : (
400- `${ currentBook ?. title || 'Select' } ${ chapterLabel || '' } `
410+ < >
411+ < span className = "yv:min-w-[3ch] yv:truncate" >
412+ { currentBook ?. title || 'Select' }
413+ </ span >
414+ < span className = "yv:tabular-nums yv:min-w-[1ch] yv:truncate" >
415+ { chapterLabel || '' }
416+ </ span >
417+ </ >
401418 ) }
402419 </ Button >
403420
@@ -409,9 +426,9 @@ function Toolbar({ border = 'top' }: { border?: 'top' | 'bottom' }) {
409426 setChapter ( nextResult . chapterId ) ;
410427 }
411428 } }
412- className = "yv:group yv:absolute yv:place-self-center yv:top-0 yv:bottom-0 yv:right-4 yv:z-10 yv: size-6! yv:translate-x-2 yv:touch-hitbox"
429+ className = "yv:min-w-0 yv:group yv:place-self-center yv:size-9 yv:touch-hitbox"
413430 size = "icon"
414- variant = "secondary "
431+ variant = "ghost "
415432 disabled = { ! canNavigateNext }
416433 aria-label = "Next chapter"
417434 >
@@ -432,7 +449,7 @@ function Toolbar({ border = 'top' }: { border?: 'top' | 'bottom' }) {
432449 < Button
433450 size = "lg"
434451 variant = "secondary"
435- className = "yv:font-bold yv:text-foreground"
452+ className = "yv:min-w-[calc(0.25rem*4*2+3ch)] yv:px-4 yv: font-bold yv:text-foreground"
436453 disabled = { loading }
437454 aria-label = { loading ? 'Loading Bible version' : 'Change Bible version' }
438455 >
@@ -441,7 +458,9 @@ function Toolbar({ border = 'top' }: { border?: 'top' | 'bottom' }) {
441458 { loading ? (
442459 < LoaderIcon className = "yv:size-4 yv:animate-spin yv:text-muted-foreground" />
443460 ) : (
444- version ?. localized_abbreviation || 'Select version'
461+ < span className = "yv:truncate" >
462+ { version ?. localized_abbreviation || 'Select version' }
463+ </ span >
445464 ) }
446465 </ div >
447466 </ Button >
@@ -489,12 +508,13 @@ function Toolbar({ border = 'top' }: { border?: 'top' | 'bottom' }) {
489508 A
490509 </ Button >
491510 </ div >
511+
492512 < div className = "yv:grid yv:grid-cols-2" >
493513 < Button
494514 className = { cn (
495- 'yv:group yv:dark:bg-muted yv:rounded-r-none yv:dark:border-border yv:rounded-l-[8px] yv:h-auto' ,
515+ 'yv:group yv:dark:bg-muted yv:rounded-r-none yv:border-r-0.5 yv: dark:border-border yv:rounded-l-[8px] yv:h-auto' ,
496516 currentFontFamily === INTER_FONT
497- ? 'yv:bg-black yv:dark:bg-inherit yv:text-white yv:hover:text-white yv:hover:bg-black /80'
517+ ? 'yv:bg-primary yv:border-primary yv: dark:bg-inherit yv:text-primary-foreground yv:hover:text-primary-foreground yv:hover:bg-primary /80'
498518 : '' ,
499519 ) }
500520 onClick = { ( ) => setCurrentFontFamily ( INTER_FONT ) }
@@ -511,14 +531,14 @@ function Toolbar({ border = 'top' }: { border?: 'top' | 'bottom' }) {
511531 >
512532 Font
513533 </ span >
514- < span className = "yv:text-xl" > Inter</ span >
534+ < span className = "yv:sm: text-xl yv:text-base " > Inter</ span >
515535 </ div >
516536 </ Button >
517537 < Button
518538 className = { cn (
519- 'yv:group yv:dark:bg-muted yv:rounded-l-none yv:rounded-r-[8px] yv:h-auto' ,
539+ 'yv:group yv:dark:bg-muted yv:border-l-0.5 yv: rounded-l-none yv:rounded-r-[8px] yv:h-auto' ,
520540 currentFontFamily === SOURCE_SERIF_FONT
521- ? 'yv:bg-black yv:dark:bg-inherit yv:text-white yv:hover:text-white yv:hover:bg-black /80'
541+ ? 'yv:bg-primary yv:border-primary yv: dark:bg-inherit yv:text-primary-foreground yv:hover:text-primary-foreground yv:hover:bg-primary /80'
522542 : '' ,
523543 ) }
524544 onClick = { ( ) => setCurrentFontFamily ( SOURCE_SERIF_FONT ) }
@@ -535,7 +555,7 @@ function Toolbar({ border = 'top' }: { border?: 'top' | 'bottom' }) {
535555 >
536556 Font
537557 </ span >
538- < span className = "yv:text-xl yv:font-serif" > Source Serif</ span >
558+ < span className = "yv:sm: text-xl yv:text-base yv:font-serif" > Source Serif</ span >
539559 </ div >
540560 </ Button >
541561 </ div >
0 commit comments